• Eric Dumazet's avatar
    net: introduce dev_consume_skb_any() · e6247027
    Eric Dumazet authored
    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: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e6247027
dev.c 173 KB