test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests/pmd_bonded: stop forwarding before removing slaves
@ 2019-01-10  6:25 Hyong Youb Kim
  2019-01-15  5:10 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Hyong Youb Kim @ 2019-01-10  6:25 UTC (permalink / raw)
  To: Marvin Liu; +Cc: dts, Hyong Youb Kim

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@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.remove_all_slaves(bond_port)
         self.dut.send_expect("quit", "# ")
         self.launch_app()
-- 
2.16.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH] tests/pmd_bonded: stop forwarding before removing slaves
  2019-01-10  6:25 [dts] [PATCH] tests/pmd_bonded: stop forwarding before removing slaves Hyong Youb Kim
@ 2019-01-15  5:10 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-01-15  5:10 UTC (permalink / raw)
  To: Hyong Youb Kim; +Cc: dts

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Hyong Youb Kim
> Sent: Thursday, January 10, 2019 2:25 PM
> To: Liu, Yong <yong.liu@intel.com>
> Cc: dts@dpdk.org; Hyong Youb Kim <hyonkim@cisco.com>
> Subject: [dts] [PATCH] tests/pmd_bonded: stop forwarding before removing
> slaves
> 
> 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@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.remove_all_slaves(bond_port)
>          self.dut.send_expect("quit", "# ")
>          self.launch_app()
> --
> 2.16.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-15  5:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10  6:25 [dts] [PATCH] tests/pmd_bonded: stop forwarding before removing slaves Hyong Youb Kim
2019-01-15  5:10 ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).