[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250611-netdevsim_stat-v1-2-c11b657d96bf@debian.org>
Date: Wed, 11 Jun 2025 08:06:20 -0700
From: Breno Leitao <leitao@...ian.org>
To: Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Breno Leitao <leitao@...ian.org>, kernel-team@...a.com,
Breno Leitao <Leitao@...ian.org>
Subject: [PATCH net-next 2/2] netdevsim: collect statistics at RX side
When the RX side of netdevsim was added, the RX statistics were missing,
making the driver unusable for GenerateTraffic() test framework.
This patch adds proper statistics tracking on RX side, complementing the
TX path.
Signed-off-by: Breno Leitao <Leitao@...ian.org>
---
drivers/net/netdevsim/netdev.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index 67871d31252fe..590cb5bb0d20b 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -39,12 +39,16 @@ MODULE_IMPORT_NS("NETDEV_INTERNAL");
static int nsim_napi_rx(struct nsim_rq *rq, struct sk_buff *skb)
{
+ struct net_device *dev = rq->napi.dev;
+
if (skb_queue_len(&rq->skb_queue) > NSIM_RING_SIZE) {
dev_kfree_skb_any(skb);
+ dev_dstats_rx_dropped(dev);
return NET_RX_DROP;
}
skb_queue_tail(&rq->skb_queue, skb);
+ dev_dstats_rx_add(dev, skb->len);
return NET_RX_SUCCESS;
}
--
2.47.1
Powered by blists - more mailing lists