public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Kanchan Joshi <joshi.k@samsung.com>
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 1/3] nvme: split __nvme_submit_sync_cmd()
Date: Wed, 8 Feb 2023 19:40:36 +0530	[thread overview]
Message-ID: <20230208141036.GB13408@green5> (raw)
In-Reply-To: <20230208084939.145257-2-hare@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1585 bytes --]

On Wed, Feb 08, 2023 at 09:49:37AM +0100, Hannes Reinecke wrote:
>Split a __nvme_alloc_rq() function from __nvme_submit_sync_cmd()
>to reduce the number of arguments.
>
>Signed-off-by: Hannes Reinecke <hare@suse.de>
>---
> drivers/nvme/host/auth.c       |  9 ++++--
> drivers/nvme/host/core.c       | 59 ++++++++++++++++++++++------------
> drivers/nvme/host/fabrics.c    | 42 ++++++++++++++++++------
> drivers/nvme/host/nvme.h       |  8 ++---
> drivers/nvme/host/pci.c        |  8 ++---
> drivers/nvme/target/passthru.c |  3 +-
> 6 files changed, 85 insertions(+), 44 deletions(-)
>
>diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
>index 787537454f7f..cbb6f1cb2046 100644
>--- a/drivers/nvme/host/auth.c
>+++ b/drivers/nvme/host/auth.c
>@@ -62,6 +62,7 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,
> 	struct nvme_command cmd = {};
> 	blk_mq_req_flags_t flags = nvme_auth_flags_from_qid(qid);
> 	struct request_queue *q = nvme_auth_queue_from_qid(ctrl, qid);
>+	struct request *req;
> 	int ret;
>
> 	cmd.auth_common.opcode = nvme_fabrics_command;
>@@ -76,9 +77,11 @@ static int nvme_auth_submit(struct nvme_ctrl *ctrl, int qid,
> 		cmd.auth_receive.al = cpu_to_le32(data_len);
> 	}
>
>-	ret = __nvme_submit_sync_cmd(q, &cmd, NULL, data, data_len,
>-				     qid == 0 ? NVME_QID_ANY : qid,
>-				     0, flags);
>+	req = __nvme_alloc_rq(q, &cmd, qid == 0 ? NVME_QID_ANY : qid, flags);
>+	if (IS_ERR(req))
>+		return PTR_ERR(req);
>+
>+	ret = __nvme_submit_sync_cmd(q, req, NULL, data, data_len, 0);

First argument 'q' of above can also be killed.

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2023-02-08 14:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08  8:49 [PATCH 0/3] nvme: rework __nvme_submit_sync_cmd() Hannes Reinecke
2023-02-08  8:49 ` [PATCH 1/3] nvme: split __nvme_submit_sync_cmd() Hannes Reinecke
2023-02-08 14:10   ` Kanchan Joshi [this message]
2023-02-08 15:03     ` Hannes Reinecke
2023-02-08  8:49 ` [PATCH 2/3] nvme: retry internal commands if DNR status bit is not set Hannes Reinecke
2023-02-08 14:02   ` Kanchan Joshi
2023-02-08 14:58     ` Hannes Reinecke
2023-02-08  8:49 ` [PATCH 3/3] nvme: make 'at_head' parameter for __nvme_submit_sync_cmd() boolean Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2023-02-08 15:17 [PATCHv2 0/3] nvme: rework __nvme_submit_sync_cmd() Hannes Reinecke
2023-02-08 15:17 ` [PATCH 1/3] nvme: split __nvme_submit_sync_cmd() Hannes Reinecke
2023-02-09  5:33   ` Christoph Hellwig
2023-02-09  7:58     ` Hannes Reinecke

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=20230208141036.GB13408@green5 \
    --to=joshi.k@samsung.com \
    --cc=hare@suse.de \
    --cc=hch@lst.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