Thread (31 messages) 31 messages, 3 authors, 2026-01-23

Re: [net-next,v4,05/13] octeontx2-af: npc: cn20k: Allocate default MCAM indexes

From: Ratheesh Kannoth <hidden>
Date: 2026-01-20 01:37:45
Also in: lkml

On 2026-01-19 at 23:02:45, Jakub Kicinski (kuba@kernel.org) wrote:
On Mon, 19 Jan 2026 09:12:32 +0530 Ratheesh Kannoth wrote:
quoted
quoted
quoted
-	if (attach->nixlf)
+	if (attach->nixlf) {
 		rvu_attach_block(rvu, pcifunc, BLKTYPE_NIX, 1, attach);
+		if (is_cn20k(rvu->pdev)) {
+			err = npc_cn20k_dft_rules_alloc(rvu, pcifunc);
+			if (err)
+				goto exit;
                        ^^^^

When npc_cn20k_dft_rules_alloc() fails after rvu_attach_block() has
already attached the NIX LF, the error path jumps to exit without
detaching NIX. The caller (otx2_init_rsrc in otx2_pf.c) assumes that on
error nothing was attached, so it does not call otx2_detach_resources().

Could this leave NIX LF attached without proper cleanup on allocation
failure?
There is no proper error handling done for rvu_attach_block function (in existing code)
We can address this later as different patch ?
Different patch, yes, but _before_ these patches are merged.
ACK.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help