From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 3D122A00E6 for ; Thu, 21 Mar 2019 13:29:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2BA2B1B47C; Thu, 21 Mar 2019 13:29:21 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 064D81B4B1 for ; Thu, 21 Mar 2019 13:29:20 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 66C6E8535D; Thu, 21 Mar 2019 12:29:19 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-76.ams2.redhat.com [10.36.116.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5317560BE5; Thu, 21 Mar 2019 12:29:18 +0000 (UTC) From: Kevin Traynor To: Hari Kumar Vemula Cc: Radu Nicolau , Chas Williams , dpdk stable Date: Thu, 21 Mar 2019 12:29:00 +0000 Message-Id: <20190321122903.668-2-ktraynor@redhat.com> In-Reply-To: <20190321122903.668-1-ktraynor@redhat.com> References: <20190321122903.668-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 21 Mar 2019 12:29:19 +0000 (UTC) Subject: [dpdk-stable] patch 'net/bonding: fix reset active slave' has been queued to LTS release 18.11.1 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 18.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/22/19. So please shout if anyone has objections. 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. Kevin Traynor --- >From 097b88b0ee059af79061ac50d6397bccf82b2f14 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 e5e146540..ac084c4fd 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -130,4 +130,10 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) 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) { diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 44deaf119..7ed69b388 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -85,5 +85,5 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } - if (++internals->active_slave == slave_count) + if (++internals->active_slave >= slave_count) internals->active_slave = 0; return num_rx_total; @@ -289,5 +289,5 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, } - if (++internals->active_slave == slave_count) + if (++internals->active_slave >= slave_count) internals->active_slave = 0; @@ -475,5 +475,5 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, } - if (++internals->active_slave == slave_count) + if (++internals->active_slave >= slave_count) internals->active_slave = 0; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-03-21 11:21:26.394964369 +0000 +++ 0002-net-bonding-fix-reset-active-slave.patch 2019-03-21 11:21:26.289140996 +0000 @@ -1,8 +1,10 @@ -From 7f949ae391527200266afa59097317ef0047111e Mon Sep 17 00:00:00 2001 +From 097b88b0ee059af79061ac50d6397bccf82b2f14 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,7 +28,7 @@ 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 57ef2f001..b55752ed3 100644 +index e5e146540..ac084c4fd 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -130,4 +130,10 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) @@ -42,7 +43,7 @@ if (eth_dev->data->dev_started) { if (internals->mode == BONDING_MODE_8023AD) { diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c -index f65db4410..b0d191d13 100644 +index 44deaf119..7ed69b388 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -85,5 +85,5 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)