]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
octeontx2-af: npc: cn20k: Clear MCAM entries by index and key width
authorRatheesh Kannoth <rkannoth@marvell.com>
Wed, 29 Apr 2026 02:27:17 +0000 (07:57 +0530)
committerJakub Kicinski <kuba@kernel.org>
Fri, 1 May 2026 01:50:16 +0000 (18:50 -0700)
commitd2dabf09632c84b7acdc0fb2eeb6b6fe9c0f9106
treef7bd5ed60d9b8179dd2dac0f27e2c299b7490488
parentd7e5940c4c508df73b15d9bc29628a83b3674fff
octeontx2-af: npc: cn20k: Clear MCAM entries by index and key width

Replace the old four-argument CN20K MCAM clear with a per-bank static
helper and npc_cn20k_clear_mcam_entry() that takes a logical MCAM index,
resolves the key width via npc_mcam_idx_2_key_type(), and clears either one
bank (X2) or every bank (X4).

Call it from npc_clear_mcam_entry() on cn20k and log when key-type lookup
fails. Use the per-bank helper from npc_cn20k_config_mcam_entry() for
pre-program clears.

For loopback VFs, use the promisc MCAM index as ucast_idx when copying RSS
action for promisc, matching cn20k default-rule layout.

Cc: Suman Ghosh <sumang@marvell.com>
Fixes: 6d1e70282f76 ("octeontx2-af: npc: cn20k: Use common APIs")
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Link: https://patch.msgid.link/20260429022722.1110289-6-rkannoth@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.h
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c