]>
Commit | Line | Data |
---|---|---|
9c4044a5 JS |
1 | AT_BANNER([dpif-netdev]) |
2 | ||
3 | # Strips out uninteresting parts of flow output, as well as parts | |
4 | # that vary from one run to another (e.g., timing and bond actions). | |
5 | m4_define([STRIP_XOUT], [[sed ' | |
6 | s/used:[0-9]*\.[0-9]*/used:0.0/ | |
7 | s/actions:.*/actions: <del>/ | |
8 | s/packets:[0-9]*/packets:0/ | |
9 | s/bytes:[0-9]*/bytes:0/ | |
10 | ' | sort]]) | |
11 | m4_define([FILTER_FLOW_INSTALL], [[ | |
623540e4 EJ |
12 | grep 'flow_add' | sed ' |
13 | s/.*flow_add: // | |
9c4044a5 JS |
14 | ' | sort | uniq]]) |
15 | m4_define([FILTER_FLOW_DUMP], [[ | |
16 | grep 'flow_dump ' | sed ' | |
17 | s/.*flow_dump // | |
18 | s/used:[0-9]*\.[0-9]*/used:0.0/ | |
19 | ' | sort | uniq]]) | |
1ffd16af | 20 | m4_define([STRIP_METADATA], [[sed 's/metadata=0x[0-9a-f]*/metadata=0x0/']]) |
9c4044a5 JS |
21 | |
22 | AT_SETUP([dpif-netdev - dummy interface]) | |
23 | # Create br0 with interfaces p1 and p7 | |
24 | # and br1 with interfaces p2 and p8 | |
25 | # with p1 and p2 connected via unix domain socket | |
26 | OVS_VSWITCHD_START( | |
27 | [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock ofport_request=1 -- \ | |
28 | add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \ | |
29 | add-br br1 -- \ | |
30 | set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \ | |
31 | set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \ | |
32 | fail-mode=secure -- \ | |
33 | add-port br1 p2 -- set interface p2 type=dummy options:stream=unix:$OVS_RUNDIR/p0.sock ofport_request=2 -- \ | |
34 | add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --]) | |
623540e4 | 35 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) |
9c4044a5 JS |
36 | |
37 | AT_CHECK([ovs-ofctl add-flow br0 action=normal]) | |
38 | AT_CHECK([ovs-ofctl add-flow br1 action=normal]) | |
39 | ovs-appctl time/stop | |
40 | ovs-appctl time/warp 5000 | |
41 | AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),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)']) | |
42 | AT_CHECK([ovs-appctl netdev-dummy/receive p8 'in_port(8),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)']) | |
43 | ovs-appctl time/warp 100 | |
44 | sleep 1 # wait for forwarders process packets | |
45 | ||
46 | AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl | |
623540e4 EJ |
47 | recirc_id=0,skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del> |
48 | recirc_id=0,skb_priority=0,ip,in_port=2,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del> | |
49 | recirc_id=0,skb_priority=0,ip,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del> | |
50 | recirc_id=0,skb_priority=0,ip,in_port=8,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del> | |
9c4044a5 JS |
51 | ]) |
52 | ||
53 | OVS_VSWITCHD_STOP | |
54 | AT_CLEANUP | |
b10d46a6 JS |
55 | |
56 | AT_SETUP([dpif-netdev - miss upcall key matches flow_install]) | |
57 | OVS_VSWITCHD_START( | |
58 | [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock | |
59 | set bridge br0 datapath-type=dummy other-config:datapath-id=1234 \ | |
60 | fail-mode=secure]) | |
623540e4 | 61 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) |
b10d46a6 JS |
62 | |
63 | AT_CHECK([ovs-ofctl add-flow br0 action=normal]) | |
64 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 '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)']) | |
65 | sleep 1 | |
66 | ||
67 | AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl | |
68 | skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(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) | |
69 | ]) | |
70 | AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl | |
623540e4 | 71 | recirc_id=0,skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del> |
b10d46a6 JS |
72 | ]) |
73 | ||
74 | # Now, the same again without megaflows. | |
75 | AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled | |
76 | ]) | |
77 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 '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)']) | |
78 | sleep 1 | |
79 | ||
80 | AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl | |
81 | skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(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) | |
82 | ]) | |
83 | AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl | |
623540e4 EJ |
84 | pkt_mark=0,recirc_id=0,skb_priority=0,icmp,tun_id=0,tun_src=0.0.0.0,tun_dst=0.0.0.0,tun_tos=0,tun_ttl=0,,in_port=1,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,mpls_label=0,mpls_tc=0,mpls_ttl=0,mpls_bos=0,mpls_lse1=0,mpls_lse2=0,icmp_type=8,icmp_code=0, actions: <del> |
85 | recirc_id=0,skb_priority=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del> | |
b10d46a6 JS |
86 | ]) |
87 | ||
88 | OVS_VSWITCHD_STOP | |
89 | AT_CLEANUP | |
90 | ||
91 | AT_SETUP([dpif-netdev - miss upcall key matches flow_dump]) | |
92 | OVS_VSWITCHD_START( | |
93 | [add-port br0 p1 -- set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p0.sock | |
94 | set bridge br0 datapath-type=dummy other-config:datapath-id=1234 \ | |
95 | fail-mode=secure]) | |
623540e4 | 96 | AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) |
b10d46a6 JS |
97 | |
98 | AT_CHECK([ovs-ofctl add-flow br0 action=normal]) | |
99 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 '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)']) | |
100 | sleep 1 | |
101 | ||
102 | AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl | |
103 | skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(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) | |
104 | ]) | |
105 | AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_DUMP | STRIP_XOUT], [0], [dnl | |
2d18eae8 | 106 | skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions: <del> |
b10d46a6 JS |
107 | ]) |
108 | ||
109 | # Now, the same again without megaflows. | |
110 | AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled | |
111 | ]) | |
112 | AT_CHECK([ovs-appctl netdev-dummy/receive p1 '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)']) | |
113 | sleep 1 | |
114 | ||
115 | AT_CHECK([cat ovs-vswitchd.log | grep -A 1 'miss upcall' | tail -n 1], [0], [dnl | |
116 | skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(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) | |
117 | ]) | |
118 | AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_DUMP | STRIP_XOUT], [0], [dnl | |
119 | skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(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), packets:0, bytes:0, used:never, actions: <del> | |
2d18eae8 | 120 | skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions: <del> |
b10d46a6 JS |
121 | ]) |
122 | ||
123 | OVS_VSWITCHD_STOP | |
124 | AT_CLEANUP |