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 6AF7BA0471 for ; Fri, 19 Jul 2019 10:42:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 36D7C1DBF; Fri, 19 Jul 2019 10:42:47 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9B0401DBF for ; Fri, 19 Jul 2019 10:42:45 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2019 01:42:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,281,1559545200"; d="scan'208,223";a="179565049" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga002.jf.intel.com with ESMTP; 19 Jul 2019 01:42:42 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.229]) by IRSMSX151.ger.corp.intel.com ([169.254.4.41]) with mapi id 14.03.0439.000; Fri, 19 Jul 2019 09:42:42 +0100 From: "Rybalchenko, Kirill" To: Yongseok Koh CC: "stable@dpdk.org" Thread-Topic: [dpdk-stable][PATCH 17.11] net/bonding: fix reset active slave Thread-Index: AdU+DT7vQN7T8NyaSqWLWVX1kkvilA== Date: Fri, 19 Jul 2019 08:42:42 +0000 Message-ID: <696B43C21188DF4F9C9091AAE4789B8260FFEB0F@IRSMSX108.ger.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2U3Y2JjYTktMGM0MS00MWM5LWJlN2ItYWU1NmM5MWJiNTRjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZ3hhSWZ6V3pzd0lqKzdyS2pnTldVNXdjT1Izd2RGSjZjOGtmZklRa0RVNGs4eFl5VlwvY0Q3VzJXaWVmUW5mc3UifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.182] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [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" From: Hari Kumar Vemula [ backported from upstream commit 7f949ae391527200266afa59097317ef0047111e = ] test_alb_reply_from_client test fails due to incorrect active slave array's= index. This was due to invalid active slave count. Count of internals->active_slave is not updated even when active slave is d= eactivated. Hence active slave count always keeps incrementing beyond the actual active= slaves. Fix is to set the internals->active_slave to starting index 0 whenever it e= xceeds the number of slaves in active slave list and also update the active= slave count during slave de-activation. Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness") Cc: stable@dpdk.org Signed-off-by: Hari Kumar Vemula Acked-by: Radu Nicolau --- drivers/net/bonding/rte_eth_bond_api.c | 6 ++++++ drivers/net/bonding/rte= _eth_bond_pmd.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/r= te_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; + /* 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/drive= rs/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 **buf= s, uint16_t nb_pkts) active_slave =3D 0; } - 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, str= uct rte_mbuf **bufs, active_slave =3D 0; } - if (++internals->active_slave =3D=3D slave_count) + if (++internals->active_slave >=3D slave_count) internals->active_slave =3D 0; return num_rx_total; @@ -494,7 +494,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbu= f **bufs, idx =3D 0; } - if (++internals->active_slave =3D=3D slave_count) + if (++internals->active_slave >=3D slave_count) internals->active_slave =3D 0; return num_rx_total; -- 2.7.4