Skip to contentSkip to conversation

dpdk: Enable GQ stats reporting

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dpdk: Enable GQ stats reporting

Read from shared region to retrieve imissed statistics for GQ.

Change-Id: I8123d70ec5019b12f368e67b858c382bb7812e5c

---
 dpdk/base/gve_adminq.h | 11 ++++++
 dpdk/gve_ethdev.c      | 84 ++++++++++++++++++++++++++++++++++++++++++
 dpdk/gve_ethdev.h      |  6 +++
 3 files changed, 101 insertions(+)
drivers/net/gve/base/gve_adminq.h +11 -0
index e30b184..f05362f 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 385dfc5..0e1bfec 100644
@@ -97,6 +97,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 {
@@ -284,6 +285,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