Skip to content

Commit

Permalink
openvswitch: Shrink sw_flow_mask by 8 bytes (64-bit) or 4 bytes (32-b…
Browse files Browse the repository at this point in the history
…it).

We won't normally have a ton of flow masks but using a size_t to store
values no bigger than sizeof(struct sw_flow_key) seems excessive.

This reduces sw_flow_key_range and sw_flow_mask by 4 bytes on 32-bit
systems.  On 64-bit systems it shrinks sw_flow_key_range by 12 bytes but
sw_flow_mask only by 8 bytes due to padding.

Compile tested only.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
  • Loading branch information
blp authored and jessegross committed Jan 6, 2014
1 parent d121190 commit 8f49ce1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/openvswitch/flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ struct sw_flow_key {
} __aligned(BITS_PER_LONG/8); /* Ensure that we can do comparisons as longs. */

struct sw_flow_key_range {
size_t start;
size_t end;
unsigned short int start;
unsigned short int end;
};

struct sw_flow_mask {
Expand Down

0 comments on commit 8f49ce1

Please sign in to comment.