It's possible to trace kfree_skb() call sites to find out where
packets are getting dropped. Situations where kfree_skb() does
not actually indicate an error adds additional noise, so use
consume_skb() instead to avoid tracing non-errors.
Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
if (prev_port != -1)
do_output(dp, skb, prev_port);
else
- kfree_skb(skb);
+ consume_skb(skb);
return 0;
}
}
if (is_frag && dp->drop_frags) {
- kfree_skb(skb);
+ consume_skb(skb);
stats_counter_off = offsetof(struct dp_stats_percpu, n_frags);
goto out;
}
if (skb_is_gso(skb)) {
struct sk_buff *nskb = skb_gso_segment(skb, NETIF_F_SG | NETIF_F_HW_CSUM);
- kfree_skb(skb);
- skb = nskb;
- if (IS_ERR(skb)) {
- err = PTR_ERR(skb);
+ if (IS_ERR(nskb)) {
+ kfree_skb(skb);
+ err = PTR_ERR(nskb);
goto err;
}
+ consume_skb(skb);
+ skb = nskb;
}
err = queue_control_packets(dp, skb, upcall_info);
if (err)
goto err_kfree_skbs;
- kfree_skb(skb);
+ consume_skb(skb);
skb = nskb;
} while (skb);
return 0;
err = flow_extract(skb, dst_vport->port_no, &flow_key,
&flow_key_len, &is_frag);
- kfree_skb(skb);
+ consume_skb(skb);
if (err || is_frag)
goto done;
struct sk_buff *nskb;
nskb = skb_gso_segment(skb, 0);
- kfree_skb(skb);
if (IS_ERR(nskb)) {
+ kfree_skb(skb);
err = PTR_ERR(nskb);
goto error;
}
+ consume_skb(skb);
skb = nskb;
} else if (get_ip_summed(skb) == OVS_CSUM_PARTIAL) {
/* Pages aren't locked and could change at any time.
goto tag;
}
- kfree_skb(skb);
- skb = nskb;
- if (IS_ERR(skb))
+ if (IS_ERR(nskb)) {
+ kfree_skb(skb);
return 0;
+ }
+ consume_skb(skb);
+ skb = nskb;
len = 0;
do {