2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-09 13:49:05 +00:00

datapath: 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>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
Li RongQing
2014-09-07 14:49:02 -07:00
committed by Pravin B Shelar
parent f1112037df
commit a7d607c58d

View File

@@ -269,13 +269,19 @@ void ovs_dp_process_packet(struct sk_buff *skb)
&n_mask_hit); &n_mask_hit);
if (unlikely(!flow)) { if (unlikely(!flow)) {
struct dp_upcall_info upcall; struct dp_upcall_info upcall;
int error;
upcall.cmd = OVS_PACKET_CMD_MISS; upcall.cmd = OVS_PACKET_CMD_MISS;
upcall.userdata = NULL; upcall.userdata = NULL;
upcall.portid = ovs_vport_find_upcall_portid(p, skb); upcall.portid = ovs_vport_find_upcall_portid(p, skb);
upcall.egress_tun_info = NULL; upcall.egress_tun_info = NULL;
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; stats_counter = &stats->n_missed;
goto out; goto out;
} }