3 m4_divert_push([PREPARE_TESTS])
5 # Given the output of `ovs-appctl dpif-netdev/pmd-rxq-show`, prints a list
6 # of every rxq (one per line) in the form:
7 # port_name rxq_id numa_id core_id
8 parse_pmd_rxq_show () {
9 awk '/pmd/ {numa=$4; core=substr($6, 1, length($6) - 1)} /\t/{for (i=4; i<=NF; i++) print $2, $i, numa, core}' | sort
12 # Given the output of `ovs-appctl dpctl/dump-flows`, prints a list of flows
13 # (one per line), with the pmd_id at the beginning of the line
15 flow_dump_prepend_pmd () {
16 awk '/flow-dump from non-dpdk/ {pmd_id=-1; next} /flow-dump from pmd/ {pmd_id=$7; next} {print pmd_id, $0}' | sort
19 m4_divert_pop([PREPARE_TESTS])
21 dnl CHECK_CPU_DISCOVERED([n_cpu])
23 dnl Waits until CPUs discovered and checks if number of discovered CPUs
24 dnl is greater or equal to 'n_cpu'. Without parameters checks that at
25 dnl least one CPU discovered.
26 m4_define([CHECK_CPU_DISCOVERED], [
27 PATTERN="Discovered [[0-9]]* NUMA nodes and [[0-9]]* CPU cores"
28 OVS_WAIT_UNTIL([grep "$PATTERN" ovs-vswitchd.log])
29 N_CPU=$(grep "$PATTERN" ovs-vswitchd.log | sed -e 's/.* \([[0-9]]*\) CPU cores/\1/')
31 then AT_CHECK([test "$N_CPU" -gt "0"])
32 else AT_SKIP_IF([test "$N_CPU" -lt "$1"])
36 dnl CHECK_PMD_THREADS_CREATED([n_threads], [numa_id], [+line])
38 dnl Whaits for creation of 'n_threads' or at least 1 thread if $1 not
39 dnl passed. Checking starts from line number 'line' in ovs-vswithd.log .
40 m4_define([CHECK_PMD_THREADS_CREATED], [
41 PATTERN="Created [[0-9]]* pmd threads on numa node $2"
43 if [[ -z "$line_st" ]]
47 OVS_WAIT_UNTIL([tail -n $line_st ovs-vswitchd.log | grep "$PATTERN"])
48 N_THREADS=$(tail -n $line_st ovs-vswitchd.log | grep "$PATTERN" | tail -1 | sed -e 's/.* \([[0-9]]*\) pmd .*/\1/')
50 then AT_CHECK([test "$N_THREADS" -gt 0])
51 else AT_CHECK([test "$N_THREADS" -eq "$1"])
55 m4_define([SED_NUMA_CORE_PATTERN], ["s/\(numa_id \)[[0-9]]*\( core_id \)[[0-9]]*:/\1<cleared>\2<cleared>:/"])
56 m4_define([DUMMY_NUMA], [--dummy-numa="0,0,0,0,1,1,1,1"])
58 AT_SETUP([PMD - creating a thread/add-port])
59 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy-pmd], [], [], [DUMMY_NUMA])
61 CHECK_CPU_DISCOVERED()
62 CHECK_PMD_THREADS_CREATED()
64 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed SED_NUMA_CORE_PATTERN], [0], [dnl
65 pmd thread numa_id <cleared> core_id <cleared>:
69 AT_CHECK([ovs-appctl dpif/show | sed 's/\(tx_queues=\)[[0-9]]*/\1<cleared>/g'], [0], [dnl
70 dummy@ovs-dummy: hit:0 missed:0
72 br0 65534/100: (dummy)
73 p0 1/1: (dummy-pmd: configured_rx_queues=1, configured_tx_queues=<cleared>, requested_rx_queues=1, requested_tx_queues=<cleared>)
79 AT_SETUP([PMD - multiqueue support])
80 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy-pmd], [], [], [DUMMY_NUMA])
82 CHECK_CPU_DISCOVERED()
83 CHECK_PMD_THREADS_CREATED()
85 AT_CHECK([ovs-vsctl set interface p0 options:n_rxq=8])
87 AT_CHECK([ovs-appctl dpif/show | sed 's/\(tx_queues=\)[[0-9]]*/\1<cleared>/g'], [0], [dnl
88 dummy@ovs-dummy: hit:0 missed:0
90 br0 65534/100: (dummy)
91 p0 1/1: (dummy-pmd: configured_rx_queues=8, configured_tx_queues=<cleared>, requested_rx_queues=8, requested_tx_queues=<cleared>)
94 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed SED_NUMA_CORE_PATTERN], [0], [dnl
95 pmd thread numa_id <cleared> core_id <cleared>:
96 port: p0 queue-id: 0 1 2 3 4 5 6 7
103 AT_SETUP([PMD - pmd-cpu-mask/distribution of rx queues])
104 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy-pmd options:n_rxq=8],
105 [], [], [DUMMY_NUMA])
107 CHECK_CPU_DISCOVERED(2)
108 CHECK_PMD_THREADS_CREATED()
110 AT_CHECK([ovs-appctl dpif/show | sed 's/\(tx_queues=\)[[0-9]]*/\1<cleared>/g'], [0], [dnl
111 dummy@ovs-dummy: hit:0 missed:0
113 br0 65534/100: (dummy)
114 p0 1/1: (dummy-pmd: configured_rx_queues=8, configured_tx_queues=<cleared>, requested_rx_queues=8, requested_tx_queues=<cleared>)
117 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed SED_NUMA_CORE_PATTERN], [0], [dnl
118 pmd thread numa_id <cleared> core_id <cleared>:
119 port: p0 queue-id: 0 1 2 3 4 5 6 7
122 TMP=$(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])
123 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=3])
124 CHECK_PMD_THREADS_CREATED([2], [], [+$TMP])
126 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed SED_NUMA_CORE_PATTERN], [0], [dnl
127 pmd thread numa_id <cleared> core_id <cleared>:
128 port: p0 queue-id: 0 2 4 6
129 pmd thread numa_id <cleared> core_id <cleared>:
130 port: p0 queue-id: 1 3 5 7
133 TMP=$(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])
134 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=1])
135 CHECK_PMD_THREADS_CREATED([1], [], [+$TMP])
137 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | sed SED_NUMA_CORE_PATTERN], [0], [dnl
138 pmd thread numa_id <cleared> core_id <cleared>:
139 port: p0 queue-id: 0 1 2 3 4 5 6 7
146 AT_SETUP([PMD - stats])
147 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 ofport_request=7 type=dummy-pmd options:n_rxq=4],
148 [], [], [DUMMY_NUMA])
150 CHECK_CPU_DISCOVERED()
151 CHECK_PMD_THREADS_CREATED()
153 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg])
154 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
158 AT_CHECK([ovs-appctl dpif/show | sed 's/\(tx_queues=\)[[0-9]]*/\1<cleared>/g'], [0], [dnl
159 dummy@ovs-dummy: hit:0 missed:0
161 br0 65534/100: (dummy)
162 p0 7/1: (dummy-pmd: configured_rx_queues=4, configured_tx_queues=<cleared>, requested_rx_queues=4, requested_tx_queues=<cleared>)
165 AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 4], [0], [dnl
166 pmd thread numa_id <cleared> core_id <cleared>:
174 ovs-appctl time/warp 100
178 pkt="in_port(7),eth(src=50:54:00:00:00:77,dst=50:54:00:00:01:78),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
179 AT_CHECK([ovs-appctl netdev-dummy/receive p0 $pkt])
182 ovs-appctl time/warp 100
184 AT_CHECK([grep -A 1 'miss upcall' ovs-vswitchd.log | tail -n 1], [0], [dnl
185 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:77,dst=50:54:00:00:01:78),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)
187 AT_CHECK([cat ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl
188 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:77,dst=50:54:00:00:01:78),eth_type(0x0800),ipv4(frag=no), actions: <del>
191 AT_CHECK([ovs-appctl dpif-netdev/pmd-stats-show | sed SED_NUMA_CORE_PATTERN | sed '/cycles/d' | grep pmd -A 4], [0], [dnl
192 pmd thread numa_id <cleared> core_id <cleared>:
202 dnl Reconfigure the number of rx queues of a port, make sure that all the
203 dnl queues are polled by the datapath and try to send a couple of packets.
204 AT_SETUP([PMD - reconfigure n_rxq])
206 [add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=2 -- \
207 add-port br0 p2 -- set Interface p2 type=dummy-pmd ofport_request=2
208 ], [], [], [--dummy-numa 0])
209 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
211 AT_CHECK([ovs-ofctl add-flow br0 action=controller])
213 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl
219 AT_CAPTURE_FILE([ofctl_monitor.log])
220 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
222 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
224 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2])
225 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
227 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
228 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
229 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff
232 AT_CHECK([ovs-vsctl set interface p1 options:n_rxq=4])
234 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl
242 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
244 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 3 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
246 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2])
247 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
249 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
250 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
251 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff
257 dnl There was a bug where OVS failed to create a ukey and install a megaflow
258 dnl if a packet with the exact same flow was received by two different pmd
259 dnl threads. This is a regression test for that bug.
260 AT_SETUP([PMD - same flow multiple threads])
262 [add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=2 -- \
263 set Open_vSwitch . other_config:pmd-cpu-mask=3
264 ], [], [], [--dummy-numa 0,0])
265 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
267 AT_CHECK([ovs-ofctl add-flow br0 action=controller])
269 dnl Make sure that the queues are on different cores. There's no way to
270 dnl control which queue is on which thread, we just need to make sure that
271 dnl two threads (core_id) show up in pmd-rxq-show
272 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show | cut -f 4 -d ' ' | sort], [0], [dnl
277 AT_CAPTURE_FILE([ofctl_monitor.log])
278 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
280 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
282 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
284 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
285 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
287 dnl Make sure that both flows have been installed
288 AT_CHECK([ovs-appctl dpctl/dump-flows | flow_dump_prepend_pmd], [0], [dnl
289 0 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:userspace(pid=0,slow_path(controller))
290 1 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:userspace(pid=0,slow_path(controller))
293 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
294 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
295 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff
296 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
297 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff
303 AT_SETUP([PMD - change numa node])
305 [add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=2 -- \
306 add-port br0 p2 -- set Interface p2 type=dummy-pmd ofport_request=2 options:n_rxq=2 -- \
307 set Open_vSwitch . other_config:pmd-cpu-mask=3
308 ], [], [], [--dummy-numa 0,1])
309 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
311 AT_CHECK([ovs-ofctl add-flow br0 action=controller])
313 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl
320 AT_CAPTURE_FILE([ofctl_monitor.log])
321 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
323 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
325 AT_CHECK([ovs-appctl netdev-dummy/receive p2 --qid 1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
327 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
328 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
330 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
331 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
332 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff
333 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=2 (via action) data_len=60 (unbuffered)
334 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff
337 AT_CHECK([ovs-vsctl set Interface p2 options:numa_id=1])
339 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl
346 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
348 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
350 AT_CHECK([ovs-appctl netdev-dummy/receive p2 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
352 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
353 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
355 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
356 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
357 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff
358 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=2 (via action) data_len=60 (unbuffered)
359 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff
365 AT_SETUP([PMD - non pmd device])
367 [add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=1 -- \
368 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \
369 set Interface br0 options:tx_pcap=br0.pcap -- \
370 set Open_vSwitch . other_config:pmd-cpu-mask=1
371 ], [], [], [--dummy-numa 0,0])
372 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
374 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL])
376 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl
380 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
382 AT_CHECK([ovs-appctl netdev-dummy/receive p2 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
384 OVS_WAIT_UNTIL([test `ovs-pcap br0.pcap | wc -l` -ge 2])
386 AT_CHECK([ovs-pcap br0.pcap], [0], [dnl
387 50540000000a50540000000908004500001c00000000400166df0a0000020a0000010800f7ff00000000000000000000000000000000000000000000
388 50540000000a50540000000908004500001c00000000400166df0a0000020a0000010800f7ff00000000000000000000000000000000000000000000
391 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=2])
393 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl
397 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
399 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
401 AT_CHECK([ovs-appctl netdev-dummy/receive p2 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
403 OVS_WAIT_UNTIL([test `ovs-pcap br0.pcap | wc -l` -ge 4])
405 AT_CHECK([ovs-pcap br0.pcap], [0], [dnl
406 50540000000a50540000000908004500001c00000000400166df0a0000020a0000010800f7ff00000000000000000000000000000000000000000000
407 50540000000a50540000000908004500001c00000000400166df0a0000020a0000010800f7ff00000000000000000000000000000000000000000000
408 50540000000a50540000000908004500001c00000000400166df0a0000020a0000010800f7ff00000000000000000000000000000000000000000000
409 50540000000a50540000000908004500001c00000000400166df0a0000020a0000010800f7ff00000000000000000000000000000000000000000000
415 AT_SETUP([PMD - add remove ports])
417 [], [], [], [--dummy-numa 0,0])
418 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
420 AT_CHECK([ovs-ofctl add-flow br0 actions=controller])
422 AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=1])
424 AT_CHECK([ovs-appctl dpif-netdev/pmd-rxq-show | parse_pmd_rxq_show], [0], [dnl
428 AT_CAPTURE_FILE([ofctl_monitor.log])
429 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
431 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
433 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2])
434 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
436 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
437 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
438 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff
441 AT_CHECK([ovs-vsctl del-port br0 p1])
442 AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy-pmd ofport_request=1 options:n_rxq=1])
444 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
446 AT_CHECK([ovs-appctl netdev-dummy/receive p1 --qid 0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
448 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 2])
449 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
451 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
452 NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
453 icmp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:f7ff