From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0066.outbound.protection.outlook.com [104.47.1.66]) by dpdk.org (Postfix) with ESMTP id 6782E695D for ; Mon, 16 Apr 2018 10:06:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bihwxloiAi2VoIKJDxjBBBvfLJ8eZnNLsssOs+r2pV8=; b=EhDjs//M0rWiOcT60hrBz+KrcGoTNqRl6OMhrmGRt89BkHDSoUcNd15witd1wGwgvh/8DKCc4XCIs3y5x9zsDBMsd2EG8hUx/lTDTR475XkCJbYYq0xzFTX2mJ5s3xqlOlpq9ud788hx0HB6tjSCaZZB9KcCCNoqaNXapFpjIGY= Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com (10.172.215.19) by AM4PR0501MB2226.eurprd05.prod.outlook.com (10.165.82.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.675.10; Mon, 16 Apr 2018 08:06:13 +0000 Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::6885:c169:afcb:37e6]) by AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::6885:c169:afcb:37e6%9]) with mapi id 15.20.0675.015; Mon, 16 Apr 2018 08:06:13 +0000 From: Matan Azrad To: Chas Williams <3chas3@gmail.com>, "dev@dpdk.org" CC: "declan.doherty@intel.com" , Chas Williams Thread-Topic: [dpdk-dev] [PATCH] net/bonding: fix link properties with autoneg Thread-Index: AQHTpR2iIm/QNgh1SUuRTRkr+OQPyqQDVrrg Date: Mon, 16 Apr 2018 08:06:13 +0000 Message-ID: References: <20180213225430.15556-1-3chas3@gmail.com> In-Reply-To: <20180213225430.15556-1-3chas3@gmail.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0501MB2226; 7:YBtE04PlQ7NlWCGQhNaUUvb9NvlX18FU6WQrJ2TcFNbGQ3thuP5RdgOVRDgdq0/IqVVkNv7NZt7pgC2itbVOPZoWU5LQmrsV+/rNUVucBRYXmgMFladHAmf/zewAlwtJ+gwpVM6glJyHy+KMdwJlR5uU3iqdU9KHPDfvvqaf2gYuE/BY5SXPrJ/kMBjLRB89KMn1AjWNfT/0jlm33oPXT6RI2YuRT3NkLI63yEOdMeqIlJhSQ4FMoAas7U1S2g8v x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM4PR0501MB2226; x-ms-traffictypediagnostic: AM4PR0501MB2226: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(97927398514766); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231232)(944501327)(52105095)(6055026)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM4PR0501MB2226; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2226; x-forefront-prvs: 0644578634 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(376002)(39860400002)(396003)(346002)(189003)(199004)(186003)(86362001)(486006)(55016002)(39060400002)(476003)(11346002)(68736007)(9686003)(446003)(26005)(478600001)(76176011)(8936002)(316002)(97736004)(4326008)(6436002)(53936002)(7736002)(229853002)(2501003)(305945005)(74316002)(33656002)(3280700002)(14454004)(7696005)(2906002)(106356001)(105586002)(3660700001)(5660300001)(6116002)(3846002)(6246003)(66066001)(25786009)(6506007)(2900100001)(81156014)(8676002)(5250100002)(99286004)(110136005)(54906003)(81166006)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2226; H:AM4PR0501MB2657.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ggUjdoDZ9QpiZi6TLcVa/HdSoKgpWiIroIiVThqRAQ0xFtmBzU0uCMW2F0kiW+hPEZa+iK1Ff5kO9Z+CTXV7mx4Oo25dS7ZI7P6LQ/ymYMjpzGsmTGUc3yKKKfmYOkHUZTaoQG+p12qmJ550aq2RopKjL8AYhpamBvkF1HO3S/zvwN+bg4lUZThYfjN0azQh spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 1daf53a5-5ba8-42a7-a5be-08d5a370ec31 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1daf53a5-5ba8-42a7-a5be-08d5a370ec31 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2018 08:06:13.5903 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2226 Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix link properties with autoneg X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 08:06:16 -0000 Hi Chas From: Chas Williams, Wednesday, February 14, 2018 12:55 AM > If a link is carrier down and using autonegotiation, then the PMD may not > have detected a speed yet. In this case the best we can do is ignore the= link > speed and duplex since they aren't valid. Ok for this. > To be completely correct, there > should be additional checks to prevent a slave that negotiates a differen= t > speed from being activated. Looks like every changing in the link properties should cause LSC interrupt= . In the bonding LCS interrupt you could handle and to deactivate the device. Also you should deal with the case of the first slave, what is happen if th= e first slave has invalid link properties? How can you know that the speed\duplex_mode is invalid? Are we sure LACP mode can run with auto negotiation? =20 >=20 > Signed-off-by: Chas Williams > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c > b/drivers/net/bonding/rte_eth_bond_pmd.c > index 92ad688..5559879 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -1545,9 +1545,10 @@ link_properties_valid(struct rte_eth_dev > *ethdev, > if (bond_ctx->mode =3D=3D BONDING_MODE_8023AD) { > struct rte_eth_link *bond_link =3D &bond_ctx- > >mode4.slave_link; >=20 > - if (bond_link->link_duplex !=3D slave_link->link_duplex || > - bond_link->link_autoneg !=3D slave_link->link_autoneg > || > - bond_link->link_speed !=3D slave_link->link_speed) > + if (bond_link->link_autoneg !=3D slave_link->link_autoneg || > + (bond_link->link_autoneg !=3D ETH_LINK_AUTONEG && > + (bond_link->link_duplex !=3D slave_link->link_duplex || > + bond_link->link_speed !=3D slave_link->link_speed))) > return -1; > } >=20 > -- > 2.9.5