[PATCHv2] nvme: enable retries for authentication commands

Hannes Reinecke hare at suse.de
Fri Jan 26 08:10:02 PST 2024


On 1/26/24 14:49, Christoph Hellwig wrote:
> On Fri, Jan 26, 2024 at 07:37:09AM +0100, hare at kernel.org wrote:
>>   #define nvme_auth_flags_from_qid(qid) \
>> -	(qid == 0) ? 0 : BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_RESERVED
>> +	(qid == 0) ? NVME_SUBMIT_RETRY : \
>> +	NVME_SUBMIT_RETRY | NVME_SUBMIT_NOWAIT | NVME_SUBMIT_RESERVED
>>   #define nvme_auth_queue_from_qid(ctrl, qid) \
>>   	(qid == 0) ? (ctrl)->fabrics_q : (ctrl)->connect_q
> 
> Please just open code these two obfuscating macros with a single user
> each to make the change easily reviewable.  That also means after that
> you only nee to assign NVME_SUBMIT_RETRY once and not in both side of
> a ternary operator.
> 
Ok.

>>   	ret = __nvme_submit_sync_cmd(q, &cmd, NULL, data, data_len,
>> -				     qid == 0 ? NVME_QID_ANY : qid,
>> -				     0, flags);
>> +				     qid == 0 ? NVME_QID_ANY : qid, flags);
> 
> And then split addition the calling convention change for the request
> submission helpers from the actual behavior change into a well documented
> prep patch as well.
> 
Let's see about the 'well-documented', but I'll try.
Ok.

>> +enum {
>> +	NVME_SUBMIT_AT_HEAD  = (__force nvme_submit_flags_t)(1 << 0),
>> +	NVME_SUBMIT_NOWAIT = (__force nvme_submit_flags_t)(1 << 1),
>> +	NVME_SUBMIT_RESERVED = (__force nvme_submit_flags_t)(1 << 2),
>> +	NVME_SUBMIT_RETRY = (__force nvme_submit_flags_t)(1 << 3),
> 
> Maybe write some comments explaining the semantics while you're at it?
> 
Maybe.

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), GF: Ivo Totev, Andrew McDonald,
Werner Knoblich




More information about the Linux-nvme mailing list