[PATCH 1/6] nvme-auth: allocate authentication buffer only during transaction

Hannes Reinecke hare at suse.de
Thu Nov 3 23:49:41 PDT 2022


On 11/3/22 21:01, Sagi Grimberg wrote:
> 
> 
> On 11/2/22 09:52, Hannes Reinecke wrote:
>> The authentication buffer is only used during the authentication
>> transaction, so no need to keep it around.
> 
> Patch is fine, but why do we need the chap context dynamically
> allocated? It is always the number of queues and never ever changes.
> 
I didn't want to clutter the main nvme structure with the chap stuff, so 
I kept it as a private definition in auth.c, and did a private allocation.

Also there is no 'queue' definition in the nvme structures; they live 
only within the transport definitions. The common nvme structures only 
know about controllers, and I don't have anything where I could hook the 
dhchap context into.

But the most crucial part here is that the number of queues are 
calculated after the initial 'connect' command (it's calculated during 
nvme_enable_ctrl()), so I would be prone to over-allocating the number 
of contexts.
If that's fine, though, I can easily simplify the code by allocating the 
dhchap contexts up front, and saving quite a bit of hassle with locking 
and stuff.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman




More information about the Linux-nvme mailing list