From patchwork Sun Mar 29 11:20:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nayshtut X-Patchwork-Id: 455745 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6853414007D for ; Sun, 29 Mar 2015 22:20:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751623AbbC2LUi (ORCPT ); Sun, 29 Mar 2015 07:20:38 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:33458 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160AbbC2LUg (ORCPT ); Sun, 29 Mar 2015 07:20:36 -0400 Received: by wgbgs4 with SMTP id gs4so51105827wgb.0 for ; Sun, 29 Mar 2015 04:20:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NFOTD6j/Qq2/Bywz87uvroiBf1TaAKRa9/yAHAJ0d2U=; b=ZJNDvKHfyjNAa6nadACulCPfP8bXIn8UCQ7hbUXTYiXymPbNefveQZ3dYYj9wjxuby 4LvN1FoTPE01fabfq+4hBI+g8utiFAfCcKO/rN6Skz08poXOejCdZEfXtmNWqhjoj/XT KqHn7oROoE3CiqGFo6vVu9bT92BN8fpiuvAVqnu+wTilrgKJ1GOs77KNMqn3UKN77D+n tbch4Jk/UCzuI9yHDh9GWtugcz/zNYLK923hwPvAEfesj3BXVQnvkON6jdtzkML8bC6q B7m2L1tCnU7fJHvPfV3EbdYv4TM0gVmJg0zQhS8D9AwfGknvXwfr1PIKHjmmBidWDsWw CZ/w== X-Gm-Message-State: ALoCoQmPHJ/lTi1HKOqHzfhWB84WDfEijSGCcch7yo88JOWqyO9z9zaXjAr6mb+KA8XwtpoIakg1 X-Received: by 10.180.88.65 with SMTP id be1mr12458990wib.50.1427628035116; Sun, 29 Mar 2015 04:20:35 -0700 (PDT) Received: from gretzky.swtex.com (192.117.6.36.static.012.net.il. [192.117.6.36]) by mx.google.com with ESMTPSA id ub1sm10812993wjc.43.2015.03.29.04.20.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Mar 2015 04:20:34 -0700 (PDT) From: Anton Nayshtut To: Jay Vosburgh , Veaceslav Falico , Andy Gospodarek Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Anton Nayshtut , Alexey Bogoslavsky Subject: [PATCH] Bonding Overriding Configuration logic restored. Date: Sun, 29 Mar 2015 14:20:25 +0300 Message-Id: <1427628025-9752-1-git-send-email-anton@swortex.com> X-Mailer: git-send-email 1.9.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Before commit 3900f29021f0bc7fe9815aa32f1a993b7dfdd402 ("bonding: slight optimizztion for bond_slave_override()") the override logic was to send packets with non-zero queue_id through the slave with corresponding queue_id, under two conditions only - if the slave can transmit and it's up. The above mentioned commit changed this logic by introducing an additional condition - whether the bond is active (indirectly, using the slave_can_tx and later - bond_is_active_slave), that prevents the user from implementing more complex policies according to the Documentation/networking/bonding.txt. Signed-off-by: Anton Nayshtut Signed-off-by: Alexey Bogoslavsky Signed-off-by: Andy Gospodarek --- drivers/net/bonding/bond_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 0dceba1..68ad39a 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3797,7 +3797,8 @@ static inline int bond_slave_override(struct bonding *bond, /* Find out if any slaves have the same mapping as this skb. */ bond_for_each_slave_rcu(bond, slave, iter) { if (slave->queue_id == skb->queue_mapping) { - if (bond_slave_can_tx(slave)) { + if (bond_slave_is_up(slave) && + slave->link == BOND_LINK_UP) { bond_dev_queue_xmit(bond, skb, slave->dev); return 0; }