Skip to contentSkip to conversation

net/netvsc: add stats counters from VF

PATCH Superseded [email protected] 3 participants 4 messages Feb 18, 2025 – Mar 21, 2025 Network drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/netvsc: add stats counters from VF

From: Long Li <[email protected]>

The netvsc driver should add per-queue and rx_nombuf counters from VF.

Fixes 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
---
 drivers/net/netvsc/hn_ethdev.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/netvsc/hn_ethdev.c +5 -5
index 988c51928d..069d603d90 100644
@@ -824,8 +824,8 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev,
 		stats->oerrors += txq->stats.errors;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
-			stats->q_opackets[i] = txq->stats.packets;
-			stats->q_obytes[i] = txq->stats.bytes;
+			stats->q_opackets[i] += txq->stats.packets;
+			stats->q_obytes[i] += txq->stats.bytes;
 		}
 	}
 
@@ -841,12 +841,12 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev,
 		stats->imissed += rxq->stats.ring_full;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
-			stats->q_ipackets[i] = rxq->stats.packets;
-			stats->q_ibytes[i] = rxq->stats.bytes;
+			stats->q_ipackets[i] += rxq->stats.packets;
+			stats->q_ibytes[i] += rxq->stats.bytes;
 		}
 	}
 
-	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
+	stats->rx_nombuf += dev->data->rx_mbuf_alloc_failed;
 	return 0;
 }
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 54 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, February 19, 2025 5:13 AM
To: Stephen Hemminger <[email protected]>; Wei Hu <[email protected]>
Cc: [email protected]; Long Li <[email protected]>; [email protected]
Subject: [EXTERNAL] [PATCH] net/netvsc: add stats counters from VF

From: Long Li <[email protected]>

The netvsc driver should add per-queue and rx_nombuf counters from VF.

Fixes 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
---
 drivers/net/netvsc/hn_ethdev.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/netvsc/hn_ethdev.c +5 -6
index 988c51928d..069d603d90 100644
@@ -824,8 +824,8 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev,
 		stats->oerrors += txq->stats.errors;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
-			stats->q_opackets[i] = txq->stats.packets;
-			stats->q_obytes[i] = txq->stats.bytes;
+			stats->q_opackets[i] += txq->stats.packets;
+			stats->q_obytes[i] += txq->stats.bytes;
 		}
 	}
 
@@ -841,12 +841,12 @@ static int hn_dev_stats_get(struct rte_eth_dev
 *dev,
 		stats->imissed += rxq->stats.ring_full;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
-			stats->q_ipackets[i] = rxq->stats.packets;
-			stats->q_ibytes[i] = rxq->stats.bytes;
+			stats->q_ipackets[i] += rxq->stats.packets;
+			stats->q_ibytes[i] += rxq->stats.bytes;
 		}
 	}
 
-	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
+	stats->rx_nombuf += dev->data->rx_mbuf_alloc_failed;
 	return 0;
 }
 
--
Quoted 1 line

2.34.1

#2 lore raw
Quoted 63 lines

-----Original Message-----
From: Wei Hu <[email protected]>
Sent: Tuesday, February 18, 2025 10:12 PM
To: [email protected]; Stephen Hemminger <[email protected]>
Cc: [email protected]; Long Li <[email protected]>; [email protected]
Subject: RE: [EXTERNAL] [PATCH] net/netvsc: add stats counters from VF

Quoted 51 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, February 19, 2025 5:13 AM
To: Stephen Hemminger <[email protected]>; Wei Hu <[email protected]>
Cc: [email protected]; Long Li <[email protected]>; [email protected]
Subject: [EXTERNAL] [PATCH] net/netvsc: add stats counters from VF

From: Long Li <[email protected]>

The netvsc driver should add per-queue and rx_nombuf counters from VF.

Fixes 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
---
 drivers/net/netvsc/hn_ethdev.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/net/netvsc/hn_ethdev.c index 988c51928d..069d603d90 100644

drivers/net/netvsc/hn_ethdev.c +5 -5
@@ -824,8 +824,8 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev,
 		stats->oerrors += txq->stats.errors;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
-			stats->q_opackets[i] = txq->stats.packets;
-			stats->q_obytes[i] = txq->stats.bytes;
+			stats->q_opackets[i] += txq->stats.packets;
+			stats->q_obytes[i] += txq->stats.bytes;
 		}
 	}
 
@@ -841,12 +841,12 @@ static int hn_dev_stats_get(struct rte_eth_dev
 *dev,
 		stats->imissed += rxq->stats.ring_full;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
-			stats->q_ipackets[i] = rxq->stats.packets;
-			stats->q_ibytes[i] = rxq->stats.bytes;
+			stats->q_ipackets[i] += rxq->stats.packets;
+			stats->q_ibytes[i] += rxq->stats.bytes;
 		}
 	}
 
-	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
+	stats->rx_nombuf += dev->data->rx_mbuf_alloc_failed;
 	return 0;
 }
Quoted 4 lines
Quoted 2 lines

--
2.34.1

Hi Stephen,

Is it okay to merge this patch?

Thanks,
Long

#3 lore raw
Quoted 50 lines
Quoted 45 lines
Quoted 45 lines

Subject: [EXTERNAL] [PATCH] net/netvsc: add stats counters from VF

From: Long Li <[email protected]>

The netvsc driver should add per-queue and rx_nombuf counters from VF.

Fixes 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
---
 drivers/net/netvsc/hn_ethdev.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/net/netvsc/hn_ethdev.c index 988c51928d..069d603d90 100644

drivers/net/netvsc/hn_ethdev.c +5 -5
@@ -824,8 +824,8 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev,
 		stats->oerrors += txq->stats.errors;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
-			stats->q_opackets[i] = txq->stats.packets;
-			stats->q_obytes[i] = txq->stats.bytes;
+			stats->q_opackets[i] += txq->stats.packets;
+			stats->q_obytes[i] += txq->stats.bytes;
 		}
 	}
 
@@ -841,12 +841,12 @@ static int hn_dev_stats_get(struct rte_eth_dev
 *dev,
 		stats->imissed += rxq->stats.ring_full;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
-			stats->q_ipackets[i] = rxq->stats.packets;
-			stats->q_ibytes[i] = rxq->stats.bytes;
+			stats->q_ipackets[i] += rxq->stats.packets;
+			stats->q_ibytes[i] += rxq->stats.bytes;
 		}
 	}
 
-	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
+	stats->rx_nombuf += dev->data->rx_mbuf_alloc_failed;
 	return 0;
 }
Quoted 4 lines
Quoted 2 lines

--
2.34.1

Quoted 6 lines

Hi Stephen,

Is it okay to merge this patch?

Thanks,
Long

Hi Stephen,

Ping again.

Let me know if you want me to rebase (but it seems it should be a straight apply) and send v2.

Thanks,

Long