dpif-netdev: Properly create exact match masks.
authorJarno Rajahalme <jrajahalme@nicira.com>
Wed, 11 Dec 2013 19:07:01 +0000 (11:07 -0800)
committerJarno Rajahalme <jrajahalme@nicira.com>
Wed, 11 Dec 2013 19:07:01 +0000 (11:07 -0800)
commit8c301900fc6f7faface4a2cbd016411f966d0601
treedf943c1e68678ff3fe9c004c7ce9f5b1d3e911d2
parent54d68e0edfc40592e2f3c0b088c075d8793b5359
dpif-netdev: Properly create exact match masks.

Normally OVS userspace supplies a mask along with a flow key for each
new data path flow that should be created.  OVS also provides an
option to disable the kernel wildcarding, in which case the flows are
created without a mask.  When kernel wildcarding is disabled, the
datapath should use exact match, i.e. not wildcard any bits in the
flow key.  Currently, what happens with the userspace datapath instead
is that a datapath flow with mostly empty mask is created (i.e., most
fields are wildcarded), as the current code does not examine the given
mask key length to find out that the mask key is actually empty.  This
results in the same datapath flow matching on packets of multiple
different flows, wrong actions being processed, and stats being
incorrect.

This patch refactors userspace datapath code to explicitly initialize
a suitable exact match mask when a flow put without a mask is
executed.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/dpif-netdev.c
tests/ofproto-dpif.at