All of lore.kernel.org
 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 22.02 1/2] common/cnxk: support to set channel mask for SDP interfaces
Date: Tue, 9 Nov 2021 15:12:03 +0530	[thread overview]
Message-ID: <20211109094204.2343402-1-psatheesh@marvell.com> (raw)

From: Satheesh Paul <psatheesh@marvell.com>

ROC changes to support setting channel mask for SDP interfaces.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
---
 drivers/common/cnxk/roc_npc.c      | 13 +++++++++++++
 drivers/common/cnxk/roc_npc.h      |  3 +++
 drivers/common/cnxk/roc_npc_mcam.c | 10 ++++++++++
 drivers/common/cnxk/roc_npc_priv.h |  3 +++
 4 files changed, 29 insertions(+)

diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index 503c74748f..d18dfd4259 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -1152,6 +1152,19 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
 	int rc;
 
 	npc->channel = roc_npc->channel;
+	npc->is_sdp_link = roc_nix_is_sdp(roc_npc->roc_nix);
+	if (npc->is_sdp_link) {
+		if (roc_npc->is_sdp_mask_set) {
+			npc->sdp_channel = roc_npc->sdp_channel;
+			npc->sdp_channel_mask = roc_npc->sdp_channel_mask;
+		} else {
+			/* By default set the channel and mask to cover
+			 * the whole SDP channel range.
+			 */
+			npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START;
+			npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START;
+		}
+	}
 
 	flow = plt_zmalloc(sizeof(*flow), 0);
 	if (flow == NULL) {
diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h
index e13d557136..8c24126ae8 100644
--- a/drivers/common/cnxk/roc_npc.h
+++ b/drivers/common/cnxk/roc_npc.h
@@ -195,6 +195,9 @@ struct roc_npc {
 	uint64_t rx_parse_nibble;
 	/* Parsed RSS Flowkey cfg for current flow being created */
 	uint32_t flowkey_cfg_state;
+	bool is_sdp_mask_set;
+	uint16_t sdp_channel;
+	uint16_t sdp_channel_mask;
 
 #define ROC_NPC_MEM_SZ (5 * 1024)
 	uint8_t reserved[ROC_NPC_MEM_SZ];
diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c
index ba7f89b45b..80851d6f9f 100644
--- a/drivers/common/cnxk/roc_npc_mcam.c
+++ b/drivers/common/cnxk/roc_npc_mcam.c
@@ -575,6 +575,16 @@ npc_mcam_alloc_and_write(struct npc *npc, struct roc_npc_flow *flow,
 			flow->npc_action |= (uint64_t)pf_func << 4;
 			flow->mcam_data[0] |= (uint64_t)inl_dev->channel;
 			flow->mcam_mask[0] |= (uint64_t)inl_dev->chan_mask;
+		} else if (npc->is_sdp_link) {
+			req->entry_data.kw[0] &= ~(GENMASK(11, 0));
+			req->entry_data.kw_mask[0] &= ~(GENMASK(11, 0));
+			req->entry_data.kw[0] |= (uint64_t)npc->sdp_channel;
+			req->entry_data.kw_mask[0] |=
+				(uint64_t)npc->sdp_channel_mask;
+			flow->mcam_data[0] &= ~(GENMASK(11, 0));
+			flow->mcam_mask[0] &= ~(GENMASK(11, 0));
+			flow->mcam_data[0] |= (uint64_t)npc->sdp_channel;
+			flow->mcam_mask[0] |= (uint64_t)npc->sdp_channel_mask;
 		} else {
 			req->entry_data.kw[0] |= (uint64_t)npc->channel;
 			req->entry_data.kw_mask[0] |= (BIT_ULL(12) - 1);
diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h
index 712302bc5c..86c10ea082 100644
--- a/drivers/common/cnxk/roc_npc_priv.h
+++ b/drivers/common/cnxk/roc_npc_priv.h
@@ -360,6 +360,9 @@ struct npc {
 	uint32_t keyw[NPC_MAX_INTF];		/* max key + data len bits */
 	uint32_t mcam_entries;			/* mcam entries supported */
 	uint16_t channel;			/* RX Channel number */
+	bool is_sdp_link;
+	uint16_t sdp_channel;
+	uint16_t sdp_channel_mask;
 	uint32_t rss_grps;			/* rss groups supported */
 	uint16_t flow_prealloc_size;		/* Pre allocated mcam size */
 	uint16_t flow_max_priority;		/* Max priority for flow */
-- 
2.25.4


             reply	other threads:[~2021-11-09  9:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09  9:42 psatheesh [this message]
2021-11-09  9:42 ` [dpdk-dev] [PATCH 22.02 2/2] net/cnxk: add devargs for configuring SDP channel mask psatheesh
2022-01-11 11:56   ` Ferruh Yigit
2022-01-11 14:29     ` [EXT] " Satheesh Paul
2022-01-12 10:57       ` Ferruh Yigit
2021-12-21 10:18 ` [dpdk-dev] [PATCH 22.02 1/2] common/cnxk: support to set channel mask for SDP interfaces 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=20211109094204.2343402-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.