linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] veth: ignore peer tx_dropped when counting local rx_dropped
@ 2020-03-04  1:49 Lidong Jiang
  2020-03-06  1:34 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Lidong Jiang @ 2020-03-04  1:49 UTC (permalink / raw)
  To: davem
  Cc: ast, daniel, hawk, john.fastabend, netdev, linux-kernel, jianglidong3

From: Jiang Lidong <jianglidong3@jd.com>

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>
---
 drivers/net/veth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index a552df3..bad9e03 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;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] veth: ignore peer tx_dropped when counting local rx_dropped
  2020-03-04  1:49 [PATCH] veth: ignore peer tx_dropped when counting local rx_dropped Lidong Jiang
@ 2020-03-06  1:34 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-06  1:34 UTC (permalink / raw)
  To: jianglidong
  Cc: ast, daniel, hawk, john.fastabend, netdev, linux-kernel, jianglidong3

From: Lidong Jiang <jianglidong@gmail.com>
Date: Wed,  4 Mar 2020 09:49:29 +0800

> From: Jiang Lidong <jianglidong3@jd.com>
> 
> 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>

This makes sense to me, applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-06  1:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04  1:49 [PATCH] veth: ignore peer tx_dropped when counting local rx_dropped Lidong Jiang
2020-03-06  1:34 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).