]> git.hungrycats.org Git - linux/commit
octeontx2: cn20k: Coordinate default rules with NIX LF lifecycle
authorRatheesh Kannoth <rkannoth@marvell.com>
Tue, 9 Jun 2026 04:04:50 +0000 (09:34 +0530)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 23:16:59 +0000 (16:16 -0700)
commitaac055dbc0fadf64c9d6fbcfc066b8ba33216dc4
treec75fb6d6cffdcb366290cb92160e3a9fc1f83b48
parent7ac9d4c4075c1da2a11d4d452a387a71788c4c57
octeontx2: cn20k: Coordinate default rules with NIX LF lifecycle

Add NIX_LF_DONT_FREE_DFT_IDXS so the PF can send NIX LF free during hw
reinit or teardown without the AF freeing CN20K default NPC rule indexes
while the driver still owns that state (otx2_init_hw_resources and
otx2_free_hw_resources).

On CN20K, allocate default NPC rules from NIX LF alloc before
nix_interface_init, roll back with npc_cn20k_dft_rules_free on failure,
and free from NIX LF free when the new flag is not set. Tighten
rvu_mbox_handler_nix_lf_alloc error handling: use a single rc, propagate
qmem_alloc and other errors, and set -ENOMEM only when kcalloc fails
(remove the blanket -ENOMEM at the free_mem path).

Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Link: https://patch.msgid.link/20260609040453.711932-7-rkannoth@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/mbox.h
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c