summaryrefslogtreecommitdiffstats
path: root/net/openvswitch/flow.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2013-09-05 12:17:05 -0700
committerDavid S. Miller <davem@davemloft.net>2013-09-05 15:54:37 -0400
commit0d40f75bdab241868c0eb6f97aef9f8b3a66f7b3 (patch)
tree45b6907b65ab9d68e76150440c571c3bc30dcece /net/openvswitch/flow.c
parent06c54055bebf919249aa1eb68312887c3cfe77b4 (diff)
downloadblackbird-op-linux-0d40f75bdab241868c0eb6f97aef9f8b3a66f7b3.tar.gz
blackbird-op-linux-0d40f75bdab241868c0eb6f97aef9f8b3a66f7b3.zip
openvswitch: Fix alignment of struct sw_flow_key.
sw_flow_key alignment was declared as " __aligned(__alignof__(long))". However, this breaks on the m68k architecture where long is 32 bit in size but 16 bit aligned by default. This aligns to the size of a long to ensure that we can always do comparsions in full long-sized chunks. It also adds an additional build check to catch any reduction in alignment. CC: Andy Zhou <azhou@nicira.com> Reported-by: Fengguang Wu <fengguang.wu@intel.com> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/flow.c')
-rw-r--r--net/openvswitch/flow.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index ad1aeeb4f373..fb36f8565161 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -1981,6 +1981,7 @@ nla_put_failure:
* Returns zero if successful or a negative error code. */
int ovs_flow_init(void)
{
+ BUILD_BUG_ON(__alignof__(struct sw_flow_key) % __alignof__(long));
BUILD_BUG_ON(sizeof(struct sw_flow_key) % sizeof(long));
flow_cache = kmem_cache_create("sw_flow", sizeof(struct sw_flow), 0,
OpenPOWER on IntegriCloud