openvswitch: distinguish between the dropped and consumed skb
Subsystems (3)
PATCH 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 Pravin Shelar <[email protected]>
Signed-off-by Li RongQing <[email protected]>
--- net/openvswitch/datapath.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/openvswitch/datapath.c +2 -1
@@ -266,7 +266,6 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb) upcall.userdata =NULL ; upcall.portid =ovs_vport_find_upcall_portid (p, skb);ovs_dp_upcall (dp, skb, &upcall); -consume_skb (skb); stats_counter = &stats->n_missed; goto out; }
@@ -304,9 +303,11 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,if (err) goto err; +consume_skb (skb);return 0 ; err: +kfree_skb (skb); stats =this_cpu_ptr (dp->stats_percpu);u64_stats_update_begin (&stats->syncp);
Signature · 1 line
1.7.10.4
net/openvswitch/datapath.c int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb, · line 307
Quoted 6 lines · On 09/02/14 at 08:52pm, [email protected] wrote:
net/openvswitch/datapath.c +1
-0@@ -304,9 +303,11 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,if (err) goto err; +consume_skb (skb);return 0 ;
What about the path from output_userspace()?
Quoted 9 lines · Thomas Graf
net/openvswitch/datapath.c int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb, · line 307
Quoted 6 lines · On 09/02/14 at 08:52pm, [email protected] wrote:
net/openvswitch/datapath.c +1
-0@@ -304,9 +303,11 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,if (err) goto err; +consume_skb (skb);return 0 ;What about the path from
output_userspace()?
Right, output_userspace() can not free the skb in any case.