Thanks Darrell, that is very helpful. Come up with v2 soon. Yifeng
On Mon, Aug 13, 2018 at 9:50 AM, Darrell Ball <dlu...@gmail.com> wrote: > clarification: the running time is per test. > > > On Mon, Aug 13, 2018 at 9:47 AM, Darrell Ball <dlu...@gmail.com> wrote: > >> With a few minor tweaks, below, the running time was brought down from >> 1.5-2 minutes to 15-25 seconds per test. >> >> I just changed the tcpdump filter (many variations are possible though) >> and eliminated some redundant tcpdump checks >> since they are implied. >> >> Thanks Darrell >> >> >> >> dball@ubuntu:~/ovs$ git diff tests/system-traffic.at >> diff --git a/tests/system-traffic.at b/tests/system-traffic.at >> index 1eeaff0..03c3a4f 100644 >> --- a/tests/system-traffic.at >> +++ b/tests/system-traffic.at >> @@ -596,7 +596,7 @@ AT_CHECK([ip link set dev br-underlay up]) >> dnl Set up tunnel endpoints on OVS outside the namespace. >> ADD_OVS_TUNNEL([gre], [br0], [at_gre0], [172.31.1.1], [10.1.1.100/24]) >> >> -ip netns exec at_ns0 tcpdump -U -i p0 -w p0.pcap & >> +ip netns exec at_ns0 tcpdump -U -i p0 dst host 172.31.1.1 -w p0.pcap & >> sleep 1 >> >> dnl First, check the underlay. >> @@ -611,9 +611,6 @@ dnl ADD_NATIVE_TUNNEL([gretap], [ns_gre0], [at_ns0], >> [172.31.1.100], [10.1.1.1/2 >> dnl Now, check the overlay by sending out raw arp and icmp packets. >> ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 >> packet=f2ff00000002f2ff00000003080045000042ec2c4000402ff3bca >> c1f0101ac1f016400006558fffffffffffff2ff000000040806000108000 >> 6040001f2ff000000040a0101010000000000000a010164 actions=NORMAL" >> >> -sleep 1 >> -AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > >> 172.31.1.1: GREv0, length 46: ARP, Reply 10.1.1.100 is-at >> f2:ff:00:00:00:01 .* length 28" 2>&1 1>/dev/null]) >> - >> ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 >> packet=f2ff00000002f2ff0000000308004500007aec8e4000402ff322a >> c1f0101ac1f016400006558f2ff00000001f2ff000000040800450000545 >> 48f40004001cfb30a0101010a0101640800e6e829270003e1a3435b00000 >> 000ff1a050000000000101112131415161718191a1b1c1d1e1f202122232 >> 425262728292a2b2c2d2e2f3031323334353637 actions=NORMAL" >> >> sleep 1 >> @@ -643,7 +640,7 @@ dnl Set up tunnel endpoints on OVS outside the >> namespace and emulate a native >> dnl linux device inside the namespace. >> ADD_OVS_TUNNEL([erspan], [br0], [at_erspan0], [172.31.1.1], [ >> 10.1.1.100/24], [options:key=1 options:erspan_ver=1 >> options:erspan_idx=7]) >> >> -ip netns exec at_ns0 tcpdump -U -i p0 -w p0.pcap & >> +ip netns exec at_ns0 tcpdump -U -i p0 dst host 172.31.1.1 -w p0.pcap & >> sleep 1 >> >> dnl First, check the underlay >> @@ -654,11 +651,6 @@ NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 >> 172.31.1.100 | FORMAT_PING], [ >> dnl Okay, now send out an arp request from 10.1.1.1 for 10.1.1.100 in >> erspan. >> ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 >> packet=f2ff00000002f2ff0000000308004500004e151d4000402fcac0a >> c1f0101ac1f0164100088be000000061000000100000007fffffffffffff >> 2ff0000000408060001080006040001f2ff000000040a0101010000000000000a010164 >> actions=normal" >> >> -sleep 1 >> -dnl 0002 is arp reply, followed by mac address of 10.1.1.100. >> -AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "f2ff 0000 0001 0806" 2>&1 >> 1>/dev/null]) >> -AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "0800 0604 0002 f2ff 0000 >> 0001 0a01" 2>&1 1>/dev/null]) >> - >> dnl Okay, now check the overlay with raw icmp packets. >> AT_FAIL_IF([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > >> 172.31.1.1: GREv0, .* length 1258" 2>&1 1>/dev/null]) >> >> @@ -691,7 +683,7 @@ dnl Set up tunnel endpoints on OVS outside the >> namespace and simulate a native >> dnl linux device inside the namespace. >> ADD_OVS_TUNNEL([erspan], [br0], [at_erspan0], [172.31.1.1], [ >> 10.1.1.100/24], [options:key=1 options:erspan_ver=2 options:erspan_dir=1 >> options:erspan_hwid=0x7]) >> >> -ip netns exec at_ns0 tcpdump -U -i p0 -w p0.pcap & >> +ip netns exec at_ns0 tcpdump -U -i p0 dst host 172.31.1.1 -w p0.pcap & >> sleep 1 >> >> dnl First, check the underlay >> @@ -702,10 +694,6 @@ NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 >> 172.31.1.100 | FORMAT_PING], [ >> dnl Okay, send raw arp request and icmp echo request. >> ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 >> packet=f2ff00000002f2ff00000003080045000052373d4000402fa89ca >> c1f0101ac1f0164100088be00000006200000016f54b41700008078fffff >> ffffffff2ff0000000408060001080006040001f2ff000000040a0101010000000000000a010164 >> actions=normal" >> >> -sleep 1 >> -AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "0806 0001 0800 0604 0002 >> f2ff 0000" 2>&1 1>/dev/null]) >> -AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "0a01 0164 f2ff 0000 0004 >> 0a01 0101" 2>&1 1>/dev/null]) >> - >> ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 >> packet=f2ff00000002f2ff0000000308004500009287e14000402f57b8a >> c1f0101ac1f0164100088be0000000520000001144cd5a400008078f2ff0 >> 0000001f2ff0000000408004500005c38d640004001eb640a0101010a010 >> 16408005e57585f0001df6c6b5b0000000045bc050000000000101112131 >> 415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f >> actions=normal" >> >> sleep 1 >> @@ -738,7 +726,7 @@ ADD_OVS_TUNNEL6([ip6erspan], [br0], [at_erspan0], >> [fc00:100::1], [10.1.1.100/24] >> >> OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 2 fc00:100::100]) >> >> -ip netns exec at_ns0 tcpdump -U -i p0 -w p0.pcap & >> +ip netns exec at_ns0 tcpdump -U proto gre -i p0 -w p0.pcap & >> sleep 1 >> >> dnl First, check the underlay >> @@ -749,13 +737,6 @@ NS_CHECK_EXEC([at_ns0], [ping6 -q -c 3 -i 0.3 -w 2 >> fc00:100::100 | FORMAT_PING], >> dnl Okay, now send raw arp request and icmp echo request. >> ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 >> packet=f2ff00000002f2ff0000000386dd60008531003a2f40fc0001000 >> 00000000000000000000001fc00010000000000000000000000010010008 >> 8be000000051000007b00000007fffffffffffff2ff00000004080600010 >> 80006040001f2ff000000040a0101010000000000000a010164 actions=normal" >> >> -sleep 1 >> -dnl check arp reply >> -AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "0806 0001 0800 0604 0002 >> f2ff 0000" 2>&1 1>/dev/null]) >> -AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "0a01 0164 f2ff 0000 0004 >> 0a01 0101" 2>&1 1>/dev/null]) >> - >> -AT_FAIL_IF([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP6 fc00:100::100 > >> fc00:100::1: GREv0, .* length 114" 2>&1 1>/dev/null]) >> - >> ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 >> packet=f2ff00000002f2ff0000000386dd60008531007a3c40fc0001000 >> 00000000000000000000001fc0001000000000000000000000001002f000 >> 40104010100100088be000000061000407b00000007f2ff00000001f2ff0 >> 000000408004500005429b640004001fa8c0a0101010a01016408005c2c7 >> 526000118d3685b00000000e4aa020000000000101112131415161718191 >> a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637 >> actions=normal" >> >> sleep 1 >> @@ -789,7 +770,7 @@ ADD_OVS_TUNNEL6([ip6erspan], [br0], [at_erspan0], >> [fc00:100::1], [10.1.1.100/24] >> >> OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 2 fc00:100::100]) >> >> -ip netns exec at_ns0 tcpdump -U -i p0 -w p0.pcap & >> +ip netns exec at_ns0 tcpdump -U proto gre -i p0 -w p0.pcap & >> sleep 1 >> >> dnl First, check the underlay. >> @@ -800,10 +781,6 @@ NS_CHECK_EXEC([at_ns0], [ping6 -q -c 3 -i 0.3 -w 2 >> fc00:100::100 | FORMAT_PING], >> dnl Okay, now send raw arp request and icmp echo request. >> ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 >> packet=f2ff00000002f2ff0000000386dd60008531003e2f40fc0001000 >> 00000000000000000000001fc00010000000000000000000000010010008 >> 8be0000000620000079af514f9900008070fffffffffffff2ff000000040 >> 8060001080006040001f2ff000000040a0101010000000000000a010164 >> actions=normal" >> >> -sleep 1 >> -AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "0806 0001 0800 0604 0002" >> 2>&1 1>/dev/null]) >> -AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "0a01 0164 f2ff 0000 0004" >> 2>&1 1>/dev/null]) >> - >> ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 >> packet=f2ff00000002f2ff0000000386dd60008531007e3c40fc0001000 >> 00000000000000000000001fc0001000000000000000000000001002f000 >> 40104010100100088be0000000720004079af514f9b00008070f2ff00000 >> 001f2ff00000004080045000054ffcb4000400124770a0101010a0101640 >> 800419e23ac000112d7685b000000004caf0c00000000001011121314151 >> 61718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637 >> actions=normal" >> >> >> >> On Fri, Aug 10, 2018 at 5:24 PM, Yifeng Sun <pkusunyif...@gmail.com> >> wrote: >> >>> Hi Darrell, >>> >>> Thanks for the review. Will do. >>> >>> Best, >>> Yifeng >>> >>> On Fri, Aug 10, 2018 at 3:12 PM, Darrell Ball <db...@vmware.com> wrote: >>> >>> > Thanks Yifeng >>> > >>> > Thanks for switching to use ‘packet-out’. >>> > Patches 4-8 seem like they can be part of the same patch, since they >>> are >>> > closely related. >>> > As discussed, none of the tests pass for Userspace datapath, so maybe >>> you >>> > want to check them out or just disable them for now >>> > >>> > I tested with “Linux ubuntu 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 >>> > 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux” >>> > Fusion Ubuntu VM >>> > >>> > dball@ubuntu:~/ovs$ time sudo make check-system-userspace >>> > TESTSUITEFLAGS='18-22' -C _gcc >>> > make: Entering directory '/home/dball/ovs/_gcc' >>> > make all-recursive >>> > make[1]: Entering directory '/home/dball/ovs/_gcc' >>> > Making all in datapath >>> > make[2]: Entering directory '/home/dball/ovs/_gcc/datapath' >>> > Making all in linux >>> > make[3]: Entering directory '/home/dball/ovs/_gcc/datapath/linux' >>> > make -C /lib/modules/4.4.0-119-generic/build >>> M=/home/dball/ovs/_gcc/datapath/linux >>> > modules >>> > make[4]: Entering directory '/usr/src/linux-headers-4.4.0-119-generic' >>> > Building modules, stage 2. >>> > MODPOST 6 modules >>> > make[4]: Leaving directory '/usr/src/linux-headers-4.4.0-119-generic' >>> > make[3]: Leaving directory '/home/dball/ovs/_gcc/datapath/linux' >>> > make[3]: Entering directory '/home/dball/ovs/_gcc/datapath' >>> > make[3]: Leaving directory '/home/dball/ovs/_gcc/datapath' >>> > make[2]: Leaving directory '/home/dball/ovs/_gcc/datapath' >>> > make[2]: Entering directory '/home/dball/ovs/_gcc' >>> > make[3]: Entering directory '/home/dball/ovs/_gcc/datapath' >>> > make[3]: 'distfiles' is up to date. >>> > make[3]: Leaving directory '/home/dball/ovs/_gcc/datapath' >>> > make[2]: Leaving directory '/home/dball/ovs/_gcc' >>> > make[1]: Leaving directory '/home/dball/ovs/_gcc' >>> > set /bin/bash '../tests/system-userspace-testsuite' -C tests >>> > AUTOTEST_PATH='utilities:vswitchd:ovsdb:vtep:tests::: >>> > ovn/controller-vtep:ovn/northd:ovn/utilities:ovn/controller' 18-22 >>> -j1; \ >>> > "$@" || (test X'' = Xyes && "$@" --recheck) >>> > ## ------------------------------- ## >>> > ## openvswitch 2.10.90 test suite. ## >>> > ## ------------------------------- ## >>> > >>> > datapath-sanity >>> > >>> > 18: datapath - ping over gre tunnel by simulated packets FAILED ( >>> > system-traffic.at:615) >>> > 19: datapath - ping over erspan v1 tunnel by simulated packets FAILED >>> ( >>> > system-traffic.at:659) >>> > 20: datapath - ping over erspan v2 tunnel by simulated packets FAILED >>> ( >>> > system-traffic.at:706) >>> > 21: datapath - ping over ip6erspan v1 tunnel by simulated packets >>> FAILED ( >>> > system-traffic.at:754) >>> > 22: datapath - ping over ip6erspan v2 tunnel by simulated packets >>> FAILED ( >>> > system-traffic.at:804) >>> > >>> > ## ------------- ## >>> > ## Test results. ## >>> > ## ------------- ## >>> > >>> > ERROR: All 5 tests were run, >>> > 5 failed unexpectedly. >>> > ## ------------------------------------------- ## >>> > ## system-userspace-testsuite.log was created. ## >>> > ## ------------------------------------------- ## >>> > >>> > >>> > The kmod tests all pass now and they are a little faster now, but still >>> > slow >>> > >>> > et /bin/bash '../tests/system-kmod-testsuite' -C tests >>> > AUTOTEST_PATH='utilities:vswitchd:ovsdb:vtep:tests::: >>> > ovn/controller-vtep:ovn/northd:ovn/utilities:ovn/controller' 18 -j1; \ >>> > "$@" || (test X'' = Xyes && "$@" --recheck) >>> > ## ------------------------------- ## >>> > ## openvswitch 2.10.90 test suite. ## >>> > ## ------------------------------- ## >>> > 18: datapath - ping over gre tunnel by simulated packets ok >>> > >>> > ## ------------- ## >>> > ## Test results. ## >>> > ## ------------- ## >>> > >>> > 1 test was successful. >>> > make[1]: Leaving directory '/home/dball/ovs/_gcc' >>> > make: Leaving directory '/home/dball/ovs/_gcc' >>> > >>> > real 1m32.789s >>> > user 0m3.396s >>> > sys 0m0.872s >>> > >>> > >>> > Thanks Darrell >>> > >>> > >>> > >>> > >>> > >>> > >>> > On 8/8/18, 4:35 PM, "ovs-dev-boun...@openvswitch.org on behalf of >>> Yifeng >>> > Sun" <ovs-dev-boun...@openvswitch.org on behalf of >>> pkusunyif...@gmail.com> >>> > wrote: >>> > >>> > Introduce a new test that doesn't setup native gre tunnels but >>> sends >>> > simulated raw packets. >>> > This test is supposed to only run for kernel version from 4.4.x to >>> > 4.15.x. >>> > >>> > Signed-off-by: Yifeng Sun <pkusunyif...@gmail.com> >>> > --- >>> > tests/system-traffic.at | 47 ++++++++++++++++++++++++++++++ >>> > +++++++++++++++++ >>> > 1 file changed, 47 insertions(+) >>> > >>> > diff --git a/tests/system-traffic.at b/tests/system-traffic.at >>> > index cf53c10..dca2bc8 100644 >>> > --- a/tests/system-traffic.at >>> > +++ b/tests/system-traffic.at >>> > @@ -575,6 +575,53 @@ NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 >>> -i >>> > 0.3 -w 2 10.1.1.100 | FORMAT_PI >>> > OVS_TRAFFIC_VSWITCHD_STOP >>> > AT_CLEANUP >>> > >>> > +AT_SETUP([datapath - ping over gre tunnel by simulated packets]) >>> > +OVS_CHECK_KERNEL(4, 4, 15) >>> > + >>> > +OVS_TRAFFIC_VSWITCHD_START() >>> > + >>> > +AT_CHECK([ovs-vsctl -- set bridge br0 other-config:hwaddr=\"f2:ff: >>> > 00:00:00:01\"]) >>> > +ADD_BR([br-underlay], [set bridge br-underlay >>> > other-config:hwaddr=\"f2:ff:00:00:00:02\"]) >>> > + >>> > +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"]) >>> > +AT_CHECK([ovs-ofctl add-flow br-underlay "actions=normal"]) >>> > + >>> > +ADD_NAMESPACES(at_ns0) >>> > + >>> > +dnl Set up underlay link from host into the namespace using veth >>> pair. >>> > +ADD_VETH(p0, at_ns0, br-underlay, "172.31.1.1/24", >>> f2:ff:00:00:00:03) >>> > +AT_CHECK([ip addr add dev br-underlay "172.31.1.100/24"]) >>> > +AT_CHECK([ip link set dev br-underlay up]) >>> > + >>> > +dnl Set up tunnel endpoints on OVS outside the namespace. >>> > +ADD_OVS_TUNNEL([gre], [br0], [at_gre0], [172.31.1.1], [ >>> 10.1.1.100/24 >>> > ]) >>> > + >>> > +ip netns exec at_ns0 tcpdump -U -i p0 -w p0.pcap & >>> > +sleep 1 >>> > + >>> > +dnl First, check the underlay. >>> > +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 172.31.1.100 | >>> > FORMAT_PING], [0], [dnl >>> > +3 packets transmitted, 3 received, 0% packet loss, time 0ms >>> > +]) >>> > + >>> > +dnl We don't actually add gretap port as below, instead, we will >>> > +dnl emulate one that sends out packets. Suppose its mac address is >>> > f2:ff:00:00:00:04. >>> > +dnl ADD_NATIVE_TUNNEL([gretap], [ns_gre0], [at_ns0], >>> [172.31.1.100], [ >>> > 10.1.1.1/24]) >>> > + >>> > +dnl Now, check the overlay by sending out raw arp and icmp >>> packets. >>> > +ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 packet= >>> > f2ff00000002f2ff00000003080045000042ec2c4000402ff3bcac1f0101 >>> > ac1f016400006558fffffffffffff2ff0000000408060001080006040001 >>> > f2ff000000040a0101010000000000000a010164 actions=NORMAL" >>> > + >>> > +sleep 1 >>> > +AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > >>> > 172.31.1.1: GREv0, length 46: ARP, Reply 10.1.1.100 is-at >>> > f2:ff:00:00:00:01 .* length 28" 2>&1 1>/dev/null]) >>> > + >>> > +ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 packet= >>> > f2ff00000002f2ff0000000308004500007aec8e4000402ff322ac1f0101 >>> > ac1f016400006558f2ff00000001f2ff00000004080045000054548f4000 >>> > 4001cfb30a0101010a0101640800e6e829270003e1a3435b00000000ff1a >>> > 050000000000101112131415161718191a1b1c1d1e1f2021222324252627 >>> > 28292a2b2c2d2e2f3031323334353637 actions=NORMAL" >>> > + >>> > +sleep 1 >>> > +AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > >>> > 172.31.1.1: GREv0, length 102: IP 10.1.1.100 > 10.1.1.1: ICMP echo >>> reply, >>> > .* length 64$" 2>&1 1>/dev/null]) >>> > + >>> > +OVS_TRAFFIC_VSWITCHD_STOP >>> > +AT_CLEANUP >>> > + >>> > AT_SETUP([datapath - clone action]) >>> > OVS_TRAFFIC_VSWITCHD_START() >>> > >>> > -- >>> > 2.7.4 >>> > >>> > _______________________________________________ >>> > dev mailing list >>> > d...@openvswitch.org >>> > https://na01.safelinks.protection.outlook.com/?url=https%3A >>> %2F%2Fmail. >>> > openvswitch.org%2Fmailman%2Flistinfo%2Fovs-dev&data= >>> > 02%7C01%7Cdball%40vmware.com%7C153e01662c0e401c4fa008d5fd87accb% >>> > 7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636693681528602321& >>> > sdata=qKcxbM2PzEg%2BrNb61nZRScJboN%2B5a317WP4MVIlgobA%3D& >>> ;reserved=0 >>> > >>> > >>> > >>> _______________________________________________ >>> dev mailing list >>> d...@openvswitch.org >>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev >>> >> >> > _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev