[dpdk-stable] patch 'examples/bond: fix crash when there is no active slave' has been queued to stable release 18.11.1

Kevin Traynor ktraynor at redhat.com
Fri Dec 14 19:24:09 CET 2018


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 <radu.nicolau at intel.com>
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 <radu.nicolau at intel.com>
Acked-by: Chas Williams <chas3 at att.com>
---
 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 <radu.nicolau at intel.com>
 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 at dpdk.org
 
 Signed-off-by: Radu Nicolau <radu.nicolau at intel.com>
 Acked-by: Chas Williams <chas3 at att.com>


More information about the stable mailing list