Skip to content

Commit c5eba0b

Browse files
Li RongQingdavem330
authored andcommitted
openvswitch: distinguish between the dropped and consumed skb
distinguish between the dropped and consumed skb, not assume the skb is consumed always Cc: Thomas Graf <tgraf@noironetworks.com> Cc: Pravin Shelar <pshelar@nicira.com> Signed-off-by: Li RongQing <roy.qing.li@gmail.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bec6bfb commit c5eba0b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎net/openvswitch/datapath.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,11 @@ void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb)
265265
upcall.key = &key;
266266
upcall.userdata = NULL;
267267
upcall.portid = ovs_vport_find_upcall_portid(p, skb);
268-
ovs_dp_upcall(dp, skb, &upcall);
269-
consume_skb(skb);
268+
error = ovs_dp_upcall(dp, skb, &upcall);
269+
if (unlikely(error))
270+
kfree_skb(skb);
271+
else
272+
consume_skb(skb);
270273
stats_counter = &stats->n_missed;
271274
goto out;
272275
}

0 commit comments

Comments
 (0)