DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rahul Bhansali <rbhansali@marvell.com>
To: <dev@dpdk.org>, Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <jerinj@marvell.com>, Rahul Bhansali <rbhansali@marvell.com>
Subject: [PATCH] common/cnxk: adds cn10k specific xstats
Date: Wed, 23 Feb 2022 18:21:04 +0530	[thread overview]
Message-ID: <20220223125104.254210-1-rbhansali@marvell.com> (raw)

This adds cn10k specific rx xstats of bpf, cpt and
ipsecd counters.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/common/cnxk/hw/nix.h         |  1 +
 drivers/common/cnxk/roc_nix_stats.c  | 14 ++++++++++++++
 drivers/common/cnxk/roc_nix_xstats.h | 20 +++++++++++++++++++-
 3 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/hw/nix.h b/drivers/common/cnxk/hw/nix.h
index 6931f1d1d2..1cc0c8dfb8 100644
--- a/drivers/common/cnxk/hw/nix.h
+++ b/drivers/common/cnxk/hw/nix.h
@@ -419,6 +419,7 @@
 #define NIX_STAT_LF_RX_RX_RC_OCTS_DROP	 (0x16ull) /* [CN10K, .) */
 #define NIX_STAT_LF_RX_RX_RC_PKTS_DROP	 (0x17ull) /* [CN10K, .) */
 #define NIX_STAT_LF_RX_RX_CPT_DROP_PKTS	 (0x18ull) /* [CN10K, .) */
+#define NIX_STAT_LF_RX_RX_IPSECD_DROP_PKTS (0x19ull) /* [CN10K, .) */
 
 #define CGX_RX_PKT_CNT		 (0x0ull) /* [CN9K, CN10K) */
 #define CGX_RX_OCT_CNT		 (0x1ull) /* [CN9K, CN10K) */
diff --git a/drivers/common/cnxk/roc_nix_stats.c b/drivers/common/cnxk/roc_nix_stats.c
index 756111fb1c..946cda114d 100644
--- a/drivers/common/cnxk/roc_nix_stats.c
+++ b/drivers/common/cnxk/roc_nix_stats.c
@@ -353,6 +353,13 @@ roc_nix_xstats_get(struct roc_nix *roc_nix, struct roc_nix_xstat *xstats,
 			xstats[count].id = count;
 			count++;
 		}
+
+		for (i = 0; i < CNXK_NIX_NUM_CN10K_RX_XSTATS; i++) {
+			xstats[count].value =
+				NIX_RX_STATS(nix_cn10k_rx_xstats[i].offset);
+			xstats[count].id = count;
+			count++;
+		}
 	}
 
 	return count;
@@ -422,6 +429,13 @@ roc_nix_xstats_names_get(struct roc_nix *roc_nix,
 					 nix_tx_xstats_rpm[i].name);
 				count++;
 			}
+
+			for (i = 0; i < CNXK_NIX_NUM_CN10K_RX_XSTATS; i++) {
+				snprintf(xstats_names[count].name,
+					 sizeof(xstats_names[count].name), "%s",
+					 nix_cn10k_rx_xstats[i].name);
+				count++;
+			}
 		}
 	}
 
diff --git a/drivers/common/cnxk/roc_nix_xstats.h b/drivers/common/cnxk/roc_nix_xstats.h
index b0eaab78e7..c0a6f693f2 100644
--- a/drivers/common/cnxk/roc_nix_xstats.h
+++ b/drivers/common/cnxk/roc_nix_xstats.h
@@ -34,6 +34,23 @@ static const struct cnxk_nix_xstats_name nix_rx_xstats[] = {
 	{"rx_drp_l3mcast", NIX_STAT_LF_RX_RX_DRP_L3MCAST},
 };
 
+static const struct cnxk_nix_xstats_name nix_cn10k_rx_xstats[] = {
+	{"rx_gc_octs_pass", NIX_STAT_LF_RX_RX_GC_OCTS_PASSED},
+	{"rx_gc_pkts_pass", NIX_STAT_LF_RX_RX_GC_PKTS_PASSED},
+	{"rx_yc_octs_pass", NIX_STAT_LF_RX_RX_YC_OCTS_PASSED},
+	{"rx_yc_pkts_pass", NIX_STAT_LF_RX_RX_YC_PKTS_PASSED},
+	{"rx_rc_octs_pass", NIX_STAT_LF_RX_RX_RC_OCTS_PASSED},
+	{"rx_rc_pkts_pass", NIX_STAT_LF_RX_RX_RC_PKTS_PASSED},
+	{"rx_gc_octs_drop", NIX_STAT_LF_RX_RX_GC_OCTS_DROP},
+	{"rx_gc_pkts_drop", NIX_STAT_LF_RX_RX_GC_PKTS_DROP},
+	{"rx_yc_octs_drop", NIX_STAT_LF_RX_RX_YC_OCTS_DROP},
+	{"rx_yc_pkts_drop", NIX_STAT_LF_RX_RX_YC_PKTS_DROP},
+	{"rx_rc_octs_drop", NIX_STAT_LF_RX_RX_RC_OCTS_DROP},
+	{"rx_rc_pkts_drop", NIX_STAT_LF_RX_RX_RC_PKTS_DROP},
+	{"rx_cpt_pkts_drop", NIX_STAT_LF_RX_RX_CPT_DROP_PKTS},
+	{"rx_ipsecd_pkts_drop", NIX_STAT_LF_RX_RX_IPSECD_DROP_PKTS},
+};
+
 static const struct cnxk_nix_xstats_name nix_q_xstats[] = {
 	{"rq_op_re_pkts", NIX_LF_RQ_OP_RE_PKTS},
 };
@@ -173,6 +190,7 @@ static const struct cnxk_nix_xstats_name nix_tx_xstats_cgx[] = {
 #define CNXK_NIX_NUM_TX_XSTATS_CGX PLT_DIM(nix_tx_xstats_cgx)
 #define CNXK_NIX_NUM_RX_XSTATS_RPM PLT_DIM(nix_rx_xstats_rpm)
 #define CNXK_NIX_NUM_TX_XSTATS_RPM PLT_DIM(nix_tx_xstats_rpm)
+#define CNXK_NIX_NUM_CN10K_RX_XSTATS PLT_DIM(nix_cn10k_rx_xstats)
 
 #define CNXK_NIX_NUM_XSTATS_REG                                                \
 	(CNXK_NIX_NUM_RX_XSTATS + CNXK_NIX_NUM_TX_XSTATS +                     \
@@ -182,7 +200,7 @@ static const struct cnxk_nix_xstats_name nix_tx_xstats_cgx[] = {
 	 CNXK_NIX_NUM_TX_XSTATS_CGX)
 #define CNXK_NIX_NUM_XSTATS_RPM                                                \
 	(CNXK_NIX_NUM_XSTATS_REG + CNXK_NIX_NUM_RX_XSTATS_RPM +                \
-	 CNXK_NIX_NUM_TX_XSTATS_RPM)
+	 CNXK_NIX_NUM_TX_XSTATS_RPM + CNXK_NIX_NUM_CN10K_RX_XSTATS)
 
 static inline uint64_t
 roc_nix_num_rx_xstats(void)
-- 
2.25.1


             reply	other threads:[~2022-02-23 12:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 12:51 Rahul Bhansali [this message]
2022-02-24  4:18 ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220223125104.254210-1-rbhansali@marvell.com \
    --to=rbhansali@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).