summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDaniel Borkmann2014-04-02 20:52:56 +0200
committerDavid S. Miller2014-04-03 20:29:11 +0200
commit0f97ede45e65ffb6eab856313e79b14b902bcfaa (patch)
tree7f078a5bd8491b57b06044a592d28a8b300746eb /net
parentxen-netback: Grant copy the header instead of map and memcpy (diff)
downloadkernel-qcow2-linux-0f97ede45e65ffb6eab856313e79b14b902bcfaa.tar.gz
kernel-qcow2-linux-0f97ede45e65ffb6eab856313e79b14b902bcfaa.tar.xz
kernel-qcow2-linux-0f97ede45e65ffb6eab856313e79b14b902bcfaa.zip
packet: report tx_dropped in packet_direct_xmit
Since commit 015f0688f57c ("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>
Diffstat (limited to 'net')
-rw-r--r--net/packet/af_packet.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 01039d2b1695..c81a9719b5b2 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -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;
}