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

Ratheesh Kannoth
2026-01-20T01:37:45Z

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:
> > > > - 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.