Skip to content

Commit

Permalink
datapath: fix key size computation in key_attr_size()
Browse files Browse the repository at this point in the history
The key_attr_size() was not updated when RECIRC_ID and DP_HASH
key fields are added to support recircualtion. This patch fixes it.

Reported-by: Ben Pfaff <[email protected]>
Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>

VMware-BZ: 1266214
  • Loading branch information
azhou-nicira committed Jun 13, 2014
1 parent 2240af2 commit 6d8af7a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datapath/datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,

static size_t key_attr_size(void)
{
/* Whenever adding new OVS_KEY_ FIELDS, we should consider
* updating this function. */
BUILD_BUG_ON(OVS_KEY_ATTR_IPV4_TUNNEL != 21);

return nla_total_size(4) /* OVS_KEY_ATTR_PRIORITY */
+ nla_total_size(0) /* OVS_KEY_ATTR_TUNNEL */
+ nla_total_size(8) /* OVS_TUNNEL_KEY_ATTR_ID */
Expand All @@ -391,6 +395,8 @@ static size_t key_attr_size(void)
+ nla_total_size(0) /* OVS_TUNNEL_KEY_ATTR_CSUM */
+ nla_total_size(4) /* OVS_KEY_ATTR_IN_PORT */
+ nla_total_size(4) /* OVS_KEY_ATTR_SKB_MARK */
+ nla_total_size(4) /* OVS_KEY_ATTR_DP_HASH */
+ nla_total_size(4) /* OVS_KEY_ATTR_RECIRC_ID */
+ nla_total_size(12) /* OVS_KEY_ATTR_ETHERNET */
+ nla_total_size(2) /* OVS_KEY_ATTR_ETHERTYPE */
+ nla_total_size(4) /* OVS_KEY_ATTR_8021Q */
Expand Down

0 comments on commit 6d8af7a

Please sign in to comment.