diff options
author | Alex Wang <alexw@nicira.com> | 2015-06-07 11:38:52 -0700 |
---|---|---|
committer | Alex Wang <alexw@nicira.com> | 2015-06-07 11:43:34 -0700 |
commit | f171fa88765ea7730f45cabdb5a4f31b7414c97a (patch) | |
tree | e3b520db160b58bfdafbc4c88795de8456563d4f /tests/ofproto-dpif.at | |
parent | d6943394576b1cfc69929dbde2513617a46a4e10 (diff) | |
download | openvswitch-f171fa88765ea7730f45cabdb5a4f31b7414c97a.tar.gz |
odp-util: Make sure vlan tci mask has exact match for VLAN_CFI.
OVS datapath has check which prevents the installation of flow
that matches VLAN TCI but does not have exact match for VLAN_CFI
bit. To follow this rule, ovs userspace must make sure the
flow key for datapath flow matching VLAN TCI has exact match for
VLAN_CFI bit.
Before this commit, this is not enforced, so OpenFlow flow like
"vlan_tci=0x000a/0x0fff,action=output:local" can generate datapath
flow like "vlan(vid=10/0xfff,pcp=0/0x0,cfi=1/0)".
With the OVS datapath check, the installation of such datapath
flow will be rejected with:
"|WARN|system@ovs-system: failed to put[create][modify] (Invalid argument)"
This commit makes ovs userspace always exact match the VLAN_CFI
bit if the flow matches VLAN TCI.
Reported-by: Ronald Lee <ronaldlee@vmware.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Diffstat (limited to 'tests/ofproto-dpif.at')
-rw-r--r-- | tests/ofproto-dpif.at | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index b5a9ad917..f9015c789 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -6673,3 +6673,19 @@ icmp6,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src OVS_VSWITCHD_STOP AT_CLEANUP +# Tests the exact match of CFI bit in installed datapath flows matching VLAN. +AT_SETUP([ofproto-dpif - vlan matching]) +OVS_VSWITCHD_START( + [add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1]) +AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg]) + +AT_CHECK([ovs-ofctl del-flows br0]) +AT_CHECK([ovs-ofctl add-flow br0 "vlan_tci=0x000a/0x0fff,action=output:local"]) + +AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=10,pcp=0),encap(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))']) + +AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[1]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl +recirc_id=0,ip,in_port=1,dl_vlan=10,nw_frag=no, actions: <del> +]) +OVS_VSWITCHD_STOP +AT_CLEANUP |