net: introduce dev_consume_skb_any()
authorEric Dumazet <edumazet@google.com>
Thu, 5 Dec 2013 12:45:08 +0000 (04:45 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Dec 2013 20:24:02 +0000 (15:24 -0500)
commite6247027e5173c00efb2084d688d06ff835bc3b0
tree44c1fc4da5358f778fc82a1056ef9a2a6e7eea0e
parentf96eb74c84ebb09a03031f7f1e51789a928f9de0
net: introduce dev_consume_skb_any()

Some network drivers use dev_kfree_skb_any() and dev_kfree_skb_irq()
helpers to free skbs, both for dropped packets and TX completed ones.

We need to separate the two causes to get better diagnostics
given by dropwatch or "perf record -e skb:kfree_skb"

This patch provides two new helpers, dev_consume_skb_any() and
dev_consume_skb_irq() to be used for consumed skbs.

__dev_kfree_skb_irq() is slightly optimized to remove one
atomic_dec_and_test() in fast path, and use this_cpu_{r|w} accessors.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/dev.c