DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] common/cnxk: setup nix and lbk in loop mode in 98xx
@ 2021-07-30 16:10 Harman Kalra
  2021-07-30 16:10 ` [dpdk-dev] [PATCH 2/2] common/cnxk: update npc mcam range for 98xx Harman Kalra
  2021-09-28 10:05 ` [dpdk-dev] [PATCH 1/2] common/cnxk: setup nix and lbk in loop mode in 98xx Jerin Jacob
  0 siblings, 2 replies; 3+ messages in thread
From: Harman Kalra @ 2021-07-30 16:10 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, Harman Kalra

In case of 98xx, 2 NIX blocks and 4 LBK blocks are present. Moreover
AF VFs are alternatively attached to NIX0 and NIX1 to ensure load
balancing. To support loopback functionality between pairs NIX0/NIX1
are attached to LBK1/LBK2 for transmission/reception respectively.
But in this default configuration NIX blocks cannot receive the
packets they sent from the same LBK, which is an important requirement
as some ODP applications only uses one AF VF for loopback functionality.
To support this scenario, NIX0 can use LBK0 (NIX1 - LBK3) by setting a
loop flag while making LF alloc mailbox request.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/roc_mbox.h | 1 +
 drivers/common/cnxk/roc_nix.c  | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h
index b5da931b81..75d1ff1ef3 100644
--- a/drivers/common/cnxk/roc_mbox.h
+++ b/drivers/common/cnxk/roc_mbox.h
@@ -723,6 +723,7 @@ struct nix_lf_alloc_req {
 	uint64_t __io rx_cfg; /* See NIX_AF_LF(0..127)_RX_CFG */
 	uint64_t __io way_mask;
 #define NIX_LF_RSS_TAG_LSB_AS_ADDER BIT_ULL(0)
+#define NIX_LF_LBK_BLK_SEL	    BIT_ULL(1)
 	uint64_t flags;
 };
 
diff --git a/drivers/common/cnxk/roc_nix.c b/drivers/common/cnxk/roc_nix.c
index 23d508b941..1621f77fb0 100644
--- a/drivers/common/cnxk/roc_nix.c
+++ b/drivers/common/cnxk/roc_nix.c
@@ -145,9 +145,12 @@ roc_nix_lf_alloc(struct roc_nix *roc_nix, uint32_t nb_rxq, uint32_t nb_txq,
 	req->npa_func = idev_npa_pffunc_get();
 	req->sso_func = idev_sso_pffunc_get();
 	req->rx_cfg = rx_cfg;
+	if (roc_nix_is_lbk(roc_nix) && roc_nix->enable_loop &&
+	    roc_model_is_cn98xx())
+		req->flags = NIX_LF_LBK_BLK_SEL;
 
 	if (!roc_nix->rss_tag_as_xor)
-		req->flags = NIX_LF_RSS_TAG_LSB_AS_ADDER;
+		req->flags |= NIX_LF_RSS_TAG_LSB_AS_ADDER;
 
 	rc = mbox_process_msg(mbox, (void *)&rsp);
 	if (rc)
-- 
2.18.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH 2/2] common/cnxk: update npc mcam range for 98xx
  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
  2021-09-28 10:05 ` [dpdk-dev] [PATCH 1/2] common/cnxk: setup nix and lbk in loop mode in 98xx Jerin Jacob
  1 sibling, 0 replies; 3+ messages in thread
From: Harman Kalra @ 2021-07-30 16:10 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, Harman Kalra

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] common/cnxk: setup nix and lbk in loop mode in 98xx
  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 ` [dpdk-dev] [PATCH 2/2] common/cnxk: update npc mcam range for 98xx Harman Kalra
@ 2021-09-28 10:05 ` Jerin Jacob
  1 sibling, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2021-09-28 10:05 UTC (permalink / raw)
  To: Harman Kalra, Ferruh Yigit
  Cc: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao, dpdk-dev

On Fri, Jul 30, 2021 at 9:40 PM Harman Kalra <hkalra@marvell.com> wrote:
>
> In case of 98xx, 2 NIX blocks and 4 LBK blocks are present. Moreover
> AF VFs are alternatively attached to NIX0 and NIX1 to ensure load
> balancing. To support loopback functionality between pairs NIX0/NIX1
> are attached to LBK1/LBK2 for transmission/reception respectively.
> But in this default configuration NIX blocks cannot receive the
> packets they sent from the same LBK, which is an important requirement
> as some ODP applications only uses one AF VF for loopback functionality.
> To support this scenario, NIX0 can use LBK0 (NIX1 - LBK3) by setting a
> loop flag while making LF alloc mailbox request.
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>

Changed the subject to : common/cnxk: support loop mode for cn98xx

Series Acked-by: Jerin Jacob <jerinj@marvell.com>
Series applied to dpdk-next-net-mrvl/for-next-net. Thanks.

> ---
>  drivers/common/cnxk/roc_mbox.h | 1 +
>  drivers/common/cnxk/roc_nix.c  | 5 ++++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h
> index b5da931b81..75d1ff1ef3 100644
> --- a/drivers/common/cnxk/roc_mbox.h
> +++ b/drivers/common/cnxk/roc_mbox.h
> @@ -723,6 +723,7 @@ struct nix_lf_alloc_req {
>         uint64_t __io rx_cfg; /* See NIX_AF_LF(0..127)_RX_CFG */
>         uint64_t __io way_mask;
>  #define NIX_LF_RSS_TAG_LSB_AS_ADDER BIT_ULL(0)
> +#define NIX_LF_LBK_BLK_SEL         BIT_ULL(1)
>         uint64_t flags;
>  };
>
> diff --git a/drivers/common/cnxk/roc_nix.c b/drivers/common/cnxk/roc_nix.c
> index 23d508b941..1621f77fb0 100644
> --- a/drivers/common/cnxk/roc_nix.c
> +++ b/drivers/common/cnxk/roc_nix.c
> @@ -145,9 +145,12 @@ roc_nix_lf_alloc(struct roc_nix *roc_nix, uint32_t nb_rxq, uint32_t nb_txq,
>         req->npa_func = idev_npa_pffunc_get();
>         req->sso_func = idev_sso_pffunc_get();
>         req->rx_cfg = rx_cfg;
> +       if (roc_nix_is_lbk(roc_nix) && roc_nix->enable_loop &&
> +           roc_model_is_cn98xx())
> +               req->flags = NIX_LF_LBK_BLK_SEL;
>
>         if (!roc_nix->rss_tag_as_xor)
> -               req->flags = NIX_LF_RSS_TAG_LSB_AS_ADDER;
> +               req->flags |= NIX_LF_RSS_TAG_LSB_AS_ADDER;
>
>         rc = mbox_process_msg(mbox, (void *)&rsp);
>         if (rc)
> --
> 2.18.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-28 10:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [dpdk-dev] [PATCH 2/2] common/cnxk: update npc mcam range for 98xx Harman Kalra
2021-09-28 10:05 ` [dpdk-dev] [PATCH 1/2] common/cnxk: setup nix and lbk in loop mode in 98xx Jerin Jacob

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).