public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ding Tianhong <dingtianhong@huawei•com>
To: Jay Vosburgh <fubar@us•ibm.com>,
	Andy Gospodarek <andy@greyhouse•net>,
	"David S. Miller" <davem@davemloft•net>,
	Veaceslav Falico <vfalico@redhat•com>,
	Netdev <netdev@vger•kernel.org>,
	Scott Feldman <sfeldma@cumulusnetworks•com>
Subject: [PATCH net-next v2 2/3] bonding: ust micro BOND_NO_USE_ARP to simplify the mode check
Date: Sat, 21 Dec 2013 14:40:17 +0800	[thread overview]
Message-ID: <52B537D1.1060604@huawei.com> (raw)

The bond 3ad and TLB/ALB has the same check path, so combine them.

Signed-off-by: Ding Tianhong <dingtianhong@huawei•com>
---
 drivers/net/bonding/bond_main.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 368f7e4..695f8a4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4071,8 +4071,8 @@ static int bond_check_params(struct bond_params *params)
 		num_peer_notif = 1;
 	}
 
-	/* reset values for 802.3ad */
-	if (bond_mode == BOND_MODE_8023AD) {
+	/* reset values for 802.3ad/TLB/ALB */
+	if (BOND_NO_USES_ARP(bond_mode)) {
 		if (!miimon) {
 			pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n");
 			pr_warning("Forcing miimon to 100msec\n");
@@ -4107,16 +4107,6 @@ static int bond_check_params(struct bond_params *params)
 		packets_per_slave = 1;
 	}
 
-	/* reset values for TLB/ALB */
-	if ((bond_mode == BOND_MODE_TLB) ||
-	    (bond_mode == BOND_MODE_ALB)) {
-		if (!miimon) {
-			pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure and link speed which are essential for TLB/ALB load balancing\n");
-			pr_warning("Forcing miimon to 100msec\n");
-			miimon = BOND_DEFAULT_MIIMON;
-		}
-	}
-
 	if (bond_mode == BOND_MODE_ALB) {
 		pr_notice("In ALB mode you might experience client disconnections upon reconnection of a link if the bonding module updelay parameter (%d msec) is incompatible with the forwarding delay time of the switch\n",
 			  updelay);
-- 
1.8.0

                 reply	other threads:[~2013-12-21  6:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52B537D1.1060604@huawei.com \
    --to=dingtianhong@huawei$(echo .)com \
    --cc=andy@greyhouse$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=fubar@us$(echo .)ibm.com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sfeldma@cumulusnetworks$(echo .)com \
    --cc=vfalico@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox