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>
Cc: <dev@dpdk.org>, Harman Kalra <hkalra@marvell.com>
Subject: [dpdk-dev] [PATCH 2/2] common/cnxk: update npc mcam range for 98xx
Date: Fri, 30 Jul 2021 21:40:08 +0530	[thread overview]
Message-ID: <20210730161009.14383-2-hkalra@marvell.com> (raw)
In-Reply-To: <20210730161009.14383-1-hkalra@marvell.com>

NPC mcam entry distribution is based on maximum number of PFs and LFs
available. Fixing the max no of PFs and LFs available on 98xx to fix the
mcam alloc entry range.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/roc_npc.c      | 2 ++
 drivers/common/cnxk/roc_npc_priv.h | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index aff4eef554..27a7f20226 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -108,6 +108,8 @@ roc_npc_get_low_priority_mcam(struct roc_npc *roc_npc)
 
 	if (roc_model_is_cn10k())
 		return (npc->mcam_entries - NPC_MCAME_RESVD_10XX - 1);
+	else if (roc_model_is_cn98xx())
+		return (npc->mcam_entries - NPC_MCAME_RESVD_98XX - 1);
 	else
 		return (npc->mcam_entries - NPC_MCAME_RESVD_9XXX - 1);
 }
diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h
index 5b884e3fd4..365701a545 100644
--- a/drivers/common/cnxk/roc_npc_priv.h
+++ b/drivers/common/cnxk/roc_npc_priv.h
@@ -46,10 +46,12 @@
 #define NPC_MCAM_KEY_X4_WORDS	  7 /* Number of 64-bit words */
 
 #define NPC_RVUPF_MAX_9XXX 0x10 /* HRM: RVU_PRIV_CONST */
+#define NPC_RVUPF_MAX_98XX 0x18 /* HRM: RVU_PRIV_CONST */
 #define NPC_RVUPF_MAX_10XX 0x20 /* HRM: RVU_PRIV_CONST */
 #define NPC_NIXLF_MAX	   0x80 /* HRM: NIX_AF_CONST2 */
 #define NPC_MCAME_PER_PF   3	/* DRV: RSVD_MCAM_ENTRIES_PER_PF */
 #define NPC_MCAME_PER_LF   1	/* DRV: RSVD_MCAM_ENTRIES_PER_NIXLF */
+#define NPC_NIXLF_MAX_98XX (2 * NPC_NIXLF_MAX) /*2 NIXLFs */
 #define NPC_MCAME_RESVD_9XXX                                                   \
 	(NPC_NIXLF_MAX * NPC_MCAME_PER_LF +                                    \
 	 (NPC_RVUPF_MAX_9XXX - 1) * NPC_MCAME_PER_PF)
@@ -58,6 +60,10 @@
 	(NPC_NIXLF_MAX * NPC_MCAME_PER_LF +                                    \
 	 (NPC_RVUPF_MAX_10XX - 1) * NPC_MCAME_PER_PF)
 
+#define NPC_MCAME_RESVD_98XX                                                   \
+	(NPC_NIXLF_MAX_98XX * NPC_MCAME_PER_LF +                               \
+	 (NPC_RVUPF_MAX_98XX - 1) * NPC_MCAME_PER_PF)
+
 enum npc_err_status {
 	NPC_ERR_PARAM = -1024,
 	NPC_ERR_NO_MEM,
-- 
2.18.0


  reply	other threads:[~2021-07-30 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 16:10 [dpdk-dev] [PATCH 1/2] common/cnxk: setup nix and lbk in loop mode in 98xx Harman Kalra
2021-07-30 16:10 ` Harman Kalra [this message]
2021-09-28 10:05 ` 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=20210730161009.14383-2-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).