From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14C3FA046B for ; Tue, 23 Jul 2019 03:25:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A65981BED6; Tue, 23 Jul 2019 03:25:46 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40064.outbound.protection.outlook.com [40.107.4.64]) by dpdk.org (Postfix) with ESMTP id D78B51BED6 for ; Tue, 23 Jul 2019 03:25:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yz3BX0TuC65aaaRtoVQTjY+NLChh6yr7+oHZ/7Gvq36j9DzG0XdGkJZcPmlz3qXBNSOyjamTJzq8MT4+07SrkxWayGbPXiZ/oF1eabRoz3QoJ+kcAB9i3gppKtE/TASFqvgHI5j677bKz7OGyUpsn2fUDCL8xH1ug2u1KJGISrZAlvrA5IvakyFwWB37XraEOzKj9fUXj11L1qfDoeLYC2cFHmUc14IIkF0Pxdte7hP1GhyuGiF+0c1tr7nW2z8HsdHMjUXuy4GDVepcEBzdDJhMhfM8t3aWjINy04jIAiZGEjOu72qvAntn/nK30fMCsBlEdNaX2+sHEMapHvIu7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zQNYshhXUH2JylE1n28zuk+i7O6BR06tn4EXgjty3JE=; b=Jd7NrsSHp+eImOcaMBVq5Z1MAXVT3nFyntCiYyyB+ZU+W7Vt6JE6qobhgNAejnkP+raS2tEHxpE/P8UZfqKTzN3tdAkFx3WW3f1ldp1Z+5xDph5DkQqyUMNIMN0aRSZFQoOONR8mp2Fkl+uT5aVbAsGlt8DM7dsgucpVX8fzB7TPifq5gBD1cQyHe9+8NtxbPY+mwBmCPhgMPIOL70kFodeIoIC7i7ohErTpq33D+Te+gOgZIWDNy2+HOC9SEqmuvonhTz3NckfY/uKcGEo3d42j+O0KaYWBKNJ7V+MhSBrRele2O6TqpoB+lerWYZZt4TUSDar3LYVt3gc1Gc7UVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=mellanox.com;dmarc=pass action=none header.from=mellanox.com;dkim=pass header.d=mellanox.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zQNYshhXUH2JylE1n28zuk+i7O6BR06tn4EXgjty3JE=; b=UEgUa9VgDkRFFIomnCpG2n3ooCCQexic2TZl/HxZaZDK+T7uMWRCSQ/Y4MOWRemli00ruiprsEi6oO1jv5cXnKQH16dM89Q066MOp+Jl1gNccG+EVDwpDnyPViatx25YH5RUZxDT2DuC5Y0rzTJclqoqKj+VDiN9IzV/ji2Ht+U= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3962.eurprd05.prod.outlook.com (52.134.67.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.16; Tue, 23 Jul 2019 01:25:43 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::69c1:c0d7:1fa1:f89f]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::69c1:c0d7:1fa1:f89f%6]) with mapi id 15.20.2094.013; Tue, 23 Jul 2019 01:25:43 +0000 From: Yongseok Koh To: "Rybalchenko, Kirill" CC: "stable@dpdk.org" Thread-Topic: [dpdk-stable][PATCH 17.11] net/bonding: fix reset active slave Thread-Index: AdU+DT7vQN7T8NyaSqWLWVX1kkvilAC6EwIA Date: Tue, 23 Jul 2019 01:25:43 +0000 Message-ID: <9375387C-E58C-4AA1-9167-78D9D4C84E23@mellanox.com> References: <696B43C21188DF4F9C9091AAE4789B8260FFEB0F@IRSMSX108.ger.corp.intel.com> In-Reply-To: <696B43C21188DF4F9C9091AAE4789B8260FFEB0F@IRSMSX108.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1b2848c0-7f64-4eda-31d4-08d70f0cae4f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB3962; x-ms-traffictypediagnostic: DB3PR0502MB3962: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:361; x-forefront-prvs: 0107098B6C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(136003)(39860400002)(376002)(396003)(199004)(189003)(26005)(478600001)(8676002)(6246003)(25786009)(316002)(6436002)(99286004)(7736002)(91956017)(76116006)(66946007)(446003)(305945005)(186003)(102836004)(486006)(6916009)(71190400001)(71200400001)(66476007)(66446008)(64756008)(66556008)(5660300002)(81156014)(2616005)(81166006)(86362001)(4326008)(33656002)(8936002)(53546011)(476003)(256004)(76176011)(14454004)(6506007)(2906002)(6486002)(6512007)(36756003)(11346002)(229853002)(14444005)(66066001)(3846002)(53936002)(68736007)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3962; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: iDffdafS3y1PZfYmotG8RibaRQhSpGumNZFjU3fGKwAqipgcKFojI1T7qPMAHdNqZ/wwtX6qY27pBpi53xp26DqHCLss15bS5xB/B3Dn0LNWV3w7MNyJasgwS3qyVZfVmJ5t5uKGnNPlh1Fa82kD4v9MJv3SDtMlb8yoqPTgVyAEi37Vj1hOELLIpJoHh7nbuoQ+5oBE8+r2/0o0OmyMummyM6B6Zkeg8DB9gmhwcVk/ykmllNAJdULeicKiGetkT5qLKWKx5LE1hcbfjfCggqOfVt27F+79g9WiSjxxlbUWLRalo0/yju7SCDZENSIBHp0UJyy3NmIEbBfbDWpq0e4/3Y8kkTs1W1Xgg1y/c11vL7UlriJs1qxn20SDWwSojDZxkkWbIMfMHQWleW2pX19Avv8Xm+oMSN8/04izafs= Content-Type: text/plain; charset="us-ascii" Content-ID: <21D3070107F7354E943B4BD6DC7744E4@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b2848c0-7f64-4eda-31d4-08d70f0cae4f X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2019 01:25:43.2685 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yskoh@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3962 Subject: Re: [dpdk-stable] [PATCH 17.11] net/bonding: fix reset active slave X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > On Jul 19, 2019, at 1:42 AM, Rybalchenko, Kirill wrote: >=20 > From: Hari Kumar Vemula >=20 > [ backported from upstream commit 7f949ae391527200266afa59097317ef0047111= e ] >=20 > test_alb_reply_from_client test fails due to incorrect active slave array= 's index. This was due to invalid active slave count. >=20 > Count of internals->active_slave is not updated even when active slave is= deactivated. > Hence active slave count always keeps incrementing beyond the actual acti= ve slaves. >=20 > Fix is to set the internals->active_slave to starting index 0 whenever it= exceeds the number of slaves in active slave list and also update the acti= ve slave count during slave de-activation. >=20 > Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness") > Cc: stable@dpdk.org >=20 > Signed-off-by: Hari Kumar Vemula > Acked-by: Radu Nicolau Acked-by: Chas Williams > --- Hi,=20 You might probably see my email. This patch has been merged from upstream. Thanks, Yongseok > drivers/net/bonding/rte_eth_bond_api.c | 6 ++++++ drivers/net/bonding/rt= e_eth_bond_pmd.c | 6 +++--- > 2 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding= /rte_eth_bond_api.c > index f4ca0a3..5f46dff 100644 > --- a/drivers/net/bonding/rte_eth_bond_api.c > +++ b/drivers/net/bonding/rte_eth_bond_api.c > @@ -158,6 +158,12 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint16= _t port_id) > RTE_ASSERT(active_count < RTE_DIM(internals->active_slaves)); > internals->active_slave_count =3D active_count; >=20 > + /* Resetting active_slave when reaches to max > + * no of slaves in active list > + */ > + if (internals->active_slave >=3D active_count) > + internals->active_slave =3D 0; > + > if (eth_dev->data->dev_started) { > if (internals->mode =3D=3D BONDING_MODE_8023AD) { > bond_mode_8023ad_start(eth_dev); diff --git a/driv= ers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index 44cf61b..410f9d5 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -111,7 +111,7 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **b= ufs, uint16_t nb_pkts) > active_slave =3D 0; > } >=20 > - if (++internals->active_slave =3D=3D slave_count) > + if (++internals->active_slave >=3D slave_count) > internals->active_slave =3D 0; > return num_rx_total; > } > @@ -315,7 +315,7 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, s= truct rte_mbuf **bufs, > active_slave =3D 0; > } >=20 > - if (++internals->active_slave =3D=3D slave_count) > + if (++internals->active_slave >=3D slave_count) > internals->active_slave =3D 0; >=20 > return num_rx_total; > @@ -494,7 +494,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_m= buf **bufs, > idx =3D 0; > } >=20 > - if (++internals->active_slave =3D=3D slave_count) > + if (++internals->active_slave >=3D slave_count) > internals->active_slave =3D 0; >=20 > return num_rx_total; > -- > 2.7.4 >=20 > <0001-net-bonding-fix-reset-active-slave.patch>