public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Mark O'Donovan <shiftee@posteo.net>
To: linux-kernel@vger.kernel.org
Cc: linux-nvme@lists.infradead.org, sagi@grimberg.me, hch@lst.de,
	axboe@kernel.dk, kbusch@kernel.org, hare@suse.de,
	Mark O'Donovan <shiftee@posteo.net>
Subject: [PATCH v2 1/3] nvme-auth: auth success1 msg always includes resp
Date: Mon, 23 Oct 2023 14:00:01 +0000	[thread overview]
Message-ID: <20231023140003.58019-2-shiftee@posteo.net> (raw)
In-Reply-To: <20231023140003.58019-1-shiftee@posteo.net>

In cases where RVALID is false, the response is still transmitted,
but is cleared to zero.

Relevant extract from the spec:
Response R2, if valid (i.e., if the RVALID field is set to 01h),
cleared to 0h otherwise

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

---
v1: used incorrect prefix nvme-tcp
v2: rebase on latest git

 drivers/nvme/host/auth.c | 5 +----
 include/linux/nvme.h     | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c
index 064592a5d546..e0fc33d41baa 100644
--- a/drivers/nvme/host/auth.c
+++ b/drivers/nvme/host/auth.c
@@ -339,10 +339,7 @@ static int nvme_auth_process_dhchap_success1(struct nvme_ctrl *ctrl,
 		struct nvme_dhchap_queue_context *chap)
 {
 	struct nvmf_auth_dhchap_success1_data *data = chap->buf;
-	size_t size = sizeof(*data);
-
-	if (chap->s2)
-		size += chap->hash_len;
+	size_t size = sizeof(*data) + chap->hash_len;
 
 	if (size > CHAP_BUF_SIZE) {
 		chap->status = NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD;
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 26dd3f859d9d..8d8df9c15b74 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -1722,7 +1722,7 @@ struct nvmf_auth_dhchap_success1_data {
 	__u8		rsvd2;
 	__u8		rvalid;
 	__u8		rsvd3[7];
-	/* 'hl' bytes of response value if 'rvalid' is set */
+	/* 'hl' bytes of response value */
 	__u8		rval[];
 };
 
-- 
2.39.2



  reply	other threads:[~2023-10-23 14:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 14:00 [PATCH v2 0/3] nvme-tcp: always set valid seq_num in dhchap reply Mark O'Donovan
2023-10-23 14:00 ` Mark O'Donovan [this message]
2023-10-24  6:49   ` [PATCH v2 1/3] nvme-auth: auth success1 msg always includes resp Christoph Hellwig
2023-10-23 14:00 ` [PATCH v2 2/3] nvme-auth: add flag for bi-directional auth Mark O'Donovan
2023-10-24  6:49   ` Christoph Hellwig
2023-10-25  6:27   ` Hannes Reinecke
2023-10-23 14:00 ` [PATCH v2 3/3] nvme-auth: always set valid seq_num in dhchap reply Mark O'Donovan
2023-10-24  6:49   ` Christoph Hellwig
2023-10-25  6:32   ` Hannes Reinecke
2023-10-24 16:40 ` [PATCH v2 0/3] nvme-tcp: " Keith Busch
2023-10-25  6:33   ` 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=20231023140003.58019-2-shiftee@posteo.net \
    --to=shiftee@posteo.net \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.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