Skip to content

Commit

Permalink
packet: report tx_dropped in packet_direct_xmit
Browse files Browse the repository at this point in the history
Since commit 015f068 ("net: net: add a core netdev->tx_dropped
counter"), we can now account for TX drops from within the core
stack instead of drivers.

Therefore, fix packet_direct_xmit() and increase drop count when we
encounter a problem before driver's xmit function was called (we do
not want to doubly account for it).

Suggested-by: Eric Dumazet <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Daniel Borkmann authored and davem330 committed Apr 3, 2014
1 parent bdab827 commit 0f97ede
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ static int packet_direct_xmit(struct sk_buff *skb)

return ret;
drop:
atomic_long_inc(&dev->tx_dropped);
kfree_skb(skb);
return NET_XMIT_DROP;
}
Expand Down

0 comments on commit 0f97ede

Please sign in to comment.