DPDK patches and discussions
 help / color / mirror / Atom feed
From: <psatheesh@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>, Satheesh Paul <psatheesh@marvell.com>
Subject: [dpdk-dev] [PATCH] common/cnxk: add ROC API to get MKEX capability
Date: Wed, 8 Nov 2023 09:03:12 +0530	[thread overview]
Message-ID: <20231108033312.1419051-1-psatheesh@marvell.com> (raw)

From: Satheesh Paul <psatheesh@marvell.com>

Added ROC API to get MKEX capability.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
---
 drivers/common/cnxk/roc_npc.c   | 24 ++++++++++++++++++++++++
 drivers/common/cnxk/roc_npc.h   |  1 +
 drivers/common/cnxk/version.map |  1 +
 3 files changed, 26 insertions(+)

diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index a0d88c0743..1958b3089d 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -235,6 +235,30 @@ roc_npc_profile_name_get(struct roc_npc *roc_npc)
 	return (char *)npc->profile_name;
 }
 
+int
+roc_npc_kex_capa_get(struct roc_nix *roc_nix, uint64_t *kex_capability)
+{
+	struct nix *nix = roc_nix_to_nix_priv(roc_nix);
+	struct npc npc;
+	int rc = 0;
+
+	memset(&npc, 0, sizeof(npc));
+
+	npc.mbox = (&nix->dev)->mbox;
+
+	rc = npc_mcam_fetch_kex_cfg(&npc);
+	if (rc)
+		return rc;
+
+	rc = npc_mcam_fetch_hw_cap(&npc, &npc.hash_extract_cap);
+	if (rc)
+		return rc;
+
+	*kex_capability = npc_get_kex_capability(&npc);
+
+	return 0;
+}
+
 int
 roc_npc_init(struct roc_npc *roc_npc)
 {
diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h
index b71ddd1578..459fa33de9 100644
--- a/drivers/common/cnxk/roc_npc.h
+++ b/drivers/common/cnxk/roc_npc.h
@@ -399,6 +399,7 @@ struct roc_npc {
 int __roc_api roc_npc_init(struct roc_npc *roc_npc);
 int __roc_api roc_npc_fini(struct roc_npc *roc_npc);
 const char *__roc_api roc_npc_profile_name_get(struct roc_npc *roc_npc);
+int __roc_api roc_npc_kex_capa_get(struct roc_nix *roc_nix, uint64_t *kex_capability);
 
 struct roc_npc_flow *__roc_api roc_npc_flow_create(struct roc_npc *roc_npc,
 						   const struct roc_npc_attr *attr,
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index aa884a8fe2..1c7c65c51a 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -438,6 +438,7 @@ INTERNAL {
 	roc_npc_flow_parse;
 	roc_npc_get_low_priority_mcam;
 	roc_npc_init;
+	roc_npc_kex_capa_get;
 	roc_npc_mark_actions_get;
 	roc_npc_mark_actions_sub_return;
 	roc_npc_vtag_actions_get;
-- 
2.39.2


             reply	other threads:[~2023-11-08  3:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08  3:33 psatheesh [this message]
2023-12-05  9:54 ` 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=20231108033312.1419051-1-psatheesh@marvell.com \
    --to=psatheesh@marvell.com \
    --cc=dev@dpdk.org \
    --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).