DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harman Kalra <hkalra@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>,
	Harman Kalra <hkalra@marvell.com>
Cc: <dev@dpdk.org>
Subject: [PATCH v5 06/23] common/cnxk: common NPC changes for eswitch
Date: Sat, 2 Mar 2024 00:44:33 +0530	[thread overview]
Message-ID: <20240301191451.57168-7-hkalra@marvell.com> (raw)
In-Reply-To: <20240301191451.57168-1-hkalra@marvell.com>

Adding new MCAM API for installing flow using generic npc_install_flow
mbox and other helper APIs. Also adding rss action configuration for
eswitch.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/meson.build    |   1 +
 drivers/common/cnxk/roc_api.h      |   3 +
 drivers/common/cnxk/roc_eswitch.c  | 306 +++++++++++++++++++++++++++++
 drivers/common/cnxk/roc_eswitch.h  |  22 +++
 drivers/common/cnxk/roc_mbox.h     |  33 ++++
 drivers/common/cnxk/roc_npc.c      |  26 ++-
 drivers/common/cnxk/roc_npc.h      |   5 +-
 drivers/common/cnxk/roc_npc_mcam.c |   2 +-
 drivers/common/cnxk/roc_npc_priv.h |   3 +-
 drivers/common/cnxk/version.map    |   6 +
 10 files changed, 398 insertions(+), 9 deletions(-)
 create mode 100644 drivers/common/cnxk/roc_eswitch.c
 create mode 100644 drivers/common/cnxk/roc_eswitch.h

diff --git a/drivers/common/cnxk/meson.build b/drivers/common/cnxk/meson.build
index 56eea52909..e0e4600989 100644
--- a/drivers/common/cnxk/meson.build
+++ b/drivers/common/cnxk/meson.build
@@ -20,6 +20,7 @@ sources = files(
         'roc_cpt_debug.c',
         'roc_dev.c',
         'roc_dpi.c',
+        'roc_eswitch.c',
         'roc_hash.c',
         'roc_idev.c',
         'roc_irq.c',
diff --git a/drivers/common/cnxk/roc_api.h b/drivers/common/cnxk/roc_api.h
index f630853088..6a86863c57 100644
--- a/drivers/common/cnxk/roc_api.h
+++ b/drivers/common/cnxk/roc_api.h
@@ -117,4 +117,7 @@
 /* MACsec */
 #include "roc_mcs.h"
 
+/* Eswitch */
+#include "roc_eswitch.h"
+
 #endif /* _ROC_API_H_ */
diff --git a/drivers/common/cnxk/roc_eswitch.c b/drivers/common/cnxk/roc_eswitch.c
new file mode 100644
index 0000000000..e480ab1046
--- /dev/null
+++ b/drivers/common/cnxk/roc_eswitch.c
@@ -0,0 +1,306 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2024 Marvell.
+ */
+
+#include <arpa/inet.h>
+
+#include "roc_api.h"
+#include "roc_priv.h"
+
+static int
+eswitch_vlan_rx_cfg(uint16_t pcifunc, struct mbox *mbox)
+{
+	struct nix_vtag_config *vtag_cfg;
+	int rc;
+
+	vtag_cfg = mbox_alloc_msg_nix_vtag_cfg(mbox_get(mbox));
+	if (!vtag_cfg) {
+		rc = -EINVAL;
+		goto exit;
+	}
+
+	/* config strip, capture and size */
+	vtag_cfg->hdr.pcifunc = pcifunc;
+	vtag_cfg->vtag_size = NIX_VTAGSIZE_T4;
+	vtag_cfg->cfg_type = VTAG_RX; /* rx vlan cfg */
+	vtag_cfg->rx.vtag_type = NIX_RX_VTAG_TYPE0;
+	vtag_cfg->rx.strip_vtag = true;
+	vtag_cfg->rx.capture_vtag = true;
+
+	rc = mbox_process(mbox);
+	if (rc)
+		goto exit;
+
+	rc = 0;
+exit:
+	mbox_put(mbox);
+	return rc;
+}
+
+static int
+eswitch_vlan_tx_cfg(struct roc_npc_flow *flow, uint16_t pcifunc, struct mbox *mbox,
+		    uint16_t vlan_tci, uint16_t *vidx)
+{
+	struct nix_vtag_config *vtag_cfg;
+	struct nix_vtag_config_rsp *rsp;
+	int rc;
+
+	union {
+		uint64_t reg;
+		struct nix_tx_vtag_action_s act;
+	} tx_vtag_action;
+
+	vtag_cfg = mbox_alloc_msg_nix_vtag_cfg(mbox_get(mbox));
+	if (!vtag_cfg) {
+		rc = -EINVAL;
+		goto exit;
+	}
+
+	/* Insert vlan tag */
+	vtag_cfg->hdr.pcifunc = pcifunc;
+	vtag_cfg->vtag_size = NIX_VTAGSIZE_T4;
+	vtag_cfg->cfg_type = VTAG_TX; /* tx vlan cfg */
+	vtag_cfg->tx.cfg_vtag0 = true;
+	vtag_cfg->tx.vtag0 = (((uint32_t)ROC_ESWITCH_VLAN_TPID << 16) | vlan_tci);
+
+	rc = mbox_process_msg(mbox, (void *)&rsp);
+	if (rc)
+		goto exit;
+
+	if (rsp->vtag0_idx < 0) {
+		plt_err("Failed to config TX VTAG action");
+		rc = -EINVAL;
+		goto exit;
+	}
+
+	*vidx = rsp->vtag0_idx;
+	tx_vtag_action.reg = 0;
+	tx_vtag_action.act.vtag0_def = rsp->vtag0_idx;
+	tx_vtag_action.act.vtag0_lid = NPC_LID_LA;
+	tx_vtag_action.act.vtag0_op = NIX_TX_VTAGOP_INSERT;
+	tx_vtag_action.act.vtag0_relptr = NIX_TX_VTAGACTION_VTAG0_RELPTR;
+
+	flow->vtag_action = tx_vtag_action.reg;
+
+	rc = 0;
+exit:
+	mbox_put(mbox);
+	return rc;
+}
+
+int
+roc_eswitch_npc_mcam_tx_rule(struct roc_npc *roc_npc, struct roc_npc_flow *flow, uint16_t pcifunc,
+			     uint32_t vlan_tci)
+{
+	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
+	struct npc_install_flow_req *req;
+	struct npc_install_flow_rsp *rsp;
+	struct mbox *mbox = npc->mbox;
+	uint16_t vidx = 0, lbkid;
+	int rc;
+
+	rc = eswitch_vlan_tx_cfg(flow, roc_npc->pf_func, mbox, vlan_tci, &vidx);
+	if (rc) {
+		plt_err("Failed to configure VLAN TX, err %d", rc);
+		goto fail;
+	}
+
+	req = mbox_alloc_msg_npc_install_flow(mbox_get(mbox));
+	if (!req) {
+		rc = -EINVAL;
+		goto exit;
+	}
+
+	lbkid = 0;
+	req->hdr.pcifunc = roc_npc->pf_func; /* Eswitch PF is requester */
+	req->vf = pcifunc;
+	req->entry = flow->mcam_id;
+	req->intf = NPC_MCAM_TX;
+	req->op = NIX_TX_ACTIONOP_UCAST_CHAN;
+	req->index = (lbkid << 8) | ROC_ESWITCH_LBK_CHAN;
+	req->set_cntr = 1;
+	req->vtag0_def = vidx;
+	req->vtag0_op = 1;
+	rc = mbox_process_msg(mbox, (void *)&rsp);
+	if (rc)
+		goto exit;
+
+	flow->nix_intf = NIX_INTF_TX;
+exit:
+	mbox_put(mbox);
+fail:
+	return rc;
+}
+
+static int
+eswitch_vtag_cfg_delete(struct roc_npc *roc_npc, struct roc_npc_flow *flow)
+{
+	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
+	struct nix_vtag_config *vtag_cfg;
+	struct nix_vtag_config_rsp *rsp;
+	struct mbox *mbox = npc->mbox;
+	int rc = 0;
+
+	union {
+		uint64_t reg;
+		struct nix_tx_vtag_action_s act;
+	} tx_vtag_action;
+
+	tx_vtag_action.reg = flow->vtag_action;
+	vtag_cfg = mbox_alloc_msg_nix_vtag_cfg(mbox_get(mbox));
+
+	if (vtag_cfg == NULL) {
+		rc = -ENOSPC;
+		goto exit;
+	}
+
+	vtag_cfg->cfg_type = VTAG_TX;
+	vtag_cfg->vtag_size = NIX_VTAGSIZE_T4;
+	vtag_cfg->tx.vtag0_idx = tx_vtag_action.act.vtag0_def;
+	vtag_cfg->tx.free_vtag0 = true;
+
+	rc = mbox_process_msg(mbox, (void *)&rsp);
+	if (rc)
+		goto exit;
+
+	rc = rsp->hdr.rc;
+exit:
+	mbox_put(mbox);
+	return rc;
+}
+
+int
+roc_eswitch_npc_mcam_delete_rule(struct roc_npc *roc_npc, struct roc_npc_flow *flow,
+				 uint16_t pcifunc)
+{
+	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
+	struct npc_delete_flow_req *req;
+	struct msg_rsp *rsp;
+	struct mbox *mbox = npc->mbox;
+	int rc = 0;
+
+	/* Removing the VLAN TX config */
+	if (flow->nix_intf == NIX_INTF_TX) {
+		rc = eswitch_vtag_cfg_delete(roc_npc, flow);
+		if (rc)
+			plt_err("Failed to delete TX vtag config");
+	}
+
+	req = mbox_alloc_msg_npc_delete_flow(mbox_get(mbox));
+	if (!req) {
+		rc = -EINVAL;
+		goto exit;
+	}
+
+	req->entry = flow->mcam_id;
+	req->vf = pcifunc;
+	rc = mbox_process_msg(mbox, (void *)&rsp);
+	if (rc)
+		goto exit;
+
+	rc = rsp->hdr.rc;
+exit:
+	mbox_put(mbox);
+	return rc;
+}
+
+int
+roc_eswitch_npc_mcam_rx_rule(struct roc_npc *roc_npc, struct roc_npc_flow *flow, uint16_t pcifunc,
+			     uint16_t vlan_tci, uint16_t vlan_tci_mask)
+{
+	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
+	struct npc_install_flow_req *req;
+	struct npc_install_flow_rsp *rsp;
+	struct mbox *mbox = npc->mbox;
+	bool is_esw_dev;
+	int rc;
+
+	/* For ESW PF/VF */
+	is_esw_dev = (dev_get_pf(roc_npc->pf_func) == dev_get_pf(pcifunc));
+	/* VLAN Rx config */
+	if (is_esw_dev) {
+		rc = eswitch_vlan_rx_cfg(roc_npc->pf_func, mbox);
+		if (rc) {
+			plt_err("Failed to configure VLAN RX rule, err %d", rc);
+			goto fail;
+		}
+	}
+
+	req = mbox_alloc_msg_npc_install_flow(mbox_get(mbox));
+	if (!req) {
+		rc = -EINVAL;
+		goto exit;
+	}
+
+	req->vf = pcifunc;
+	/* Action */
+	req->op = NIX_RX_ACTIONOP_DEFAULT;
+	req->index = 0;
+	req->entry = flow->mcam_id;
+	req->hdr.pcifunc = roc_npc->pf_func; /* Eswitch PF is requester */
+	req->features = BIT_ULL(NPC_OUTER_VID) | BIT_ULL(NPC_VLAN_ETYPE_CTAG);
+	req->vtag0_valid = true;
+	/* For ESW PF/VF using configured vlan rx cfg while for other
+	 * representees using standard vlan_type = 7 which is strip.
+	 */
+	req->vtag0_type = is_esw_dev ? NIX_RX_VTAG_TYPE0 : NIX_RX_VTAG_TYPE7;
+	req->packet.vlan_etype = ROC_ESWITCH_VLAN_TPID;
+	req->mask.vlan_etype = 0xFFFF;
+	req->packet.vlan_tci = ntohs(vlan_tci & 0xFFFF);
+	req->mask.vlan_tci = ntohs(vlan_tci_mask);
+
+	req->channel = ROC_ESWITCH_LBK_CHAN;
+	req->chan_mask = 0xffff;
+	req->intf = NPC_MCAM_RX;
+	req->set_cntr = 1;
+	req->cntr_val = flow->ctr_id;
+
+	rc = mbox_process_msg(mbox, (void *)&rsp);
+	if (rc)
+		goto exit;
+
+	flow->nix_intf = NIX_INTF_RX;
+exit:
+	mbox_put(mbox);
+fail:
+	return rc;
+}
+
+int
+roc_eswitch_npc_rss_action_configure(struct roc_npc *roc_npc, struct roc_npc_flow *flow,
+				     uint32_t flowkey_cfg, uint16_t *reta_tbl)
+{
+	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
+	struct roc_nix *roc_nix = roc_npc->roc_nix;
+	uint32_t rss_grp_idx;
+	uint8_t flowkey_algx;
+	int rc;
+
+	rc = npc_rss_free_grp_get(npc, &rss_grp_idx);
+	/* RSS group :0 is not usable for flow rss action */
+	if (rc < 0 || rss_grp_idx == 0)
+		return -ENOSPC;
+
+	/* Populating reta table for the specific RSS group */
+	rc = roc_nix_rss_reta_set(roc_nix, rss_grp_idx, reta_tbl);
+	if (rc) {
+		plt_err("Failed to init rss table rc = %d", rc);
+		return rc;
+	}
+
+	rc = roc_nix_rss_flowkey_set(roc_nix, &flowkey_algx, flowkey_cfg, rss_grp_idx,
+				     flow->mcam_id);
+	if (rc) {
+		plt_err("Failed to set rss hash function rc = %d", rc);
+		return rc;
+	}
+
+	plt_bitmap_set(npc->rss_grp_entries, rss_grp_idx);
+
+	flow->npc_action &= (~(0xfULL));
+	flow->npc_action |= NIX_RX_ACTIONOP_RSS;
+	flow->npc_action |=
+		((uint64_t)(flowkey_algx & NPC_RSS_ACT_ALG_MASK) << NPC_RSS_ACT_ALG_OFFSET) |
+		((uint64_t)(rss_grp_idx & NPC_RSS_ACT_GRP_MASK) << NPC_RSS_ACT_GRP_OFFSET);
+	return 0;
+}
diff --git a/drivers/common/cnxk/roc_eswitch.h b/drivers/common/cnxk/roc_eswitch.h
new file mode 100644
index 0000000000..cdbe808a71
--- /dev/null
+++ b/drivers/common/cnxk/roc_eswitch.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2024 Marvell.
+ */
+
+#ifndef __ROC_ESWITCH_H__
+#define __ROC_ESWITCH_H__
+
+#define ROC_ESWITCH_VLAN_TPID 0x8100
+#define ROC_ESWITCH_LBK_CHAN  63
+
+/* NPC */
+int __roc_api roc_eswitch_npc_mcam_rx_rule(struct roc_npc *roc_npc, struct roc_npc_flow *flow,
+					   uint16_t pcifunc, uint16_t vlan_tci,
+					   uint16_t vlan_tci_mask);
+int __roc_api roc_eswitch_npc_mcam_tx_rule(struct roc_npc *roc_npc, struct roc_npc_flow *flow,
+					   uint16_t pcifunc, uint32_t vlan_tci);
+int __roc_api roc_eswitch_npc_mcam_delete_rule(struct roc_npc *roc_npc, struct roc_npc_flow *flow,
+					       uint16_t pcifunc);
+int __roc_api roc_eswitch_npc_rss_action_configure(struct roc_npc *roc_npc,
+						   struct roc_npc_flow *flow, uint32_t flowkey_cfg,
+						   uint16_t *reta_tbl);
+#endif /* __ROC_ESWITCH_H__ */
diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h
index 54956a6a06..b76e97e9f9 100644
--- a/drivers/common/cnxk/roc_mbox.h
+++ b/drivers/common/cnxk/roc_mbox.h
@@ -388,6 +388,18 @@ enum rvu_af_status {
 	RVU_INVALID_VF_ID = -256,
 };
 
+/* For NIX RX vtag action  */
+enum nix_rx_vtag0_type {
+	NIX_RX_VTAG_TYPE0,
+	NIX_RX_VTAG_TYPE1,
+	NIX_RX_VTAG_TYPE2,
+	NIX_RX_VTAG_TYPE3,
+	NIX_RX_VTAG_TYPE4,
+	NIX_RX_VTAG_TYPE5,
+	NIX_RX_VTAG_TYPE6,
+	NIX_RX_VTAG_TYPE7,
+};
+
 struct ready_msg_rsp {
 	struct mbox_msghdr hdr;
 	uint16_t __io sclk_freq; /* SCLK frequency */
@@ -2446,6 +2458,8 @@ enum header_fields {
 	NPC_DMAC,
 	NPC_SMAC,
 	NPC_ETYPE,
+	NPC_VLAN_ETYPE_CTAG, /* 0x8100 */
+	NPC_VLAN_ETYPE_STAG, /* 0x88A8 */
 	NPC_OUTER_VID,
 	NPC_TOS,
 	NPC_SIP_IPV4,
@@ -2474,12 +2488,27 @@ struct flow_msg {
 		uint32_t __io ip4dst;
 		uint32_t __io ip6dst[4];
 	};
+	union {
+		uint32_t spi;
+	};
 	uint8_t __io tos;
 	uint8_t __io ip_ver;
 	uint8_t __io ip_proto;
 	uint8_t __io tc;
 	uint16_t __io sport;
 	uint16_t __io dport;
+	union {
+		uint8_t __io ip_flag;
+		uint8_t __io next_header;
+	};
+	uint16_t __io vlan_itci;
+	uint8_t __io icmp_type;
+	uint8_t __io icmp_code;
+	uint16_t __io tcp_flags;
+	uint32_t __io gtpu_teid;
+	uint32_t __io gtpc_teid;
+	uint32_t __io mpls_lse[4];
+	uint16_t __io sq_id;
 };
 
 struct npc_install_flow_req {
@@ -2489,6 +2518,7 @@ struct npc_install_flow_req {
 	uint64_t __io features;
 	uint16_t __io entry;
 	uint16_t __io channel;
+	uint16_t __io chan_mask;
 	uint8_t __io intf;
 	uint8_t __io set_cntr;
 	uint8_t __io default_rule;
@@ -2511,6 +2541,8 @@ struct npc_install_flow_req {
 	uint8_t __io vtag0_op;
 	uint16_t __io vtag1_def;
 	uint8_t __io vtag1_op;
+	/* old counter value */
+	uint16_t __io cntr_val;
 };
 
 struct npc_install_flow_rsp {
@@ -2525,6 +2557,7 @@ struct npc_delete_flow_req {
 	uint16_t __io start; /*Disable range of entries */
 	uint16_t __io end;
 	uint8_t __io all; /* PF + VFs */
+	uint16_t __io vf; /* Requesting VF */
 };
 
 struct npc_mcam_read_entry_req {
diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index 9a0fe5f4e2..67a660a2bc 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -77,8 +77,23 @@ roc_npc_inl_mcam_clear_counter(uint32_t ctr_id)
 }
 
 int
-roc_npc_mcam_read_counter(struct roc_npc *roc_npc, uint32_t ctr_id,
-			  uint64_t *count)
+roc_npc_mcam_alloc_counter(struct roc_npc *roc_npc, uint16_t *ctr_id)
+{
+	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
+
+	return npc_mcam_alloc_counter(npc->mbox, ctr_id);
+}
+
+int
+roc_npc_get_free_mcam_entry(struct roc_npc *roc_npc, struct roc_npc_flow *flow)
+{
+	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
+
+	return npc_get_free_mcam_entry(npc->mbox, flow, npc);
+}
+
+int
+roc_npc_mcam_read_counter(struct roc_npc *roc_npc, uint32_t ctr_id, uint64_t *count)
 {
 	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
 
@@ -157,14 +172,13 @@ roc_npc_mcam_free_all_resources(struct roc_npc *roc_npc)
 }
 
 int
-roc_npc_mcam_alloc_entries(struct roc_npc *roc_npc, int ref_entry,
-			   int *alloc_entry, int req_count, int priority,
-			   int *resp_count)
+roc_npc_mcam_alloc_entries(struct roc_npc *roc_npc, int ref_entry, int *alloc_entry, int req_count,
+			   int priority, int *resp_count, bool is_conti)
 {
 	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
 
 	return npc_mcam_alloc_entries(npc->mbox, ref_entry, alloc_entry, req_count, priority,
-				      resp_count, 0);
+				      resp_count, is_conti);
 }
 
 int
diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h
index e880a7fa67..349c7f9d22 100644
--- a/drivers/common/cnxk/roc_npc.h
+++ b/drivers/common/cnxk/roc_npc.h
@@ -431,7 +431,8 @@ int __roc_api roc_npc_mcam_enable_all_entries(struct roc_npc *roc_npc, bool enab
 int __roc_api roc_npc_mcam_alloc_entry(struct roc_npc *roc_npc, struct roc_npc_flow *mcam,
 				       struct roc_npc_flow *ref_mcam, int prio, int *resp_count);
 int __roc_api roc_npc_mcam_alloc_entries(struct roc_npc *roc_npc, int ref_entry, int *alloc_entry,
-					 int req_count, int priority, int *resp_count);
+					 int req_count, int priority, int *resp_count,
+					 bool is_conti);
 int __roc_api roc_npc_mcam_ena_dis_entry(struct roc_npc *roc_npc, struct roc_npc_flow *mcam,
 					 bool enable);
 int __roc_api roc_npc_mcam_write_entry(struct roc_npc *roc_npc, struct roc_npc_flow *mcam);
@@ -442,6 +443,8 @@ int __roc_api roc_npc_get_low_priority_mcam(struct roc_npc *roc_npc);
 int __roc_api roc_npc_mcam_free_counter(struct roc_npc *roc_npc, uint16_t ctr_id);
 int __roc_api roc_npc_mcam_read_counter(struct roc_npc *roc_npc, uint32_t ctr_id, uint64_t *count);
 int __roc_api roc_npc_mcam_clear_counter(struct roc_npc *roc_npc, uint32_t ctr_id);
+int __roc_api roc_npc_mcam_alloc_counter(struct roc_npc *roc_npc, uint16_t *ctr_id);
+int __roc_api roc_npc_get_free_mcam_entry(struct roc_npc *roc_npc, struct roc_npc_flow *flow);
 int __roc_api roc_npc_inl_mcam_read_counter(uint32_t ctr_id, uint64_t *count);
 int __roc_api roc_npc_inl_mcam_clear_counter(uint32_t ctr_id);
 int __roc_api roc_npc_mcam_free_all_resources(struct roc_npc *roc_npc);
diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c
index 3ef189e184..2de988a44b 100644
--- a/drivers/common/cnxk/roc_npc_mcam.c
+++ b/drivers/common/cnxk/roc_npc_mcam.c
@@ -4,7 +4,7 @@
 #include "roc_api.h"
 #include "roc_priv.h"
 
-static int
+int
 npc_mcam_alloc_counter(struct mbox *mbox, uint16_t *ctr)
 {
 	struct npc_mcam_alloc_counter_req *req;
diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h
index c0809407a6..50b62b1244 100644
--- a/drivers/common/cnxk/roc_npc_priv.h
+++ b/drivers/common/cnxk/roc_npc_priv.h
@@ -432,6 +432,7 @@ roc_npc_to_npc_priv(struct roc_npc *npc)
 	return (struct npc *)npc->reserved;
 }
 
+int npc_mcam_alloc_counter(struct mbox *mbox, uint16_t *ctr);
 int npc_mcam_free_counter(struct mbox *mbox, uint16_t ctr_id);
 int npc_mcam_read_counter(struct mbox *mbox, uint32_t ctr_id, uint64_t *count);
 int npc_mcam_clear_counter(struct mbox *mbox, uint32_t ctr_id);
@@ -480,7 +481,6 @@ uint64_t npc_get_kex_capability(struct npc *npc);
 int npc_process_ipv6_field_hash(const struct roc_npc_flow_item_ipv6 *ipv6_spec,
 				const struct roc_npc_flow_item_ipv6 *ipv6_mask,
 				struct npc_parse_state *pst, uint8_t type);
-int npc_rss_free_grp_get(struct npc *npc, uint32_t *grp);
 int npc_rss_action_configure(struct roc_npc *roc_npc, const struct roc_npc_action_rss *rss,
 			     uint8_t *alg_idx, uint32_t *rss_grp, uint32_t mcam_id);
 int npc_rss_action_program(struct roc_npc *roc_npc, const struct roc_npc_action actions[],
@@ -496,4 +496,5 @@ void npc_aged_flows_bitmap_free(struct roc_npc *roc_npc);
 int npc_aging_ctrl_thread_create(struct roc_npc *roc_npc, const struct roc_npc_action_age *age,
 				 struct roc_npc_flow *flow);
 void npc_aging_ctrl_thread_destroy(struct roc_npc *roc_npc);
+int npc_rss_free_grp_get(struct npc *npc, uint32_t *pos);
 #endif /* _ROC_NPC_PRIV_H_ */
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index 9bea7af6f4..b509c28b86 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -87,6 +87,10 @@ INTERNAL {
 	roc_dpi_disable;
 	roc_dpi_enable;
 	roc_error_msg_get;
+	roc_eswitch_npc_mcam_delete_rule;
+	roc_eswitch_npc_mcam_rx_rule;
+	roc_eswitch_npc_mcam_tx_rule;
+	roc_eswitch_npc_rss_action_configure;
 	roc_hash_md5_gen;
 	roc_hash_sha1_gen;
 	roc_hash_sha256_gen;
@@ -446,6 +450,7 @@ INTERNAL {
 	roc_npc_flow_dump;
 	roc_npc_flow_mcam_dump;
 	roc_npc_flow_parse;
+	roc_npc_get_free_mcam_entry;
 	roc_npc_get_low_priority_mcam;
 	roc_npc_init;
 	roc_npc_kex_capa_get;
@@ -453,6 +458,7 @@ INTERNAL {
 	roc_npc_mark_actions_sub_return;
 	roc_npc_vtag_actions_get;
 	roc_npc_vtag_actions_sub_return;
+	roc_npc_mcam_alloc_counter;
 	roc_npc_mcam_alloc_entries;
 	roc_npc_mcam_alloc_entry;
 	roc_npc_mcam_clear_counter;
-- 
2.18.0


  parent reply	other threads:[~2024-03-01 19:15 UTC|newest]

Thread overview: 142+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11 16:34 [PATCH 0/9] net/cnxk: support for port representors Harman Kalra
2023-08-11 16:34 ` [PATCH 1/9] common/cnxk: debug log type for representors Harman Kalra
2023-08-11 16:34 ` [PATCH 2/9] net/cnxk: probing representor ports Harman Kalra
2023-08-11 16:34 ` [PATCH 3/9] common/cnxk: maintaining representor state Harman Kalra
2023-08-11 16:34 ` [PATCH 4/9] net/cnxk: callbacks for " Harman Kalra
2023-08-11 16:34 ` [PATCH 5/9] net/cnxk: add representor control plane Harman Kalra
2023-08-11 16:34 ` [PATCH 6/9] net/cnxk: representor ethdev ops Harman Kalra
2023-08-11 16:34 ` [PATCH 7/9] net/cnxk: representor flow ops Harman Kalra
2023-08-11 16:34 ` [PATCH 8/9] common/cnxk: support represented port for cnxk Harman Kalra
2023-08-11 16:34 ` [PATCH 9/9] net/cnxk: add " Harman Kalra
2023-12-19 17:39 ` [PATCH v2 00/24] net/cnxk: support for port representors Harman Kalra
2023-12-19 17:39   ` [PATCH v2 01/24] common/cnxk: add support for representors Harman Kalra
2023-12-19 17:39   ` [PATCH v2 02/24] net/cnxk: implementing eswitch device Harman Kalra
2024-01-04 12:30     ` Jerin Jacob
2023-12-19 17:39   ` [PATCH v2 03/24] net/cnxk: eswitch HW resource configuration Harman Kalra
2024-01-04 12:34     ` Jerin Jacob
2023-12-19 17:39   ` [PATCH v2 04/24] net/cnxk: eswitch devargs parsing Harman Kalra
2023-12-19 17:39   ` [PATCH v2 05/24] net/cnxk: probing representor ports Harman Kalra
2023-12-19 17:39   ` [PATCH v2 06/24] common/cnxk: common NPC changes for eswitch Harman Kalra
2023-12-19 17:39   ` [PATCH v2 07/24] common/cnxk: interface to update VLAN TPID Harman Kalra
2024-01-04 12:47     ` Jerin Jacob
2023-12-19 17:39   ` [PATCH v2 08/24] net/cnxk: eswitch flow configurations Harman Kalra
2023-12-19 17:39   ` [PATCH v2 09/24] net/cnxk: eswitch fastpath routines Harman Kalra
2023-12-19 17:39   ` [PATCH v2 10/24] net/cnxk: add representor control plane Harman Kalra
2023-12-19 17:39   ` [PATCH v2 11/24] common/cnxk: representee notification callback Harman Kalra
2023-12-19 17:39   ` [PATCH v2 12/24] net/cnxk: handling representee notification Harman Kalra
2023-12-19 17:39   ` [PATCH v2 13/24] net/cnxk: representor ethdev ops Harman Kalra
2023-12-19 17:39   ` [PATCH v2 14/24] common/cnxk: get representees ethernet stats Harman Kalra
2023-12-19 17:39   ` [PATCH v2 15/24] net/cnxk: ethernet statistic for representor Harman Kalra
2023-12-19 17:39   ` [PATCH v2 16/24] common/cnxk: base support for eswitch VF Harman Kalra
2023-12-19 17:39   ` [PATCH v2 17/24] net/cnxk: eswitch VF as ethernet device Harman Kalra
2023-12-19 17:39   ` [PATCH v2 18/24] common/cnxk: support port representor and represented port Harman Kalra
2023-12-19 17:39   ` [PATCH v2 19/24] net/cnxk: add represented port pattern and action Harman Kalra
2023-12-19 17:39   ` [PATCH v2 20/24] net/cnxk: add port representor " Harman Kalra
2023-12-19 17:40   ` [PATCH v2 21/24] net/cnxk: generalize flow operation APIs Harman Kalra
2023-12-19 17:40   ` [PATCH v2 22/24] net/cnxk: flow create on representor ports Harman Kalra
2023-12-19 17:40   ` [PATCH v2 23/24] net/cnxk: other flow operations Harman Kalra
2023-12-19 17:40   ` [PATCH v2 24/24] doc: port representors in cnxk Harman Kalra
2023-12-20  9:37     ` Thomas Monjalon
2023-12-21 13:28       ` [EXT] " Harman Kalra
2023-12-21 18:33         ` Thomas Monjalon
2024-01-11  6:48           ` Harman Kalra
2024-02-01 13:07 ` [PATCH v3 00/23] net/cnxk: support for port representors Harman Kalra
2024-02-01 13:07   ` [PATCH v3 01/23] common/cnxk: add support for representors Harman Kalra
2024-02-01 13:07   ` [PATCH v3 02/23] net/cnxk: implementing eswitch device Harman Kalra
2024-02-01 13:07   ` [PATCH v3 03/23] net/cnxk: eswitch HW resource configuration Harman Kalra
2024-02-01 13:07   ` [PATCH v3 04/23] net/cnxk: eswitch devargs parsing Harman Kalra
2024-02-01 13:07   ` [PATCH v3 05/23] net/cnxk: probing representor ports Harman Kalra
2024-02-01 13:07   ` [PATCH v3 06/23] common/cnxk: common NPC changes for eswitch Harman Kalra
2024-02-01 13:07   ` [PATCH v3 07/23] common/cnxk: interface to update VLAN TPID Harman Kalra
2024-02-01 13:07   ` [PATCH v3 08/23] net/cnxk: eswitch flow configurations Harman Kalra
2024-02-01 13:07   ` [PATCH v3 09/23] net/cnxk: eswitch fastpath routines Harman Kalra
2024-02-01 13:07   ` [PATCH v3 10/23] net/cnxk: add representor control plane Harman Kalra
2024-02-01 13:07   ` [PATCH v3 11/23] common/cnxk: representee notification callback Harman Kalra
2024-02-01 13:07   ` [PATCH v3 12/23] net/cnxk: handling representee notification Harman Kalra
2024-02-01 13:07   ` [PATCH v3 13/23] net/cnxk: representor ethdev ops Harman Kalra
2024-02-01 13:07   ` [PATCH v3 14/23] common/cnxk: get representees ethernet stats Harman Kalra
2024-02-01 13:07   ` [PATCH v3 15/23] net/cnxk: ethernet statistic for representor Harman Kalra
2024-02-01 13:07   ` [PATCH v3 16/23] common/cnxk: base support for eswitch VF Harman Kalra
2024-02-01 13:07   ` [PATCH v3 17/23] net/cnxk: eswitch VF as ethernet device Harman Kalra
2024-02-01 13:07   ` [PATCH v3 18/23] common/cnxk: support port representor and represented port Harman Kalra
2024-02-01 13:07   ` [PATCH v3 19/23] net/cnxk: add represented port pattern and action Harman Kalra
2024-02-01 13:07   ` [PATCH v3 20/23] net/cnxk: add representor " Harman Kalra
2024-02-01 13:07   ` [PATCH v3 21/23] net/cnxk: generalise flow operation APIs Harman Kalra
2024-02-01 13:07   ` [PATCH v3 22/23] net/cnxk: flow create on representor ports Harman Kalra
2024-02-01 13:07   ` [PATCH v3 23/23] net/cnxk: other flow operations Harman Kalra
2024-02-27 19:15 ` [PATCH v4 00/23] net/cnxk: support for port representors Harman Kalra
2024-02-27 19:15   ` [PATCH v4 01/23] common/cnxk: add support for representors Harman Kalra
2024-02-27 19:15   ` [PATCH v4 02/23] net/cnxk: implementing eswitch device Harman Kalra
2024-03-01  9:31     ` Jerin Jacob
2024-02-27 19:15   ` [PATCH v4 03/23] net/cnxk: eswitch HW resource configuration Harman Kalra
2024-02-27 19:15   ` [PATCH v4 04/23] net/cnxk: eswitch devargs parsing Harman Kalra
2024-02-27 19:15   ` [PATCH v4 05/23] net/cnxk: probing representor ports Harman Kalra
2024-02-27 19:15   ` [PATCH v4 06/23] common/cnxk: common NPC changes for eswitch Harman Kalra
2024-02-27 19:15   ` [PATCH v4 07/23] common/cnxk: interface to update VLAN TPID Harman Kalra
2024-02-27 19:15   ` [PATCH v4 08/23] net/cnxk: eswitch flow configurations Harman Kalra
2024-02-27 19:15   ` [PATCH v4 09/23] net/cnxk: eswitch fastpath routines Harman Kalra
2024-02-27 19:15   ` [PATCH v4 10/23] net/cnxk: add representor control plane Harman Kalra
2024-02-27 19:15   ` [PATCH v4 11/23] common/cnxk: representee notification callback Harman Kalra
2024-02-27 19:15   ` [PATCH v4 12/23] net/cnxk: handling representee notification Harman Kalra
2024-02-27 19:15   ` [PATCH v4 13/23] net/cnxk: representor ethdev ops Harman Kalra
2024-02-27 19:15   ` [PATCH v4 14/23] common/cnxk: get representees ethernet stats Harman Kalra
2024-02-27 19:15   ` [PATCH v4 15/23] net/cnxk: ethernet statistics for representor Harman Kalra
2024-02-27 19:15   ` [PATCH v4 16/23] common/cnxk: base support for eswitch VF Harman Kalra
2024-02-27 19:15   ` [PATCH v4 17/23] net/cnxk: eswitch VF as ethernet device Harman Kalra
2024-02-27 19:15   ` [PATCH v4 18/23] common/cnxk: support port representor and represented port Harman Kalra
2024-02-27 19:15   ` [PATCH v4 19/23] net/cnxk: add represented port pattern and action Harman Kalra
2024-02-27 19:15   ` [PATCH v4 20/23] net/cnxk: add representor " Harman Kalra
2024-02-27 19:15   ` [PATCH v4 21/23] net/cnxk: generalise flow operation APIs Harman Kalra
2024-02-27 19:15   ` [PATCH v4 22/23] net/cnxk: flow create on representor ports Harman Kalra
2024-02-27 19:15   ` [PATCH v4 23/23] net/cnxk: other flow operations Harman Kalra
2024-03-01  9:35     ` Jerin Jacob
2024-03-01 19:14 ` [PATCH v5 00/23] net/cnxk: support for port representors Harman Kalra
2024-03-01 19:14   ` [PATCH v5 01/23] common/cnxk: add support for representors Harman Kalra
2024-03-01 19:14   ` [PATCH v5 02/23] net/cnxk: implementing eswitch device Harman Kalra
2024-03-01 19:14   ` [PATCH v5 03/23] net/cnxk: eswitch HW resource configuration Harman Kalra
2024-03-01 19:14   ` [PATCH v5 04/23] net/cnxk: eswitch devargs parsing Harman Kalra
2024-03-01 19:14   ` [PATCH v5 05/23] net/cnxk: probing representor ports Harman Kalra
2024-03-01 19:14   ` Harman Kalra [this message]
2024-03-01 19:14   ` [PATCH v5 07/23] common/cnxk: interface to update VLAN TPID Harman Kalra
2024-03-01 19:14   ` [PATCH v5 08/23] net/cnxk: eswitch flow configurations Harman Kalra
2024-03-01 19:14   ` [PATCH v5 09/23] net/cnxk: eswitch fastpath routines Harman Kalra
2024-03-01 19:14   ` [PATCH v5 10/23] net/cnxk: add representor control plane Harman Kalra
2024-03-01 19:14   ` [PATCH v5 11/23] common/cnxk: representee notification callback Harman Kalra
2024-03-01 19:14   ` [PATCH v5 12/23] net/cnxk: handling representee notification Harman Kalra
2024-03-01 19:14   ` [PATCH v5 13/23] net/cnxk: representor ethdev ops Harman Kalra
2024-03-01 19:14   ` [PATCH v5 14/23] common/cnxk: get representees ethernet stats Harman Kalra
2024-03-01 19:14   ` [PATCH v5 15/23] net/cnxk: ethernet statistics for representor Harman Kalra
2024-03-01 19:14   ` [PATCH v5 16/23] common/cnxk: base support for eswitch VF Harman Kalra
2024-03-01 19:14   ` [PATCH v5 17/23] net/cnxk: eswitch VF as ethernet device Harman Kalra
2024-03-01 19:14   ` [PATCH v5 18/23] common/cnxk: support port representor and represented port Harman Kalra
2024-03-01 19:14   ` [PATCH v5 19/23] net/cnxk: add represented port pattern and action Harman Kalra
2024-03-01 19:14   ` [PATCH v5 20/23] net/cnxk: add representor " Harman Kalra
2024-03-01 19:14   ` [PATCH v5 21/23] net/cnxk: generalise flow operation APIs Harman Kalra
2024-03-03 14:50     ` Jerin Jacob
2024-03-01 19:14   ` [PATCH v5 22/23] net/cnxk: flow create on representor ports Harman Kalra
2024-03-01 19:14   ` [PATCH v5 23/23] net/cnxk: other flow operations Harman Kalra
2024-03-03 17:38 ` [PATCH v6 00/23] net/cnxk: support for port representors Harman Kalra
2024-03-03 17:38   ` [PATCH v6 01/23] common/cnxk: add support for representors Harman Kalra
2024-03-03 17:38   ` [PATCH v6 02/23] net/cnxk: implementing eswitch device Harman Kalra
2024-03-03 17:38   ` [PATCH v6 03/23] net/cnxk: eswitch HW resource configuration Harman Kalra
2024-03-03 17:38   ` [PATCH v6 04/23] net/cnxk: eswitch devargs parsing Harman Kalra
2024-03-03 17:38   ` [PATCH v6 05/23] net/cnxk: probing representor ports Harman Kalra
2024-03-03 17:38   ` [PATCH v6 06/23] common/cnxk: common NPC changes for eswitch Harman Kalra
2024-03-03 17:38   ` [PATCH v6 07/23] common/cnxk: interface to update VLAN TPID Harman Kalra
2024-03-03 17:38   ` [PATCH v6 08/23] net/cnxk: eswitch flow configurations Harman Kalra
2024-03-03 17:38   ` [PATCH v6 09/23] net/cnxk: eswitch fastpath routines Harman Kalra
2024-03-03 17:38   ` [PATCH v6 10/23] net/cnxk: add representor control plane Harman Kalra
2024-03-03 17:38   ` [PATCH v6 11/23] common/cnxk: representee notification callback Harman Kalra
2024-03-03 17:38   ` [PATCH v6 12/23] net/cnxk: handling representee notification Harman Kalra
2024-03-03 17:38   ` [PATCH v6 13/23] net/cnxk: representor ethdev ops Harman Kalra
2024-03-03 17:38   ` [PATCH v6 14/23] common/cnxk: get representees ethernet stats Harman Kalra
2024-03-03 17:38   ` [PATCH v6 15/23] net/cnxk: ethernet statistics for representor Harman Kalra
2024-03-03 17:38   ` [PATCH v6 16/23] common/cnxk: base support for eswitch VF Harman Kalra
2024-03-03 17:38   ` [PATCH v6 17/23] net/cnxk: eswitch VF as ethernet device Harman Kalra
2024-03-03 17:38   ` [PATCH v6 18/23] common/cnxk: support port representor and represented port Harman Kalra
2024-03-03 17:38   ` [PATCH v6 19/23] net/cnxk: add represented port pattern and action Harman Kalra
2024-03-03 17:38   ` [PATCH v6 20/23] net/cnxk: add representor " Harman Kalra
2024-03-03 17:38   ` [PATCH v6 21/23] net/cnxk: generalise flow operation APIs Harman Kalra
2024-03-03 17:38   ` [PATCH v6 22/23] net/cnxk: flow create on representor ports Harman Kalra
2024-03-03 17:38   ` [PATCH v6 23/23] net/cnxk: other flow operations Harman Kalra
2024-03-04  7:57     ` 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=20240301191451.57168-7-hkalra@marvell.com \
    --to=hkalra@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).