common/cnxk: update NPC MACM range for cn98xx
authorHarman Kalra <hkalra@marvell.com>
Fri, 30 Jul 2021 16:10:08 +0000 (21:40 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 28 Sep 2021 10:09:14 +0000 (12:09 +0200)
NPC MCAM entry distribution is based on maximum number of PFs and LFs
available. Fixing the max no of PFs and LFs available on cn98xx to
fix the MCAM alloc entry range.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/cnxk/roc_npc.c
drivers/common/cnxk/roc_npc_priv.h

index 52a54b3..afaa8a7 100644 (file)
@@ -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);
 }
index b11f5b5..2567846 100644 (file)
 #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)
        (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)
+
 #define NPC_ACTION_MAX_VLAN_PARAMS    3
 #define NPC_ACTION_MAX_VLANS_STRIPPED 2