Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	"hare@suse.de" <hare@suse.de>
Cc: "kbusch@kernel.org" <kbusch@kernel.org>,
	"hch@lst.de" <hch@lst.de>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH 1/3] nvme-fabrics: factor out auth code into helper
Date: Tue, 23 Apr 2024 19:57:30 +0000	[thread overview]
Message-ID: <f9a83465-35eb-47d3-b279-826308132ff7@nvidia.com> (raw)
In-Reply-To: <aa43242d-a460-4fc2-9802-bc68f050dd01@grimberg.me>

On 4/18/24 02:30, Sagi Grimberg wrote:
>
>
> On 08/02/2024 8:24, Chaitanya Kulkarni wrote:
>> Post connect command authentication handling code is repeated into in
>> nvmf_connect_admin_queue() and nvmf_connect_io_queue().
>>
>> Add a helper to handle post connect command authentication helper. Use
>> the same helper in nvmf_connect_admin_queue(). This also removes
>> authentication specific code from a build where authentication feature
>> is not configured.
>>
>> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
>> ---
>>   drivers/nvme/host/auth.c    | 32 ++++++++++++++++++++++++++++++++
>>   drivers/nvme/host/fabrics.c | 25 +------------------------
>>   drivers/nvme/host/nvme.h    |  8 ++++++++
>>   3 files changed, 41 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
>> index 3dce480d932e..159071462738 100644
>> --- a/drivers/nvme/host/auth.c
>> +++ b/drivers/nvme/host/auth.c
>> @@ -988,6 +988,38 @@ void nvme_auth_stop(struct nvme_ctrl *ctrl)
>>   }
>>   EXPORT_SYMBOL_GPL(nvme_auth_stop);
>>   +u16 nvme_auth_post_connect(struct nvme_ctrl *ctrl, u16 qid, u32 
>> result)
>> +{
>> +    int ret;
>> +
>> +    if (!(result & (NVME_CONNECT_AUTHREQ_ATR | 
>> NVME_CONNECT_AUTHREQ_ASCR)))
>> +        return NVME_SC_SUCCESS;
>
> I really dislike functions that may or may not do anything. I vote 
> that we avoid
> as much as possible.
>
> How about calling the function nvme_authenticate_queue() and more the 
> above
> condition to the call-site? 


sounds good, will send v2, thanks for the comments.

-ck



  reply	other threads:[~2024-04-23 19:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08  6:24 [PATCH 0/3] nvme-fabrics: add post connect auth code helper Chaitanya Kulkarni
2024-02-08  6:24 ` [PATCH 1/3] nvme-fabrics: factor out auth code into helper Chaitanya Kulkarni
2024-04-18  9:30   ` Sagi Grimberg
2024-04-23 19:57     ` Chaitanya Kulkarni [this message]
2024-05-23  9:35   ` Hannes Reinecke
2024-02-08  6:24 ` [PATCH 2/3] nvme-fabrics: use post connect auth helper Chaitanya Kulkarni
2024-04-18  9:31   ` Sagi Grimberg
2024-05-23  9:39   ` Hannes Reinecke
2024-02-08  6:24 ` [PATCH 3/3] nvme-auth: unexport negotiate and wait functions Chaitanya Kulkarni
2024-04-18  9:32   ` Sagi Grimberg
2024-05-23  9:40   ` Hannes Reinecke
2024-04-16  3:53 ` [PATCH 0/3] nvme-fabrics: add post connect auth code helper Chaitanya Kulkarni
2024-04-18  4:24   ` Chaitanya Kulkarni

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=f9a83465-35eb-47d3-b279-826308132ff7@nvidia.com \
    --to=chaitanyak@nvidia.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