miniflow: Use 64-bit data.
authorJarno Rajahalme <jrajahalme@nicira.com>
Tue, 6 Jan 2015 19:10:42 +0000 (11:10 -0800)
committerJarno Rajahalme <jrajahalme@nicira.com>
Tue, 6 Jan 2015 22:47:30 +0000 (14:47 -0800)
commitd70e8c28f992c0d8c2918aa0733b935ce1a0caed
tree95442ab72932758e667f9241282ddc69b79a0873
parentaae7c34f0406569d1eaf574ec6e4e34b15f5bc78
miniflow: Use 64-bit data.

So far the compressed flow data in struct miniflow has been in 32-bit
words with a 63-bit map, allowing for a maximum size of struct flow of
252 bytes.  With the forthcoming Geneve options this is not sufficient
any more.

This patch solves the problem by changing the miniflow data to 64-bit
words, doubling the flow max size to 504 bytes.  Since the word size
is doubled, there is some loss in compression efficiency.  To counter
this some of the flow fields have been reordered to keep related
fields together (e.g., the source and destination IP addresses share
the same 64-bit word).

This change should speed up flow data processing on 64-bit CPUs, which
may help counterbalance the impact of making the struct flow bigger in
the future.

Classifier lookup stage boundaries are also changed to 64-bit
alignment, as the current algorithm depends on each miniflow word to
not be split between ranges.  This has resulted in new padding (part
of the 'mpls_lse' field).

The 'dp_hash' field is also moved to packet metadata to eliminate
otherwise needed padding there.  This allows the L4 to fit into one
64-bit word, and also makes matches on 'dp_hash' more efficient as
misses can be found already on stage 1.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
15 files changed:
lib/classifier-private.h
lib/classifier.c
lib/dpif-netdev.c
lib/flow.c
lib/flow.h
lib/match.c
lib/nx-match.c
lib/odp-util.h
lib/ofp-util.c
lib/tnl-ports.c
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto.c
tests/ofproto-dpif.at
tests/test-classifier.c