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 C017E1B952 for ; Fri, 14 Dec 2018 18:52:39 +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 2465E7FDED; Fri, 14 Dec 2018 17:52:39 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-116-106.ams2.redhat.com [10.36.116.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id D30D160BF7; Fri, 14 Dec 2018 17:52:37 +0000 (UTC) From: Kevin Traynor To: Radu Nicolau Cc: Chas Williams , dpdk stable Date: Fri, 14 Dec 2018 17:51:47 +0000 Message-Id: <20181214175203.24908-3-ktraynor@redhat.com> In-Reply-To: <20181214175203.24908-1-ktraynor@redhat.com> References: <20181214175203.24908-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.27]); Fri, 14 Dec 2018 17:52:39 +0000 (UTC) Subject: [dpdk-stable] patch 'examples/bond: fix crash when there is no active slave' 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: Fri, 14 Dec 2018 17:52:40 -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/18/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 f70ae36fa1ff238804ca8193f43559788a14b398 Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Wed, 14 Nov 2018 12:19:09 +0000 Subject: [PATCH] examples/bond: fix crash when there is no active slave [ upstream commit 292fdb76024fce3263e3c33009d37f46c10eddc5 ] If bond_ethdev_rx_burst() called more times with no active slaves the active slave index will point out of bounds, resulting in a segfault. The configured slaves needs to be checked, and if none became active there is no point going further. Do not start the packet processing threads until all configured slaves become active. Fixes: cc7e8ae84faa ("examples/bond: add example application for link bonding mode 6") Signed-off-by: Radu Nicolau Acked-by: Chas Williams --- examples/bond/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/bond/main.c b/examples/bond/main.c index 23d0981ab..314d85747 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -222,4 +222,5 @@ bond_port_init(struct rte_mempool *mbuf_pool) struct rte_eth_txconf txq_conf; struct rte_eth_conf local_port_conf = port_conf; + uint16_t wait_counter = 20; retval = rte_eth_bond_create("net_bonding0", BONDING_MODE_ALB, @@ -276,4 +277,18 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval); + printf("Waiting for slaves to become active..."); + while (wait_counter) { + uint16_t act_slaves[16] = {0}; + if (rte_eth_bond_active_slaves_get(BOND_PORT, act_slaves, 16) == + slaves_count) { + printf("\n"); + break; + } + sleep(1); + printf("..."); + if (--wait_counter == 0) + rte_exit(-1, "\nFailed to activate slaves\n"); + } + rte_eth_promiscuous_enable(BOND_PORT); -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-12-14 17:49:47.787217930 +0000 +++ 0003-examples-bond-fix-crash-when-there-is-no-active-slav.patch 2018-12-14 17:49:47.000000000 +0000 @@ -1,8 +1,10 @@ -From 292fdb76024fce3263e3c33009d37f46c10eddc5 Mon Sep 17 00:00:00 2001 +From f70ae36fa1ff238804ca8193f43559788a14b398 Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Wed, 14 Nov 2018 12:19:09 +0000 Subject: [PATCH] examples/bond: fix crash when there is no active slave +[ upstream commit 292fdb76024fce3263e3c33009d37f46c10eddc5 ] + If bond_ethdev_rx_burst() called more times with no active slaves the active slave index will point out of bounds, resulting in a segfault. @@ -13,7 +15,6 @@ slaves become active. Fixes: cc7e8ae84faa ("examples/bond: add example application for link bonding mode 6") -Cc: stable@dpdk.org Signed-off-by: Radu Nicolau Acked-by: Chas Williams @@ -22,16 +23,16 @@ 1 file changed, 15 insertions(+) diff --git a/examples/bond/main.c b/examples/bond/main.c -index 65f3c3980..ef86194ff 100644 +index 23d0981ab..314d85747 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c -@@ -221,4 +221,5 @@ bond_port_init(struct rte_mempool *mbuf_pool) +@@ -222,4 +222,5 @@ bond_port_init(struct rte_mempool *mbuf_pool) struct rte_eth_txconf txq_conf; struct rte_eth_conf local_port_conf = port_conf; + uint16_t wait_counter = 20; retval = rte_eth_bond_create("net_bonding0", BONDING_MODE_ALB, -@@ -275,4 +276,18 @@ bond_port_init(struct rte_mempool *mbuf_pool) +@@ -276,4 +277,18 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval); + printf("Waiting for slaves to become active...");