Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: hare@kernel.org
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
	Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, Hannes Reinecke <hare@suse.de>,
	Martin George <marting@netapp.com>
Subject: Re: [PATCHv2] nvme: enable retries for authentication commands
Date: Fri, 26 Jan 2024 14:49:37 +0100	[thread overview]
Message-ID: <20240126134937.GA3016@lst.de> (raw)
In-Reply-To: <20240126063709.123814-1-hare@kernel.org>

On Fri, Jan 26, 2024 at 07:37:09AM +0100, hare@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.

>  	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.

> +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?



  reply	other threads:[~2024-01-26 13:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26  6:37 [PATCHv2] nvme: enable retries for authentication commands hare
2024-01-26 13:49 ` Christoph Hellwig [this message]
2024-01-26 16:10   ` Hannes Reinecke
2024-01-26 16:21 ` Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240126134937.GA3016@lst.de \
    --to=hch@lst.de \
    --cc=hare@kernel.org \
    --cc=hare@suse.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=marting@netapp.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox