[v2,09/13] net/ionic: add flexible firmware xstat counters

Message ID 20240207021849.52988-10-andrew.boyer@amd.com (mailing list archive)
State Superseded, archived
Headers
Series None |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Boyer, Andrew Feb. 7, 2024, 2:18 a.m. UTC
  From: Brad Larson <bradley.larson@amd.com>

Assign 32 counters for flexible firmware events. These can be used as
per-port or per-queue counters in certain firmware configurations.
They are displayed as fw_flex_eventX in xstats.

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
Signed-off-by: Brad Larson <bradley.larson@amd.com>
---
 drivers/net/ionic/ionic_ethdev.c | 33 +++++++++++++++
 drivers/net/ionic/ionic_if.h     | 70 ++++++++++++++++----------------
 2 files changed, 68 insertions(+), 35 deletions(-)
  

Patch

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 327f6b9de5..7c55a26956 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -196,6 +196,39 @@  static const struct rte_ionic_xstats_name_off rte_ionic_xstats_strings[] = {
 			tx_desc_fetch_error)},
 	{"tx_desc_data_error", offsetof(struct ionic_lif_stats,
 			tx_desc_data_error)},
+	/* Flexible firmware events */
+	{"fw_flex_event1", offsetof(struct ionic_lif_stats, flex1)},
+	{"fw_flex_event2", offsetof(struct ionic_lif_stats, flex2)},
+	{"fw_flex_event3", offsetof(struct ionic_lif_stats, flex3)},
+	{"fw_flex_event4", offsetof(struct ionic_lif_stats, flex4)},
+	{"fw_flex_event5", offsetof(struct ionic_lif_stats, flex5)},
+	{"fw_flex_event6", offsetof(struct ionic_lif_stats, flex6)},
+	{"fw_flex_event7", offsetof(struct ionic_lif_stats, flex7)},
+	{"fw_flex_event8", offsetof(struct ionic_lif_stats, flex8)},
+	{"fw_flex_event9", offsetof(struct ionic_lif_stats, flex9)},
+	{"fw_flex_event10", offsetof(struct ionic_lif_stats, flex10)},
+	{"fw_flex_event11", offsetof(struct ionic_lif_stats, flex11)},
+	{"fw_flex_event12", offsetof(struct ionic_lif_stats, flex12)},
+	{"fw_flex_event13", offsetof(struct ionic_lif_stats, flex13)},
+	{"fw_flex_event14", offsetof(struct ionic_lif_stats, flex14)},
+	{"fw_flex_event15", offsetof(struct ionic_lif_stats, flex15)},
+	{"fw_flex_event16", offsetof(struct ionic_lif_stats, flex16)},
+	{"fw_flex_event17", offsetof(struct ionic_lif_stats, flex17)},
+	{"fw_flex_event18", offsetof(struct ionic_lif_stats, flex18)},
+	{"fw_flex_event19", offsetof(struct ionic_lif_stats, flex19)},
+	{"fw_flex_event20", offsetof(struct ionic_lif_stats, flex20)},
+	{"fw_flex_event21", offsetof(struct ionic_lif_stats, flex21)},
+	{"fw_flex_event22", offsetof(struct ionic_lif_stats, flex22)},
+	{"fw_flex_event23", offsetof(struct ionic_lif_stats, flex23)},
+	{"fw_flex_event24", offsetof(struct ionic_lif_stats, flex24)},
+	{"fw_flex_event25", offsetof(struct ionic_lif_stats, flex25)},
+	{"fw_flex_event26", offsetof(struct ionic_lif_stats, flex26)},
+	{"fw_flex_event27", offsetof(struct ionic_lif_stats, flex27)},
+	{"fw_flex_event28", offsetof(struct ionic_lif_stats, flex28)},
+	{"fw_flex_event29", offsetof(struct ionic_lif_stats, flex29)},
+	{"fw_flex_event30", offsetof(struct ionic_lif_stats, flex30)},
+	{"fw_flex_event31", offsetof(struct ionic_lif_stats, flex31)},
+	{"fw_flex_event32", offsetof(struct ionic_lif_stats, flex32)},
 };
 
 #define IONIC_NB_HW_STATS RTE_DIM(rte_ionic_xstats_strings)
diff --git a/drivers/net/ionic/ionic_if.h b/drivers/net/ionic/ionic_if.h
index 79aa196345..7ca604a7bb 100644
--- a/drivers/net/ionic/ionic_if.h
+++ b/drivers/net/ionic/ionic_if.h
@@ -2592,41 +2592,41 @@  struct ionic_lif_stats {
 	__le64 rsvd16;
 	__le64 rsvd17;
 
-	__le64 rsvd18;
-	__le64 rsvd19;
-	__le64 rsvd20;
-	__le64 rsvd21;
-	__le64 rsvd22;
-	__le64 rsvd23;
-	__le64 rsvd24;
-	__le64 rsvd25;
-
-	__le64 rsvd26;
-	__le64 rsvd27;
-	__le64 rsvd28;
-	__le64 rsvd29;
-	__le64 rsvd30;
-	__le64 rsvd31;
-	__le64 rsvd32;
-	__le64 rsvd33;
-
-	__le64 rsvd34;
-	__le64 rsvd35;
-	__le64 rsvd36;
-	__le64 rsvd37;
-	__le64 rsvd38;
-	__le64 rsvd39;
-	__le64 rsvd40;
-	__le64 rsvd41;
-
-	__le64 rsvd42;
-	__le64 rsvd43;
-	__le64 rsvd44;
-	__le64 rsvd45;
-	__le64 rsvd46;
-	__le64 rsvd47;
-	__le64 rsvd48;
-	__le64 rsvd49;
+	__le64 flex1;
+	__le64 flex2;
+	__le64 flex3;
+	__le64 flex4;
+	__le64 flex5;
+	__le64 flex6;
+	__le64 flex7;
+	__le64 flex8;
+
+	__le64 flex9;
+	__le64 flex10;
+	__le64 flex11;
+	__le64 flex12;
+	__le64 flex13;
+	__le64 flex14;
+	__le64 flex15;
+	__le64 flex16;
+
+	__le64 flex17;
+	__le64 flex18;
+	__le64 flex19;
+	__le64 flex20;
+	__le64 flex21;
+	__le64 flex22;
+	__le64 flex23;
+	__le64 flex24;
+
+	__le64 flex25;
+	__le64 flex26;
+	__le64 flex27;
+	__le64 flex28;
+	__le64 flex29;
+	__le64 flex30;
+	__le64 flex31;
+	__le64 flex32;
 
 	/* RDMA/ROCE REQ Error/Debugs (768 - 895) */
 	__le64 rdma_req_rx_pkt_seq_err;