]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit6630035b286c56530ef734e7b5bde69a2bc2ab27
tree44c1fc4da5358f778fc82a1056ef9a2a6e7eea0e
parent98d093ef66a6b078274a90a24599fd463dbf1252
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