Skip to contentSkip to conversation

openvswitch: distinguish between the dropped and consumed skb

PATCH Applied [email protected] 3 participants 3 messages Sep 3, 2014 – Sep 4, 2014

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

PATCH v2 1/1 openvswitch: distinguish between the dropped and consumed skb

From: Li RongQing <[email protected]>

distinguish between the dropped and consumed skb, not assume the skb is consumed always

Cc Thomas Graf <[email protected]>
Cc Pravin Shelar <[email protected]>
---
 net/openvswitch/datapath.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
net/openvswitch/datapath.c +5 -2
index 35d866f..91d66b7 100644
@@ -265,8 +265,11 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb)
 		upcall.key = &key;
 		upcall.userdata = NULL;
 		upcall.portid = ovs_vport_find_upcall_portid(p, skb);
-		ovs_dp_upcall(dp, skb, &upcall);
-		consume_skb(skb);
+		error = ovs_dp_upcall(dp, skb, &upcall);
+		if (unlikely(error))
+			kfree_skb(skb);
+		else
+			consume_skb(skb);
 		stats_counter = &stats->n_missed;
 		goto out;
 	}
Signature · 1 line
1.7.10.4
Acked-by on v2 1/1
#1 lore raw
Quoted 8 lines · On Wed, Sep 3, 2014 at 2:43 AM, <[email protected]> wrote:

From: Li RongQing <[email protected]>

distinguish between the dropped and consumed skb, not assume the skb is consumed always

Cc Thomas Graf <[email protected]>
Cc Pravin Shelar <[email protected]>

Thanks.

Quoted 25 lines
---
 net/openvswitch/datapath.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
net/openvswitch/datapath.c +5 -3
index 35d866f..91d66b7 100644
@@ -265,8 +265,11 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb)
                upcall.key = &key;
                upcall.userdata = NULL;
                upcall.portid = ovs_vport_find_upcall_portid(p, skb);
-               ovs_dp_upcall(dp, skb, &upcall);
-               consume_skb(skb);
+               error = ovs_dp_upcall(dp, skb, &upcall);
+               if (unlikely(error))
+                       kfree_skb(skb);
+               else
+                       consume_skb(skb);
                stats_counter = &stats->n_missed;
                goto out;
        }
--

1.7.10.4