From patchwork Fri Dec 20 05:10:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Tianhong X-Patchwork-Id: 303887 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 EB9D32C0300 for ; Fri, 20 Dec 2013 16:11:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753905Ab3LTFLw (ORCPT ); Fri, 20 Dec 2013 00:11:52 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:30315 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753908Ab3LTFLu (ORCPT ); Fri, 20 Dec 2013 00:11:50 -0500 Received: from 172.24.2.119 (EHLO szxeml207-edg.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AIA43327; Fri, 20 Dec 2013 13:11:32 +0800 (CST) Received: from SZXEML456-HUB.china.huawei.com (10.82.67.199) by szxeml207-edg.china.huawei.com (172.24.2.56) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 20 Dec 2013 13:11:08 +0800 Received: from [127.0.0.1] (10.135.72.199) by szxeml456-hub.china.huawei.com (10.82.67.199) with Microsoft SMTP Server id 14.3.158.1; Fri, 20 Dec 2013 13:11:07 +0800 Message-ID: <52B3D163.3090600@huawei.com> Date: Fri, 20 Dec 2013 13:10:59 +0800 From: Ding Tianhong User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Jay Vosburgh , Andy Gospodarek , "David S. Miller" , Veaceslav Falico , Netdev Subject: [PATCH net-next 2/3] bonding: ust micro BOND_NO_USE_ARP to simplify the mode check X-Originating-IP: [10.135.72.199] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The bond 3ad and TLB/ALB has the same check path, so combine them. Signed-off-by: Ding Tianhong --- 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);