public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Keith Busch <kbusch@kernel.org>,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH 4/5] nvme: open-code __nvme_submit_sync_cmd()
Date: Mon, 13 Feb 2023 07:26:54 +0100	[thread overview]
Message-ID: <20230213062654.GC14223@lst.de> (raw)
In-Reply-To: <20230209143820.118097-5-hare@suse.de>

On Thu, Feb 09, 2023 at 03:38:19PM +0100, Hannes Reinecke wrote:
> +	if (ret) {
>  		dev_err(ctrl->device,
> -			"qid %d auth_send failed with error %d\n", qid, ret);
> +			"qid %d auth_submit failed to map, error %d\n",
> +			qid, ret);

Plase do a goto out_free_request here instead of indenting the
normal flow in the else path.  The same comment applies in a bunch of
other places.

> -	ret = __nvme_submit_sync_cmd(req, &res, buffer, buflen, 0);
> +	ret = blk_rq_map_kern(req->q, req, buffer, buflen, GFP_KERNEL);
> +	if (ret)
> +		goto out;
> +
> +	ret = nvme_execute_rq(req, &res, false);

This could use nvmf_submit_fabrics_cmd, which has nothing to with
fabrics, but just is a variant of nvme_submit_sync_cmd that returns the
result.  So if we have that helper anyway we might as well move it to
the core and turn nvme_submit_sync_cmd into a wrapper for it.


  reply	other threads:[~2023-02-13  6:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 14:38 [PATCH 0/5] nvme: rework __nvme_submit_sync_cmd() Hannes Reinecke
2023-02-09 14:38 ` [PATCH 1/5] nvme: split __nvme_submit_sync_cmd() Hannes Reinecke
2023-02-13  6:19   ` Christoph Hellwig
2023-02-13  9:47     ` Sagi Grimberg
2023-02-09 14:38 ` [PATCH 2/5] block: make blk_rq_map_kern() to accept a NULL buffer Hannes Reinecke
2023-02-13  6:21   ` Christoph Hellwig
2023-02-13  9:49   ` Sagi Grimberg
2023-02-09 14:38 ` [PATCH 3/5] nvme: move result handling into nvme_execute_rq() Hannes Reinecke
2023-02-13  9:59   ` Sagi Grimberg
2023-02-13 10:04     ` Hannes Reinecke
2023-02-13 10:08       ` Sagi Grimberg
2023-02-09 14:38 ` [PATCH 4/5] nvme: open-code __nvme_submit_sync_cmd() Hannes Reinecke
2023-02-13  6:26   ` Christoph Hellwig [this message]
2023-02-13 10:07     ` Sagi Grimberg
2023-02-09 14:38 ` [PATCH 5/5] nvme: retry authentication commands if DNR status bit is not set Hannes Reinecke
2023-02-13 10:14   ` Sagi Grimberg
2023-02-13 10:28     ` Hannes Reinecke
2023-02-13 10:33       ` Sagi Grimberg
2023-02-13 13:24         ` Hannes Reinecke
2023-02-13 13:47           ` Sagi Grimberg
2023-02-13 14:07             ` Hannes Reinecke
2023-02-14  9:39               ` Sagi Grimberg

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=20230213062654.GC14223@lst.de \
    --to=hch@lst.de \
    --cc=hare@suse.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --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