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 2987D1B8B8 for ; Fri, 14 Dec 2018 19:25:21 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 80360C0AED20; Fri, 14 Dec 2018 18:25:20 +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 6BC15600C0; Fri, 14 Dec 2018 18:25:19 +0000 (UTC) From: Kevin Traynor To: Radu Nicolau Cc: Chas Williams , dpdk stable Date: Fri, 14 Dec 2018 18:24:09 +0000 Message-Id: <20181214182430.11593-7-ktraynor@redhat.com> In-Reply-To: <20181214182430.11593-1-ktraynor@redhat.com> References: <20181214182430.11593-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 14 Dec 2018 18:25:20 +0000 (UTC) Subject: [dpdk-stable] patch 'examples/bond: fix crash when there is no active slave' has been queued to stable 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: , X-List-Received-Date: Fri, 14 Dec 2018 18:25:21 -0000 Hi, FYI, your patch has been queued to stable 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 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. 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 48b0602e715bf3516d3fdeb3e5e80a5398fc9875 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 65f3c3980..ef86194ff 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -221,4 +221,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) 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 18:23:18.417860831 +0000 +++ 0007-examples-bond-fix-crash-when-there-is-no-active-slav.patch 2018-12-14 18:23:18.000000000 +0000 @@ -1,8 +1,10 @@ -From 292fdb76024fce3263e3c33009d37f46c10eddc5 Mon Sep 17 00:00:00 2001 +From 48b0602e715bf3516d3fdeb3e5e80a5398fc9875 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