From: Jakub Kicinski <kuba@kernel.org>
To: rkannoth@marvell.com
Cc: Jakub Kicinski <kuba@kernel.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [net-next,v4,04/13] ocetontx2-af: npc: cn20k: MKEX profile support
Date: Sat, 17 Jan 2026 16:40:20 -0800 [thread overview]
Message-ID: <20260118004020.1044336-1-kuba@kernel.org> (raw)
In-Reply-To: <20260113101658.4144610-5-rkannoth@marvell.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
ocetontx2-af: npc: cn20k: MKEX profile support
This patch adds MKEX (MicroCode Key EXtraction) profile support for the
CN20K silicon variant, introducing a new parser profile with 24 extractors
per packet parsing profile instead of the previous two layer-data
information per key field type.
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c b/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
> index 0717fd66e8a1..c3f41f4ea99c 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
[ ... ]
> +static u8 npc_map2cn20k_flag(u8 flag)
> +{
> + switch (flag) {
> + case NPC_F_LC_U_IP_FRAG:
> + return NPC_CN20K_F_LC_L_IP_FRAG;
> +
> + case NPC_F_LC_U_IP6_FRAG:
> + return NPC_CN20K_F_LC_L_IP6_FRAG;
> +
> + case NPC_F_LC_L_6TO4:
> + return NPC_CN20K_F_LC_L_6TO4;
> +
> + case NPC_F_LC_L_MPLS_IN_IP:
> + return NPC_CN20K_F_LC_U_MPLS_IN_IP;
> +
> + case NPC_F_LC_L_IP6_TUN_IP6:
> + return NPC_CN20K_F_LC_U_IP6_TUN_IP6;
> +
> + case NPC_F_LC_L_IP6_MPLS_IN_IP:
> + return NPC_CN20K_F_LC_U_IP6_MPLS_IN_IP;
> +
> + default:
> + break;
> + }
> +
> + return -1;
> +}
[ ... ]
> +int npc_cn20k_apply_custom_kpu(struct rvu *rvu,
> + struct npc_kpu_profile_adapter *profile)
> +{
[ ... ]
> + for (kpu = 0; kpu < fw->kpus; kpu++) {
> + fw_kpu = (struct npc_kpu_fwdata *)(fw->data + offset);
[ ... ]
> + npc_cn20k_update_action_entries_n_flags(rvu, profile);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Is it intentional to call npc_cn20k_update_action_entries_n_flags() inside
the kpu loop? This function iterates through all kpus in the profile and
remaps flag values from the old enum to the CN20K enum. When called
multiple times, the mapping appears to be bidirectional:
First call: NPC_F_LC_L_MPLS_IN_IP (2) -> NPC_CN20K_F_LC_U_MPLS_IN_IP (0x20)
Second call: 0x20 matches NPC_F_LC_U_IP_FRAG -> NPC_CN20K_F_LC_L_IP_FRAG (2)
The old and new enum values overlap (2,3,4 map to 0x20,0x40,0x80 and
vice-versa), so calling this function fw->kpus times will flip-flop the
flag values. If fw->kpus is even, the flags will have incorrect values
after the loop completes.
Should the call be moved outside the loop, or should there be a guard to
ensure it only runs once?
> +
> + for (entry = 0; entry < entries; entry++) {
> + profile->kpu[kpu].cam[entry] = cam[entry];
> + profile->kpu[kpu].action[entry] = action[entry];
> + }
> + }
> +
> + return 0;
> +}
next prev parent reply other threads:[~2026-01-18 0:40 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 10:16 [PATCH net-next v4 00/13] NPC HW block support for cn20k Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 01/13] octeontx2-af: npc: cn20k: Index management Ratheesh Kannoth
2026-01-18 0:39 ` Jakub Kicinski
2026-01-19 4:04 ` Ratheesh Kannoth
2026-01-18 0:40 ` [net-next,v4,01/13] " Jakub Kicinski
2026-01-19 4:00 ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 02/13] octeontx2-af: npc: cn20k: KPM profile changes Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 03/13] octeontx2-af: npc: cn20k: Add default profile Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 04/13] ocetontx2-af: npc: cn20k: MKEX profile support Ratheesh Kannoth
2026-01-18 0:40 ` Jakub Kicinski [this message]
2026-01-19 4:17 ` [net-next,v4,04/13] " Ratheesh Kannoth
2026-01-20 3:24 ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 05/13] octeontx2-af: npc: cn20k: Allocate default MCAM indexes Ratheesh Kannoth
2026-01-18 0:40 ` [net-next,v4,05/13] " Jakub Kicinski
2026-01-19 3:42 ` Ratheesh Kannoth
2026-01-19 17:32 ` Jakub Kicinski
2026-01-20 1:37 ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 06/13] octeontx2-af: npc: cn20k: Use common APIs Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 07/13] octeontx2-af: npc: cn20k: Prepare for new SoC Ratheesh Kannoth
2026-01-22 8:36 ` Simon Horman
2026-01-23 15:39 ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 08/13] octeontx2-af: npc: cn20k: Add new mailboxes for CN20K silicon Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 09/13] octeontx2-af: npc: cn20k: virtual index support Ratheesh Kannoth
2026-01-18 0:40 ` [net-next,v4,09/13] " Jakub Kicinski
2026-01-19 3:39 ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 10/13] octeontx2-af: npc: cn20k: Allocate MCAM entry for flow installation Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 11/13] octeontx2-pf: cn20k: Add TC rules support Ratheesh Kannoth
2026-01-18 0:40 ` [net-next,v4,11/13] " Jakub Kicinski
2026-01-19 3:39 ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 12/13] octeontx2-af: npc: cn20k: add debugfs support Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 13/13] octeontx2-af: npc: Use common structures Ratheesh Kannoth
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=20260118004020.1044336-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rkannoth@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