[PATCH 3/6] nvme-auth: use xarray instead of linked list

Sagi Grimberg sagi at grimberg.me
Thu Nov 3 14:20:59 PDT 2022


> The current design of holding the chap context is slightly awkward,
> as the context is allocated on demand, and we have to lock the list
> when looking up contexts as we wouldn't know if the context is
> allocated.
> 
> This patch moves the allocation out of the chap context before starting
> authentication and stores it into an xarray. With that we can do
> away with the list traversal and access the context directly
> via the queue number.

Why not just allocate the chap contexts in auth_init() ??
its always the number of queues and is mapped 1x1. It IS
an array effectively.



More information about the Linux-nvme mailing list