summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2012-09-03 15:15:01 -0700
committerJesse Gross <jesse@nicira.com>2012-09-03 19:01:59 -0700
commit12953ff77c8e0f1fc99f04b34220b84fb6a20efe (patch)
treef495adb118f48021ffe3870c73987982865ec6d9
parente80478bac49b86e1b9b9cf91fd809e9443794e19 (diff)
downloadopenvswitch-12953ff77c8e0f1fc99f04b34220b84fb6a20efe.tar.gz
datapath: Fix FLOW_BUFSIZE definition.v1.7.1
This is analogous to the change made in userspace with 2508ac16defd417b94fb69689b6b1da4fbc76282 (odp-util: Update ODPUTIL_FLOW_KEY_BYTES for current kernel flow format.). The extra space for vlan encapsulation was not included in the allocation for maximum length flows. Found by code inspection and to my knowledge has never been hit, likely because skb allocations are padded out to a cacheline, making userspace more susceptible to this problem than the kernel. In theory, however, the right combination of flow and packet size could result in a kernel panic. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Kyle Mestery <kmestery@cisco.com>
-rw-r--r--datapath/flow.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/datapath/flow.h b/datapath/flow.h
index 5be481e6b..02c563a36 100644
--- a/datapath/flow.h
+++ b/datapath/flow.h
@@ -152,15 +152,17 @@ u64 ovs_flow_used_time(unsigned long flow_jiffies);
* OVS_KEY_ATTR_TUN_ID 8 -- 4 12
* OVS_KEY_ATTR_IN_PORT 4 -- 4 8
* OVS_KEY_ATTR_ETHERNET 12 -- 4 16
+ * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (outer VLAN ethertype)
* OVS_KEY_ATTR_8021Q 4 -- 4 8
- * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8
+ * OVS_KEY_ATTR_ENCAP 0 -- 4 4 (VLAN encapsulation)
+ * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (inner VLAN ethertype)
* OVS_KEY_ATTR_IPV6 40 -- 4 44
* OVS_KEY_ATTR_ICMPV6 2 2 4 8
* OVS_KEY_ATTR_ND 28 -- 4 32
* -------------------------------------------------
- * total 144
+ * total 156
*/
-#define FLOW_BUFSIZE 144
+#define FLOW_BUFSIZE 156
int ovs_flow_to_nlattrs(const struct sw_flow_key *, struct sk_buff *);
int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp,