Set datapath mask bits when setting a flow field.
authorJarno Rajahalme <jrajahalme@nicira.com>
Tue, 15 Oct 2013 19:40:38 +0000 (12:40 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 15 Oct 2013 23:00:36 +0000 (16:00 -0700)
commitf47ea0215f0fc2898815c903276d9ec8afd0306e
treecc064fadd3dbb5b88d8eeb2b532c09a89689efd0
parentb283836c09ad0564b85ea29a94ed495b33bfe0d0
Set datapath mask bits when setting a flow field.

Since at the datapath interface we do not have set actions for
individual fields, but larger sets of fields for a given protocol
layer, the set action will in practice only ever apply to exactly
matched flows for the given protocol layer.  For example, if the
reg_load changes the IP TTL, the corresponding datapath action will
rewrite also the IP addresses and TOS byte.  Since these other field
values may not be explicitly set, they depend on the incoming flow field
values, and are hence all of them are set in the wildcards masks, when
the action is committed to the datapath.  For the rare case, where the
reg_load action does not actually change the value, and no other flow
field values are set (or loaded), the datapath action is skipped, and
no mask bits are set.  Such a datapath flow should, however, be
dependent on the specific field value, so the corresponding wildcard
mask bits must be set, lest the datapath flow be applied to packets
containing some other value in the field and the field value remain
unchanged regardless of the incoming value.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/nx-match.c
lib/nx-match.h
ofproto/ofproto-dpif-xlate.c