]> git.hungrycats.org Git - linux/commit
octeontx2-af: npc: cn20k: fix NPC defrag
authorRatheesh Kannoth <rkannoth@marvell.com>
Wed, 17 Jun 2026 10:21:49 +0000 (15:51 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sun, 21 Jun 2026 21:41:30 +0000 (14:41 -0700)
commit48b67c0e8af65acd59d81ddaedd3442b5e4c27b7
treee09fa4a4254514de4aadb814344603e68122a760
parent41782770be567abc6509169d0ffdada31c783a66
octeontx2-af: npc: cn20k: fix NPC defrag

npc_defrag_alloc_free_slots() always passed NPC_MCAM_KEY_X2 into
__npc_subbank_alloc(), which must match sb->key_type, so defrag never
allocated replacement slots on X4 banks. Pass the subbank key type for
bank 0, and only extend the search into bank 1 for X2 (X4 MCAM indices
are confined to b0b..b0t).

Fixes: 645c6e3c1999 ("octeontx2-af: npc: cn20k: virtual index support")
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260617102149.1309913-1-rkannoth@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c