diff options
author | Jiang Lidong <jianglidong3@jd.com> | 2020-03-04 09:49:29 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-05 17:33:57 -0800 |
commit | e25d5dbcffae62c9a7fa03517dfa4b8e67670e3d (patch) | |
tree | f5433ec68e9409519f7b1e5c2587bc3fc4f891d1 /drivers/net/veth.c | |
parent | 2f63f2d5981499e5867aa061c9c8eb448494bb1e (diff) | |
download | lwn-e25d5dbcffae62c9a7fa03517dfa4b8e67670e3d.tar.gz lwn-e25d5dbcffae62c9a7fa03517dfa4b8e67670e3d.zip |
veth: ignore peer tx_dropped when counting local rx_dropped
When local NET_RX backlog is full due to traffic overrun,
peer veth tx_dropped counter increases. At that time, list
local veth stats, rx_dropped has double value of peer
tx_dropped, even bigger than transmit packets by peer.
In NET_RX softirq process, if any packet drop case happens,
it increases dev's rx_dropped counter and returns NET_RX_DROP.
At veth tx side, it records any error returned from peer netif_rx
into local dev tx_dropped counter.
In veth get stats process, it puts local dev rx_dropped and
peer dev tx_dropped into together as local rx_drpped value.
So that it shows double value of real dropped packets number in
this case.
This patch ignores peer tx_dropped when counting local rx_dropped,
since peer tx_dropped is duplicated to local rx_dropped at most cases.
Signed-off-by: Jiang Lidong <jianglidong3@jd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/veth.c')
-rw-r--r-- | drivers/net/veth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 8cdc4415fa70..d4cbb9e8c63f 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -328,7 +328,7 @@ static void veth_get_stats64(struct net_device *dev, rcu_read_lock(); peer = rcu_dereference(priv->peer); if (peer) { - tot->rx_dropped += veth_stats_tx(peer, &packets, &bytes); + veth_stats_tx(peer, &packets, &bytes); tot->rx_bytes += bytes; tot->rx_packets += packets; |