DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/gve: add Rx/Tx queue statistics
@ 2023-02-19  0:31 Levend Sayar
  2023-02-19 20:15 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Levend Sayar @ 2023-02-19  0:31 UTC (permalink / raw)
  To: junfeng.guo; +Cc: dev, Levend Sayar

Google Virtual NIC PMD is enriched with rx/tx queue statistics info.

Signed-off-by: Levend Sayar <levendsayar@gmail.com>
---
 drivers/net/gve/gve_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index fef2458a16..2a6cb11da3 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -213,6 +213,7 @@ gve_dev_start(struct rte_eth_dev *dev)
 		}
 	}
 
+	dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
 	dev->data->dev_started = 1;
 	gve_link_update(dev, 0);
 
@@ -331,6 +332,9 @@ gve_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		stats->opackets += txq->packets;
 		stats->obytes += txq->bytes;
 		stats->oerrors += txq->errors;
+
+		stats->q_opackets[i] = txq->packets;
+		stats->q_obytes[i] = txq->bytes;
 	}
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
@@ -342,6 +346,10 @@ gve_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		stats->ibytes += rxq->bytes;
 		stats->ierrors += rxq->errors;
 		stats->rx_nombuf += rxq->no_mbufs;
+
+		stats->q_ipackets[i] = rxq->packets;
+		stats->q_ibytes[i] = rxq->bytes;
+		stats->q_errors[i] = rxq->errors;
 	}
 
 	return 0;
-- 
2.37.1 (Apple Git-137.1)


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

end of thread, other threads:[~2023-02-19 20:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-19  0:31 [PATCH] net/gve: add Rx/Tx queue statistics Levend Sayar
2023-02-19 20:15 ` Ferruh Yigit

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).