dpif-netdev: Exact match non-presence of vlans.
authorJarno Rajahalme <jrajahalme@nicira.com>
Sat, 19 Sep 2015 00:47:37 +0000 (17:47 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Sat, 19 Sep 2015 00:47:37 +0000 (17:47 -0700)
commit449b81311336977d874f80adde9c275dc67e0f8c
tree3839c5cea70a590803f1643dba5b41de456f000f
parentcee06621d90f0a30b16735e40094918a38e2d010
dpif-netdev: Exact match non-presence of vlans.

The Netlink encoding of datapath flow keys cannot express wildcarding
the presence of a VLAN tag. Instead, a missing VLAN tag is interpreted
as exact match on the fact that there is no VLAN.  This makes reading
datapath flow dumps confusing, since for everything else, a missing
key value means that the corresponding key was wildcarded.

Unless we refactor a lot of code that translates between Netlink and
struct flow representations, we have to do the same in the userspace
datapath.  This makes at least the flow install logs show that the
vlan_tci field is matched to zero.  However, the datapath flow dumps
remain as they were before, as they are performed using the netlink
format.

Add a test to verify that packet with a vlan will not match a rule
that may seem wildcarding the presence of the vlan tag.  Applying this
test without the userspace datapath modification showed that the
userspace datapath failed to create a new datapath flow for the VLAN
packet before this patch.

Reported-by: Tony van der Peet <tony.vanderpeet@gmail.com>
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/dpif-netdev.c
lib/odp-util.c
tests/ofproto-dpif.at