Hi Eelco,
On Wed, Jul 13, 2022 at 10:22 AM Eelco Chaudron <[email protected]> wrote:
[snip]
> +AT_SETUP([offloads - check_pkt_len action - offloads enabled])
> +OVS_TRAFFIC_VSWITCHD_START([], [], [-- set Open_vSwitch .
> other_config:hw-offload=true])
> +
> +ADD_NAMESPACES(at_ns1, at_ns2, at_ns3, at_ns4)
> +
> +ADD_VETH(p1, at_ns1, br0, "10.1.1.1/24")
> +ADD_VETH(p2, at_ns2, br0, "10.1.1.2/24")
> +ADD_VETH(p3, at_ns3, br0, "10.1.1.3/24")
> +ADD_VETH(p4, at_ns4, br0, "10.1.1.4/24")
> +
> +AT_DATA([flows.txt], [dnl
> +table=0,in_port=2 actions=output:1
> +table=0,in_port=1
> actions=load:0x1->NXM_NX_REG1[[]],resubmit(,1),load:0x2->NXM_NX_REG1[[]],resubmit(,1)
> +table=1,in_port=1,reg1=0x1
> actions=check_pkt_larger(200)->NXM_NX_REG0[[0]],resubmit(,4)
> +table=1,in_port=1,reg1=0x2 actions=output:2
> +table=4,in_port=1,reg0=0x1 actions=output:3
> +table=4,in_port=1,reg0=0x0 actions=output:4
> +])
> +AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
> +
> +NS_CHECK_EXEC([at_ns3], [tcpdump -l -n -U -i p3 dst 10.1.1.2 and icmp >
> p3.pcap 2>/dev/null &])
> +NS_CHECK_EXEC([at_ns4], [tcpdump -l -n -U -i p4 dst 10.1.1.2 and icmp >
> p4.pcap 2>/dev/null &])
> +sleep 1
> +
[snip]
> +AT_CHECK([cat p3.pcap | awk '{print $NF}' | uniq -c | awk '{$1=$1;print}'],
> [0], [dnl
> +10 1032
> +])
> +AT_CHECK([cat p4.pcap | awk '{print $NF}' | uniq -c | awk '{$1=$1;print}'],
> [0], [dnl
> +10 72
> +])
> +
> +
[snip snip snip]
> +AT_CHECK([ovs-appctl revalidator/wait], [0])
> +AT_CHECK([ovs-ofctl del-flows br0])
> +AT_DATA([flows.txt], [dnl
> +table=0,in_port=2 actions=output:1
> +table=0,in_port=1
> actions=load:0x1->NXM_NX_REG1[[]],resubmit(,1),load:0x2->NXM_NX_REG1[[]],resubmit(,1)
> +table=1,in_port=1,reg1=0x1
> actions=check_pkt_larger(200)->NXM_NX_REG0[[0]],resubmit(,4)
> +table=1,in_port=1,reg1=0x2 actions=output:2
> +table=4,in_port=1,reg0=0x1 actions=mod_nw_tos:4,output:3
> +table=4,in_port=1,reg0=0x0 actions=mod_nw_tos:8,output:4
> +])
> +
> +AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flows br0 flows.txt])
I noticed this newly added code and started the test a few times:
tcpdump 157927 0.1 0.0 15368 9096 pts/10 S+ 21:14 0:00 \_
tcpdump -l -n -U -i p3 dst 10.1.1.2 and icmp
tcpdump 157930 0.0 0.0 15368 9024 pts/10 S+ 21:14 0:00 \_
tcpdump -l -n -U -i p4 dst 10.1.1.2 and icmp
tcpdump 158181 0.0 0.0 15232 9052 pts/10 S+ 21:14 0:00 \_
tcpdump -l -n -U -i p3 dst 10.1.1.2 and icmp
tcpdump 158184 0.0 0.0 15232 9068 pts/10 S+ 21:14 0:00 \_
tcpdump -l -n -U -i p4 dst 10.1.1.2 and icmp
I would stop the first pair of tcpdumps once p3.pcap / p4.pcap outputs
have been checked.
Otherwise the p3.pcap and p4.pcap files (when debugging this test)
contain the latter traffic captured in p3_2.pcap and p4_2.pcap which
is confusing.
Idem, I would then stop the second pair of tcpdumps.
But on the other hand, it helped me figure out a random failure I was
seeing
(https://patchwork.ozlabs.org/project/openvswitch/patch/[email protected]/).
WDYT?
> +
> +NS_CHECK_EXEC([at_ns3], [tcpdump -l -n -U -i p3 dst 10.1.1.2 and icmp >
> p3_2.pcap 2>/dev/null &])
> +NS_CHECK_EXEC([at_ns4], [tcpdump -l -n -U -i p4 dst 10.1.1.2 and icmp >
> p4_2.pcap 2>/dev/null &])
> +sleep 1
> +
> +NS_CHECK_EXEC([at_ns1], [ping -q -c 10 -i 0.1 -w 2 -s 64 10.1.1.2 |
> FORMAT_PING], [0], [dnl
> +10 packets transmitted, 10 received, 0% packet loss, time 0ms
> +], [], [ovs-appctl dpctl/dump-flows; ovs-ofctl dump-flows br0])
> +
> +NS_CHECK_EXEC([at_ns1], [ping -q -c 10 -i 0.1 -w 2 -s 1024 10.1.1.2 |
> FORMAT_PING], [0], [dnl
> +10 packets transmitted, 10 received, 0% packet loss, time 0ms
> +], [], [ovs-appctl dpctl/dump-flows; ovs-ofctl dump-flows br0])
> +
> +AT_CHECK([ovs-appctl dpctl/dump-flows type=tc,offloaded | grep
> "eth_type(0x0800)" | DUMP_CLEAN_SORTED | sed -e 's/bytes:11348/bytes:11614/'
> -e 's/bytes:11440/bytes:11720/'], [0], [dnl
> +in_port(2),eth(),eth_type(0x0800),ipv4(proto=1,tos=0/0xfc,frag=no),
> packets:19, bytes:11614, used:0.001s,
> actions:check_pkt_len(size=200,gt(set(ipv4(tos=0x4/0xfc)),4),le(set(ipv4(tos=0x8/0xfc)),5)),3
> +in_port(3),eth(),eth_type(0x0800),ipv4(frag=no), packets:20, bytes:11720,
> used:0.001s, actions:output
> +])
> +
> +sleep 1
> +AT_CHECK([cat p3_2.pcap | awk '{print $NF}' | uniq -c | awk
> '{$1=$1;print}'], [0], [dnl
> +10 1032
> +])
> +AT_CHECK([cat p4_2.pcap | awk '{print $NF}' | uniq -c | awk
> '{$1=$1;print}'], [0], [dnl
> +10 72
> +])
--
David Marchand
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev