odp-util: Make sure vlan tci mask has exact match for VLAN_CFI.
authorAlex Wang <alexw@nicira.com>
Sun, 7 Jun 2015 18:38:52 +0000 (11:38 -0700)
committerAlex Wang <alexw@nicira.com>
Sun, 7 Jun 2015 19:09:37 +0000 (12:09 -0700)
commit1cb39f32348e986effd64df4312aa6c03e0481bd
tree37e2bcb8e394275f3872b82b52dace3a8d56c9f9
parent22a1a7a3da9bd129a12ca583f405cc6df00ba39b
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>
ofproto/ofproto-dpif-xlate.c
tests/ofproto-dpif.at