Skip to contentSkip to conversation

net/ixgbe: support per-queue stats for fewer queues

PATCH Applied Morten Brørup 3 participants 4 messages Oct 24, 2024 – Oct 25, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net/ixgbe: support per-queue stats for fewer queues

Remove the requirement that the configured number of queues to provide statistics for (RTE_ETHDEV_QUEUE_STAT_CNTRS) cannot be less than the driver's max supported number of the same (IXGBE_QUEUE_STAT_COUNTERS).

---
v2:
* Fix subject. (Bruce Richardson)
* Simplify type cast. (Bruce Richardson, Stephen Hemminger)

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -1
index ab37c37469..09d648af6d 100644
@@ -3385,7 +3385,8 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	stats->opackets = hw_stats->gptc;
 	stats->obytes = hw_stats->gotc;
 
-	for (i = 0; i < IXGBE_QUEUE_STAT_COUNTERS; i++) {
+	for (i = 0; i < RTE_MIN_T(IXGBE_QUEUE_STAT_COUNTERS,
+			RTE_ETHDEV_QUEUE_STAT_CNTRS, typeof(i)); i++) {
 		stats->q_ipackets[i] = hw_stats->qprc[i];
 		stats->q_opackets[i] = hw_stats->qptc[i];
 		stats->q_ibytes[i] = hw_stats->qbrc[i];
Signature · 1 line
2.43.0
author Acked-by Bruce Richardson on v2 1/1
#1 lore raw
Quoted 8 lines

From: Morten Brørup [mailto:[email protected]]
Sent: Thursday, 24 October 2024 20.54

Remove the requirement that the configured number of queues to provide statistics for (RTE_ETHDEV_QUEUE_STAT_CNTRS) cannot be less than the driver's max supported number of the same (IXGBE_QUEUE_STAT_COUNTERS).

Forgot the

And the
--in-reply-to [email protected]

Quoted 26 lines

---
v2:
* Fix subject. (Bruce Richardson)
* Simplify type cast. (Bruce Richardson, Stephen Hemminger)

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -1
index ab37c37469..09d648af6d 100644
@@ -3385,7 +3385,8 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev,
 struct rte_eth_stats *stats)
 	stats->opackets = hw_stats->gptc;
 	stats->obytes = hw_stats->gotc;
 
-	for (i = 0; i < IXGBE_QUEUE_STAT_COUNTERS; i++) {
+	for (i = 0; i < RTE_MIN_T(IXGBE_QUEUE_STAT_COUNTERS,
+			RTE_ETHDEV_QUEUE_STAT_CNTRS, typeof(i)); i++) {
 		stats->q_ipackets[i] = hw_stats->qprc[i];
 		stats->q_opackets[i] = hw_stats->qptc[i];

stats->q_ibytes[i] = hw_stats->qbrc[i];
--
2.43.0

#3 lore raw
Quoted 11 lines · Stephen Hemminger
Quoted 5 lines · On Thu, 24 Oct 2024 18:53:52 +0000 Morten Brørup <[email protected]>…

Remove the requirement that the configured number of queues to provide statistics for (RTE_ETHDEV_QUEUE_STAT_CNTRS) cannot be less than the driver's max supported number of the same (IXGBE_QUEUE_STAT_COUNTERS).

Applied to dpdk-next-net-intel.

Thanks,
/Bruce