From 4f825a340a1dd2699ba33d86d90a67c8be212522 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Mon, 3 Sep 2012 15:15:01 -0700 Subject: [PATCH] datapath: Fix FLOW_BUFSIZE definition. 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 Acked-by: Kyle Mestery --- datapath/flow.h | 8 +++++--- 1 file 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, -- 2.43.0