Re: [net-next,v7,09/13] octeontx2-af: npc: cn20k: virtual index support
From: Ratheesh Kannoth
Date: Sun Feb 01 2026 - 23:37:31 EST
On 2026-01-31 at 09:03:22, Jakub Kicinski (kuba@xxxxxxxxxx) wrote:
>
> > +fail1:
> > + if (xa_insert(&npc_priv.xa_idx2vidx_map, old_midx,
> > + xa_mk_value(vidx), GFP_KERNEL))
> > + dev_err(rvu->dev,
> > + "%s: Faled to roll back vidx2idx to old_midx=%u, vidx=%u\n",
> > + __func__, old_midx, vidx);
> > +
> > + return rc;
> > +}
>
> When we jump to fail1, it's because the xa_insert() into xa_vidx2idx_map
> failed (around line 352). At that point, xa_idx2vidx_map hasn't been touched
> yet - only xa_vidx2idx_map had the vidx erased. The rollback here tries to
> insert into xa_idx2vidx_map, but shouldn't this restore vidx -> old_midx
> in xa_vidx2idx_map instead? This appears to be operating on the wrong xarray
> and would leave the mapping inconsistent on error.
>
> This was also raised in lore review feedback:
> https://lore.kernel.org/all/20260129051307.376632-1-kuba@xxxxxxxxxx/
Label fall1: is modifying vidx2idx_map in V7. Am i missing anything here ?