Skip to contentSkip to conversation

Open vSwitch

GIT net New Jesse Gross 3 participants 5 messages Aug 14, 2013 – Aug 15, 2013 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Three bug fixes that are fairly small either way but resolve obviously incorrect code. For net/3.11.

The following changes since commit ad81f0545ef01ea651886dddac4bef6cec930092:

Linux 3.11-rc1 (2013-07-14 15:18:27 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch.git fixes

for you to fetch changes up to 36bf5cc66d60868bcc10aff209defed5a7b71c1d:

openvswitch: Reset tunnel key between input and output. (2013-08-14 15:50:36 -0700)

----------------------------------------------------------------
Jesse Gross (2):
openvswitch: Fix bad merge resolution.
openvswitch: Reset tunnel key between input and output.

Pravin B Shelar (1):
openvswitch: Use correct type while allocating flex array.

 net/openvswitch/actions.c  | 1 +
 net/openvswitch/datapath.c | 3 ---
 net/openvswitch/flow.c     | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)

A message that is not in the archive (sent off-list or not yet received): 1376522347-39531-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org

#2 lore raw

PATCH 1/3 openvswitch: Fix bad merge resolution.

git silently included an extra hunk in vport_cmd_set() during automatic merging. This code is unreachable so it does not actually introduce a problem but it is clearly incorrect.

---
 net/openvswitch/datapath.c | 3 ---
 1 file changed, 3 deletions(-)
net/openvswitch/datapath.c +0 -3
index f7e3a0d..f2ed760 100644
@@ -2076,9 +2076,6 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
 	ovs_notify(reply, info, &ovs_dp_vport_multicast_group);
 	return 0;
 
-	rtnl_unlock();
-	return 0;
-
 exit_free:
 	kfree_skb(reply);
 exit_unlock:
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH 3/3 openvswitch: Reset tunnel key between input and output.

In reply to a message not in the archive

It doesn't make sense to output a tunnel packet using the same parameters that it was received with since that will generally just result in the packet going back to us. As a result, userspace assumes that the tunnel key is cleared when transitioning through the switch. In the majority of cases this doesn't matter since a packet is either going to a tunnel port (in which the key is overwritten with new values) or to a non-tunnel port (in which case the key is ignored). However, it's theoreticaly possible that userspace could rely on the documented behavior, so this corrects it.

---
 net/openvswitch/actions.c | 1 +
 1 file changed, 1 insertion(+)
net/openvswitch/actions.c +1 -0
index 22c5f39..ab101f7 100644
@@ -535,6 +535,7 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb)
 {
 	struct sw_flow_actions *acts = rcu_dereference(OVS_CB(skb)->flow->sf_acts);
 
+	OVS_CB(skb)->tun_key = NULL;
 	return do_execute_actions(dp, skb, acts->actions,
 					 acts->actions_len, false);
 }
Signature · 1 line
1.8.1.2
#4 lore raw

PATCH 2/3 openvswitch: Use correct type while allocating flex array.

In reply to Jesse Gross

From: Pravin B Shelar <[email protected]>

Flex array is used to allocate hash buckets which is type struct hlist_head, but we use struct hlist_head * to calculate array size. Since hlist_head is of size pointer it works fine.

Following patch use correct type.

---
 net/openvswitch/flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/flow.c +1 -1
index 5c519b1..1aa84dc 100644
@@ -240,7 +240,7 @@ static struct flex_array *alloc_buckets(unsigned int n_buckets)
 	struct flex_array *buckets;
 	int i, err;
 
-	buckets = flex_array_alloc(sizeof(struct hlist_head *),
+	buckets = flex_array_alloc(sizeof(struct hlist_head),
 				   n_buckets, GFP_KERNEL);
 	if (!buckets)
 		return NULL;
Signature · 1 line
1.8.1.2