Skip to content

Commit 0f97ede

Browse files
Daniel Borkmanndavem330
authored andcommitted
packet: report tx_dropped in packet_direct_xmit
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 <edumazet@google.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bdab827 commit 0f97ede

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎net/packet/af_packet.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ static int packet_direct_xmit(struct sk_buff *skb)
275275

276276
return ret;
277277
drop:
278+
atomic_long_inc(&dev->tx_dropped);
278279
kfree_skb(skb);
279280
return NET_XMIT_DROP;
280281
}

0 commit comments

Comments
 (0)