The setup of this test includes, among other things, creating a pair of
veth ports and adding both ends to the same ovs bridge.
This is use as a loopback monitoring. Openflow flows are created to
send (truncated) traffic through one end, and drop everything that comes
from the other end.

However, Openflow flows are created after wiring up the ports so there
is some time during which the bridge (br0) has "action=NORMAL" with both
ends of a veth pair connected to it. This could easily lead to a packet
loop if the kernel automatically generates any multicast traffic
(e.g: IPv6 NDP, IGMP MLD, etc) on those interfaces.

I guess normally the test is quick enough to remove the default flow and
install the new ones, but I was running the test suite on a debug kernel
and reproduced the loop with considerable consistency.

Fix it by removing the default flow before doing the non-conventional
loopback wiring.

Signed-off-by: Adrian Moreno <[email protected]>
---
 tests/system-traffic.at | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/system-traffic.at b/tests/system-traffic.at
index f67e7d17a..4bb39f9e0 100644
--- a/tests/system-traffic.at
+++ b/tests/system-traffic.at
@@ -2401,6 +2401,7 @@ NS_CHECK_EXEC([at_ns1], [ip link set dev p1 address 
e6:66:c1:22:22:22])
 NS_CHECK_EXEC([at_ns1], [arp -s 10.1.1.1 e6:66:c1:11:11:11])
 
 dnl Set up (p2 and ovs-p2) as loopback for verifying packet size
+AT_CHECK([ovs-ofctl del-flows br0])
 AT_CHECK([ip link add p2 type veth peer name ovs-p2])
 on_exit 'ip link del ovs-p2'
 AT_CHECK([ip link set dev ovs-p2 up])
@@ -2412,7 +2413,6 @@ dnl use this file as payload file for ncat
 AT_CHECK([dd if=/dev/urandom of=payload200.bin bs=200 count=1 2> /dev/null])
 on_exit 'rm -f payload200.bin'
 
-AT_CHECK([ovs-ofctl del-flows br0])
 AT_DATA([flows.txt], [dnl
 
priority=99,in_port=1,actions=output(port=2,max_len=100),output(port=3,max_len=100)
 priority=99,in_port=2,udp,actions=output(port=1,max_len=100)
-- 
2.54.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to