From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 4A58042B9A;
	Thu, 25 May 2023 12:10:13 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id C36CA42D40;
	Thu, 25 May 2023 12:10:01 +0200 (CEST)
Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com
 [67.231.148.174])
 by mails.dpdk.org (Postfix) with ESMTP id DC7D940DDB
 for <dev@dpdk.org>; Thu, 25 May 2023 12:09:54 +0200 (CEST)
Received: from pps.filterd (m0045849.ppops.net [127.0.0.1])
 by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 34PA2UjK020269 for <dev@dpdk.org>; Thu, 25 May 2023 03:09:54 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;
 h=from : to : cc :
 subject : date : message-id : in-reply-to : references : mime-version :
 content-transfer-encoding : content-type; s=pfpt0220;
 bh=9t5F6QXl2+OkXJvfrO0FqCi0ioTbm2jGib5xFv65nWs=;
 b=EwSorMNJW2Y9R/Qq2mSC2YiNUhKZpeIHjUDQK9eQvOEFmcBof6+yXLJnZnRdLmHCgowQ
 HxtF5Sl1ZO3ks4pRZq59RZZv4RNvMnys20wgYom8/U+GUqOifM6PeM+QQ4xkQSxPZvGa
 F+RzMALzRaIpCISCW+dGwd7ulJ3BJagkVWU6E9K2XAPtrPa6zrok7XyFsS/QtaJpxadV
 KUnYWTGpbiTs/znOp49GhVKSeroCbLv6+g2E17/mgtsuzGka9Zs9NmRMAy6WYzuw4IoF
 XoKbaU7rq4ulaHtSn7XFNPH82FfhOSgubiHRWFZMz9PwFCrXUfbRWT0DNfTAfzWRUmu+ 6g== 
Received: from dc5-exch01.marvell.com ([199.233.59.181])
 by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3qt5jng0kq-7
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)
 for <dev@dpdk.org>; Thu, 25 May 2023 03:09:53 -0700
Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com
 (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;
 Thu, 25 May 2023 03:09:40 -0700
Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com
 (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend
 Transport; Thu, 25 May 2023 03:09:40 -0700
Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204])
 by maili.marvell.com (Postfix) with ESMTP id B468A5B6BA9;
 Thu, 25 May 2023 02:59:35 -0700 (PDT)
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: Nithin Kumar 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>, <dev@dpdk.org>
Subject: [PATCH v3 06/32] common/cnxk: dump SW SSO work count as xstat
Date: Thu, 25 May 2023 15:28:38 +0530
Message-ID: <20230525095904.3967080-6-ndabilpuram@marvell.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230525095904.3967080-1-ndabilpuram@marvell.com>
References: <20230411091144.1087887-1-ndabilpuram@marvell.com>
 <20230525095904.3967080-1-ndabilpuram@marvell.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Proofpoint-ORIG-GUID: fgHAzg1-QfyhMQ46Cj_-avrVqtk818Af
X-Proofpoint-GUID: fgHAzg1-QfyhMQ46Cj_-avrVqtk818Af
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26
 definitions=2023-05-25_06,2023-05-24_01,2023-05-22_02
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Dump SW SSO work count as xstat.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/roc_nix_inl_dev_irq.c |  1 +
 drivers/common/cnxk/roc_nix_inl_priv.h    |  1 +
 drivers/common/cnxk/roc_nix_stats.c       | 17 +++++++++++------
 drivers/common/cnxk/roc_nix_xstats.h      |  4 ++++
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix_inl_dev_irq.c b/drivers/common/cnxk/roc_nix_inl_dev_irq.c
index 445b440447..becd7907f2 100644
--- a/drivers/common/cnxk/roc_nix_inl_dev_irq.c
+++ b/drivers/common/cnxk/roc_nix_inl_dev_irq.c
@@ -41,6 +41,7 @@ nix_inl_sso_work_cb(struct nix_inl_dev *inl_dev)
 			goto again;
 	}
 
+	inl_dev->sso_work_cnt += cnt;
 	plt_atomic_thread_fence(__ATOMIC_ACQ_REL);
 }
 
diff --git a/drivers/common/cnxk/roc_nix_inl_priv.h b/drivers/common/cnxk/roc_nix_inl_priv.h
index 528d2db365..b0a8976c6b 100644
--- a/drivers/common/cnxk/roc_nix_inl_priv.h
+++ b/drivers/common/cnxk/roc_nix_inl_priv.h
@@ -57,6 +57,7 @@ struct nix_inl_dev {
 	bool is_nix1;
 	uint8_t spb_drop_pc;
 	uint8_t lpb_drop_pc;
+	uint64_t sso_work_cnt;
 
 	/* NIX/CPT data */
 	void *inb_sa_base;
diff --git a/drivers/common/cnxk/roc_nix_stats.c b/drivers/common/cnxk/roc_nix_stats.c
index 6b5803af84..ca0e8ccb4f 100644
--- a/drivers/common/cnxk/roc_nix_stats.c
+++ b/drivers/common/cnxk/roc_nix_stats.c
@@ -24,12 +24,7 @@
 int
 roc_nix_num_xstats_get(struct roc_nix *roc_nix)
 {
-	if (roc_nix_is_vf_or_sdp(roc_nix))
-		return CNXK_NIX_NUM_XSTATS_REG;
-	else if (roc_model_is_cn9k())
-		return CNXK_NIX_NUM_XSTATS_CGX;
-
-	return CNXK_NIX_NUM_XSTATS_RPM;
+	return roc_nix_xstats_names_get(roc_nix, NULL, 0);
 }
 
 int
@@ -360,6 +355,12 @@ roc_nix_xstats_get(struct roc_nix *roc_nix, struct roc_nix_xstat *xstats,
 				xstats[count].id = count;
 				count++;
 			}
+			for (i = 0; i < PLT_DIM(inl_sw_xstats); i++) {
+				if (!inl_sw_xstats[i].offset)
+					xstats[count].value = inl_dev->sso_work_cnt;
+				xstats[count].id = count;
+				count++;
+			}
 		}
 	}
 
@@ -475,6 +476,10 @@ roc_nix_xstats_names_get(struct roc_nix *roc_nix,
 						      inl_nix_rq_xstats, i);
 				count++;
 			}
+			for (i = 0; i < PLT_DIM(inl_sw_xstats); i++) {
+				NIX_XSTATS_NAME_PRINT(xstats_names, count, inl_sw_xstats, i);
+				count++;
+			}
 		}
 	}
 
diff --git a/drivers/common/cnxk/roc_nix_xstats.h b/drivers/common/cnxk/roc_nix_xstats.h
index 813fb7f578..11b8e1c0ff 100644
--- a/drivers/common/cnxk/roc_nix_xstats.h
+++ b/drivers/common/cnxk/roc_nix_xstats.h
@@ -206,6 +206,10 @@ static const struct cnxk_nix_xstats_name nix_tx_xstats_cgx[] = {
 	{"cgx_tx_pause_packets", CGX_TX_PAUSE_PKTS},
 };
 
+static const struct cnxk_nix_xstats_name inl_sw_xstats[] = {
+	{"inl_sso_work_cnt", 0},
+};
+
 #define CNXK_NIX_NUM_RX_XSTATS	   PLT_DIM(nix_rx_xstats)
 #define CNXK_NIX_NUM_TX_XSTATS	   PLT_DIM(nix_tx_xstats)
 #define CNXK_NIX_NUM_QUEUE_XSTATS  PLT_DIM(nix_q_xstats)
-- 
2.25.1