More accurate wildcarding and fragment handling.
authorJarno Rajahalme <jrajahalme@nicira.com>
Thu, 17 Oct 2013 21:28:20 +0000 (14:28 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 17 Oct 2013 22:08:05 +0000 (15:08 -0700)
commit94639963bf275a41e42277116205da0e9b457580
treeae1c59faf70461c6c681c287d6f44fe2e675c1b3
parenta5ae88ff8a276e86c842ac102145432662bf711a
More accurate wildcarding and fragment handling.

This patch gets rid of the need for having explicit padding in struct
flow as new fields are being added.  flow_wildcards_init_exact(), which
used to set bits in both compiler generated and explicit padding, is
removed.  match_wc_init() is now used instead, which generates the mask
based on a given flow, setting bits only in fields which make sense.

Places where random bits were placed in struct flow have been changed to
only set random bits on fields that are significant in the given context.
This avoids setting padding bits.

- lib/flow:
  - Properly initialize struct flow also in places we used to zero out
    padding before.
  - Add flow_random_hash_fields() used for testing.
  - Remove flow_wildcards_init_exact() to avoid initializing
     masks where compiler generated padding has bits set.
- lib/match.c match_wc_init(): Wildcard transport layer fields for later
  fragments, remove match_init_exact(), which used
  flow_wildcards_init_exact().
- tests/test-flows.c: use match_wc_init() instead of match_init_exact()
- tests/flowgen.pl: generate more accurate packets and flows when
  fragmenting, mark unavailable fields as wildcarded.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/flow.c
lib/flow.h
lib/match.c
lib/match.h
ofproto/ofproto-dpif.c
tests/flowgen.pl
tests/test-bundle.c
tests/test-flows.c
tests/test-multipath.c