[dts] [PATCH] tests/pmd_bonded: stop forwarding before removing slaves

Hyong Youb Kim hyonkim at cisco.com
Thu Jan 10 07:25:24 CET 2019

Currently, test_bound_promisc_opt often crashes when it tries to
remove all slave ports from the bonding driver. The main thread
removes slave ports while forwarding threads are still executing
rx_burst on them. These threads share data structures within the
bonding driver and cause races, which lead to crashes. So explicitly
stop the forwarding threads first, and then remove slave ports.

Signed-off-by: Hyong Youb Kim <hyonkim at cisco.com>
 tests/TestSuite_pmd_bonded.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/TestSuite_pmd_bonded.py b/tests/TestSuite_pmd_bonded.py
index a770b9b..928c53a 100644
--- a/tests/TestSuite_pmd_bonded.py
+++ b/tests/TestSuite_pmd_bonded.py
@@ -1031,6 +1031,9 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
                         pkt_now[bond_port][0] == pkt_count,
                         "RX or TX packet number not correct when promiscuous disabled")
+        # Stop fwd threads first before removing slaves from bond to avoid
+        # races and crashes
+        self.dut.send_expect("stop", "testpmd> ")
         self.dut.send_expect("quit", "# ")

More information about the dts mailing list