Skip to contentSkip to conversation

net/gve: Enable stats reporting for GQ format

PATCH New Rushil Gupta 1 participant 1 message Dec 19, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/gve: Enable stats reporting for GQ format

Read from shared region to retrieve imissed statistics for GQ. Tested using show port xstats <port-id> in interactive mode. This metric can be triggered by using queues > cores.

---
 drivers/net/gve/base/gve_adminq.h | 11 ++++
 drivers/net/gve/gve_ethdev.c      | 84 +++++++++++++++++++++++++++++++
 drivers/net/gve/gve_ethdev.h      |  6 +++
 3 files changed, 101 insertions(+)
drivers/net/gve/base/gve_adminq.h +11 -0
index e30b184913..f05362f85f 100644
@@ -314,6 +314,17 @@ struct gve_stats_report {
 
 GVE_CHECK_STRUCT_LEN(8, gve_stats_report);
 
+/* Numbers of gve tx/rx stats in stats report. */
+#define GVE_TX_STATS_REPORT_NUM        6
+#define GVE_RX_STATS_REPORT_NUM        2
+
+/* Interval to schedule a stats report update, 20000ms. */
+#define GVE_STATS_REPORT_TIMER_PERIOD  20000
+
+/* Numbers of NIC tx/rx stats in stats report. */
+#define NIC_TX_STATS_REPORT_NUM        0
+#define NIC_RX_STATS_REPORT_NUM        4
+
 enum gve_stat_names {
 	/* stats from gve */
 	TX_WAKE_CNT			= 1,
drivers/net/gve/gve_ethdev.c +84 -0

126 lines not on this page · raw message

drivers/net/gve/gve_ethdev.h +6 -0
index 58d8943e71..9893fcfee6 100644
@@ -85,6 +85,7 @@ struct gve_rx_stats {
 	uint64_t errors;
 	uint64_t no_mbufs;
 	uint64_t no_mbufs_bulk;
+	uint64_t imissed;
 };
 
 struct gve_xstats_name_offset {
@@ -272,6 +273,11 @@ struct gve_priv {
 
 	struct gve_tx_queue **txqs;
 	struct gve_rx_queue **rxqs;
+
+	uint32_t stats_report_len;
+	const struct rte_memzone *stats_report_mem;
+	uint16_t stats_start_idx; /* start index of array of stats written by NIC */
+	uint16_t stats_end_idx; /* end index of array of stats written by NIC */
 };
 
 static inline bool
Signature · 1 line
2.43.0.472.g3155946c3a-goog