From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 808C51B4AA for ; Thu, 29 Nov 2018 14:22:18 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0CE43082129; Thu, 29 Nov 2018 13:22:17 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-230.ams2.redhat.com [10.36.117.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id F19DD1001F50; Thu, 29 Nov 2018 13:22:15 +0000 (UTC) From: Kevin Traynor To: Radu Nicolau Cc: Chas Williams , dpdk stable Date: Thu, 29 Nov 2018 13:20:19 +0000 Message-Id: <20181129132128.7609-19-ktraynor@redhat.com> In-Reply-To: <20181129132128.7609-1-ktraynor@redhat.com> References: <20181129132128.7609-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 29 Nov 2018 13:22:17 +0000 (UTC) Subject: [dpdk-stable] patch 'net/bonding: fix crash when stopping mode 4 port' has been queued to stable release 18.08.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: , X-List-Received-Date: Thu, 29 Nov 2018 13:22:18 -0000 Hi, FYI, your patch has been queued to stable release 18.08.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 12/08/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 598a25cee224700a2411521878b2ad670db94303 Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Thu, 8 Nov 2018 15:26:42 +0000 Subject: [PATCH] net/bonding: fix crash when stopping mode 4 port [ upstream commit 0911d4ec01839c9149a0df5758d00d9d57a47cea ] When stopping a bonded port all slaves are deactivated. Attempting to deactivate a slave that was never activated will result in a segfault when mode 4 is used. Fixes: 7486331308f6 ("net/bonding: stop and deactivate slaves on stop") Signed-off-by: Radu Nicolau Acked-by: Chas Williams --- drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index d03f7ce7e..e3e2e83be 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2180,7 +2180,12 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) internals->link_status_polling_enabled = 0; for (i = 0; i < internals->slave_count; i++) { - internals->slaves[i].last_link_status = 0; - rte_eth_dev_stop(internals->slaves[i].port_id); - deactivate_slave(eth_dev, internals->slaves[i].port_id); + uint16_t slave_id = internals->slaves[i].port_id; + if (find_slave_by_id(internals->active_slaves, + internals->active_slave_count, slave_id) != + internals->active_slave_count) { + internals->slaves[i].last_link_status = 0; + rte_eth_dev_stop(slave_id); + deactivate_slave(eth_dev, slave_id); + } } } -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 13:11:35.499945566 +0000 +++ 0018-net-bonding-fix-crash-when-stopping-mode-4-port.patch 2018-11-29 13:11:34.000000000 +0000 @@ -1,14 +1,15 @@ -From 0911d4ec01839c9149a0df5758d00d9d57a47cea Mon Sep 17 00:00:00 2001 +From 598a25cee224700a2411521878b2ad670db94303 Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Thu, 8 Nov 2018 15:26:42 +0000 Subject: [PATCH] net/bonding: fix crash when stopping mode 4 port +[ upstream commit 0911d4ec01839c9149a0df5758d00d9d57a47cea ] + When stopping a bonded port all slaves are deactivated. Attempting to deactivate a slave that was never activated will result in a segfault when mode 4 is used. Fixes: 7486331308f6 ("net/bonding: stop and deactivate slaves on stop") -Cc: stable@dpdk.org Signed-off-by: Radu Nicolau Acked-by: Chas Williams @@ -17,10 +18,10 @@ 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c -index 1a6d8e4df..2661620ab 100644 +index d03f7ce7e..e3e2e83be 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c -@@ -2182,7 +2182,12 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) +@@ -2180,7 +2180,12 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) internals->link_status_polling_enabled = 0; for (i = 0; i < internals->slave_count; i++) { - internals->slaves[i].last_link_status = 0;