Re: [PATCH v13 net-next 5/9] octeontx2-af: npc: cn20k: add subbank search order control

From: Ratheesh Kannoth

Date: Thu May 14 2026 - 00:02:11 EST


On 2026-05-11 at 09:09:19, Ratheesh Kannoth (rkannoth@xxxxxxxxxxx) wrote:
> CN20K NPC MCAM is split into 32 subbanks that are searched in a
> predefined order during allocation. Lower-numbered subbanks have
> higher priority than higher-numbered ones.
>

>> + if (rc) {
>> + dev_err(rvu->dev,
>> + "Setting arr_idx=%d for sb=%d failed\n",
>> + sb->arr_idx, sb_idx);
>> + goto fail;
>If xa_store() fails here, is there a risk of permanently corrupting the
>allocator state?
>If a failure occurs mid-loop, the function jumps to fail and returns without
>rolling back the applied changes. The subbanks processed before the failure
>retain their new arr_idx values and new XArray mappings, while the remaining
>subbanks retain their old configurations.
>Additionally, the global subbank_srch_order array is left un-updated,
>completely desynchronizing it from the XArrays. This leaves overlapping
>and missing subbank indices that could cause subsequent MCAM allocations
>to fail or corrupt hardware state.
There is no way we can rollback as rollback may also fail due to memory pressure.
So returning error in these cases.