Re: [PATCH net-next v2 03/13] octeontx2-af: npc: cn20k: Add default profile

From: Simon Horman
Date: Thu Jan 08 2026 - 13:03:42 EST


On Wed, Jan 07, 2026 at 09:08:34AM +0530, Ratheesh Kannoth wrote:
> From: Suman Ghosh <sumang@xxxxxxxxxxx>
>
> Default mkex profile for cn20k silicon. This commit
> changes attribute of objects to may_be_unused to
> avoid compiler warning
>
> Signed-off-by: Suman Ghosh <sumang@xxxxxxxxxxx>
> Signed-off-by: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>
> ---
> .../ethernet/marvell/octeontx2/af/cn20k/npc.c | 170 +++++++++++++++++-
> .../ethernet/marvell/octeontx2/af/cn20k/npc.h | 18 ++
> .../marvell/octeontx2/af/npc_profile.h | 72 ++++----
> 3 files changed, 223 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c b/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
> index bc52aafeb6a4..8f3f9cb37333 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
> @@ -7,9 +7,13 @@
> #include <linux/xarray.h>
> #include <linux/bitfield.h>
>
> +#include "rvu.h"
> +#include "npc.h"
> +#include "npc_profile.h"
> +#include "rvu_npc_hash.h"
> +#include "rvu_npc.h"
> #include "cn20k/npc.h"
> #include "cn20k/reg.h"
> -#include "rvu_npc.h"
>
> static struct npc_priv_t npc_priv = {
> .num_banks = MAX_NUM_BANKS,
> @@ -21,6 +25,170 @@ static const char *npc_kw_name[NPC_MCAM_KEY_MAX] = {
> [NPC_MCAM_KEY_X4] = "X4",
> };
>
> +#define KEX_EXTR_CFG(bytesm1, hdr_ofs, ena, key_ofs) \
> + (((bytesm1) << 16) | ((hdr_ofs) << 8) | ((ena) << 7) | \
> + ((key_ofs) & 0x3F))
> +
> +static struct npc_mcam_kex_extr npc_mkex_extr_default = {
> + .mkex_sign = MKEX_SIGN,
> + .name = "default",
> + .kpu_version = NPC_KPU_PROFILE_VER,
> + .keyx_cfg = {
> + /* nibble: LA..LE (ltype only) + Error code + Channel */
> + [NIX_INTF_RX] = ((u64)NPC_MCAM_KEY_DYN << 32) | NPC_CN20K_PARSE_NIBBLE_INTF_RX |
> + NPC_CN20K_PARSE_NIBBLE_ERRCODE,

Hi Suman and Ratheesh,

NPC_CN20K_PARSE_NIBBLE_ERRCODE isn't defined until the following patch,
so this results in a build failure.

...