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 D7284A046B for ; Tue, 23 Jul 2019 03:01:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B9ABC1BEED; Tue, 23 Jul 2019 03:01:40 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id B26751BEDB for ; Tue, 23 Jul 2019 03:01:39 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Jul 2019 04:01:38 +0300 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6N11Hew026580; Tue, 23 Jul 2019 04:01:36 +0300 From: Yongseok Koh To: Hari Kumar Vemula Cc: Radu Nicolau , Chas Williams , dpdk stable Date: Mon, 22 Jul 2019 17:59:39 -0700 Message-Id: <20190723010115.6446-12-yskoh@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190723010115.6446-1-yskoh@mellanox.com> References: <20190723010115.6446-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bonding: fix reset active slave' has been queued to LTS release 17.11.7 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" Hi, FYI, your patch has been queued to LTS release 17.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objection by 07/27/19. So please shout if anyone has objection. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Yongseok --- >From fb0fa08ace2238894e9448547afd301cf611b99a Mon Sep 17 00:00:00 2001 From: Hari Kumar Vemula Date: Mon, 18 Feb 2019 11:59:23 +0000 Subject: [PATCH] net/bonding: fix reset active slave [ 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 deactivated. 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 exceeds 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") Signed-off-by: Hari Kumar Vemula Acked-by: Radu Nicolau Acked-by: Chas Williams --- 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/rte_eth_bond_api.c index f4ca0a3f6f..5f46dff66b 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 = active_count; + /* Resetting active_slave when reaches to max + * no of slaves in active list + */ + if (internals->active_slave >= active_count) + internals->active_slave = 0; + if (eth_dev->data->dev_started) { if (internals->mode == BONDING_MODE_8023AD) { bond_mode_8023ad_start(eth_dev); diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 5ea1bf99ac..409bcb5d72 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 **bufs, uint16_t nb_pkts) active_slave = 0; } - if (++internals->active_slave == slave_count) + if (++internals->active_slave >= slave_count) internals->active_slave = 0; return num_rx_total; } @@ -315,7 +315,7 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, active_slave = 0; } - if (++internals->active_slave == slave_count) + if (++internals->active_slave >= slave_count) internals->active_slave = 0; return num_rx_total; @@ -494,7 +494,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, idx = 0; } - if (++internals->active_slave == slave_count) + if (++internals->active_slave >= slave_count) internals->active_slave = 0; return num_rx_total; -- 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-07-22 17:55:07.172879168 -0700 +++ 0012-net-bonding-fix-reset-active-slave.patch 2019-07-22 17:55:05.810467000 -0700 @@ -1,8 +1,10 @@ -From 7f949ae391527200266afa59097317ef0047111e Mon Sep 17 00:00:00 2001 +From fb0fa08ace2238894e9448547afd301cf611b99a Mon Sep 17 00:00:00 2001 From: Hari Kumar Vemula Date: Mon, 18 Feb 2019 11:59:23 +0000 Subject: [PATCH] net/bonding: fix reset active slave +[ 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. @@ -16,7 +18,6 @@ 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 @@ -27,10 +28,10 @@ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c -index 57ef2f0015..b55752ed3d 100644 +index f4ca0a3f6f..5f46dff66b 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c -@@ -129,6 +129,12 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) +@@ -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 = active_count; @@ -44,10 +45,10 @@ if (internals->mode == BONDING_MODE_8023AD) { bond_mode_8023ad_start(eth_dev); diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c -index f65db4410e..b0d191d132 100644 +index 5ea1bf99ac..409bcb5d72 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c -@@ -84,7 +84,7 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) +@@ -111,7 +111,7 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) active_slave = 0; } @@ -56,7 +57,7 @@ internals->active_slave = 0; return num_rx_total; } -@@ -288,7 +288,7 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, +@@ -315,7 +315,7 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, active_slave = 0; } @@ -65,7 +66,7 @@ internals->active_slave = 0; return num_rx_total; -@@ -474,7 +474,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, +@@ -494,7 +494,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, idx = 0; }