* [PATCH V2 1/4] nvmet-auth: use common helper to check secp/spsp
2023-06-05 6:44 [PATCH V2 0/4] nvmet-auth: auth send / receive cleanup Chaitanya Kulkarni
@ 2023-06-05 6:44 ` Chaitanya Kulkarni
2023-06-05 7:42 ` Hannes Reinecke
2023-06-05 6:44 ` [PATCH V2 2/4] nvmet_auth: use common helper for buffer alloc Chaitanya Kulkarni
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Chaitanya Kulkarni @ 2023-06-05 6:44 UTC (permalink / raw)
To: hare; +Cc: hch, sagi, linux-nvme, kbusch, Chaitanya Kulkarni
Add a common helper to factor out secp/spsp values check in
nvmet_execute_auth_send() and nvmet_execute_auth_receive().
No functional change in this patch.
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/fabrics-cmd-auth.c | 60 +++++++++++---------------
1 file changed, 24 insertions(+), 36 deletions(-)
diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
index 586458f765f1..42594e086de7 100644
--- a/drivers/nvme/target/fabrics-cmd-auth.c
+++ b/drivers/nvme/target/fabrics-cmd-auth.c
@@ -12,6 +12,23 @@
#include <crypto/kpp.h>
#include "nvmet.h"
+static u16 nvmet_auth_check_secp_spsp(struct nvmet_req *req)
+{
+ if (req->cmd->auth_send.secp != NVME_AUTH_DHCHAP_PROTOCOL_IDENTIFIER) {
+ req->error_loc = offsetof(struct nvmf_auth_send_command, secp);
+ return NVME_SC_INVALID_FIELD | NVME_SC_DNR;
+ }
+ if (req->cmd->auth_send.spsp0 != 0x01) {
+ req->error_loc = offsetof(struct nvmf_auth_send_command, spsp0);
+ return NVME_SC_INVALID_FIELD | NVME_SC_DNR;
+ }
+ if (req->cmd->auth_send.spsp1 != 0x01) {
+ req->error_loc = offsetof(struct nvmf_auth_send_command, spsp1);
+ return NVME_SC_INVALID_FIELD | NVME_SC_DNR;
+ }
+ return NVME_SC_SUCCESS;
+}
+
static void nvmet_auth_expired_work(struct work_struct *work)
{
struct nvmet_sq *sq = container_of(to_delayed_work(work),
@@ -185,26 +202,12 @@ void nvmet_execute_auth_send(struct nvmet_req *req)
struct nvmf_auth_dhchap_success2_data *data;
void *d;
u32 tl;
- u16 status = 0;
+ u16 status;
- if (req->cmd->auth_send.secp != NVME_AUTH_DHCHAP_PROTOCOL_IDENTIFIER) {
- status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
- req->error_loc =
- offsetof(struct nvmf_auth_send_command, secp);
- goto done;
- }
- if (req->cmd->auth_send.spsp0 != 0x01) {
- status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
- req->error_loc =
- offsetof(struct nvmf_auth_send_command, spsp0);
- goto done;
- }
- if (req->cmd->auth_send.spsp1 != 0x01) {
- status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
- req->error_loc =
- offsetof(struct nvmf_auth_send_command, spsp1);
+ status = nvmet_auth_check_secp_spsp(req);
+ if (status)
goto done;
- }
+
tl = le32_to_cpu(req->cmd->auth_send.tl);
if (!tl) {
status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
@@ -432,26 +435,11 @@ void nvmet_execute_auth_receive(struct nvmet_req *req)
struct nvmet_ctrl *ctrl = req->sq->ctrl;
void *d;
u32 al;
- u16 status = 0;
+ u16 status;
- if (req->cmd->auth_receive.secp != NVME_AUTH_DHCHAP_PROTOCOL_IDENTIFIER) {
- status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
- req->error_loc =
- offsetof(struct nvmf_auth_receive_command, secp);
- goto done;
- }
- if (req->cmd->auth_receive.spsp0 != 0x01) {
- status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
- req->error_loc =
- offsetof(struct nvmf_auth_receive_command, spsp0);
- goto done;
- }
- if (req->cmd->auth_receive.spsp1 != 0x01) {
- status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
- req->error_loc =
- offsetof(struct nvmf_auth_receive_command, spsp1);
+ status = nvmet_auth_check_secp_spsp(req);
+ if (status)
goto done;
- }
al = le32_to_cpu(req->cmd->auth_receive.al);
if (!al) {
status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
--
2.40.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH V2 1/4] nvmet-auth: use common helper to check secp/spsp
2023-06-05 6:44 ` [PATCH V2 1/4] nvmet-auth: use common helper to check secp/spsp Chaitanya Kulkarni
@ 2023-06-05 7:42 ` Hannes Reinecke
0 siblings, 0 replies; 12+ messages in thread
From: Hannes Reinecke @ 2023-06-05 7:42 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: hch, sagi, linux-nvme, kbusch
On 6/5/23 08:44, Chaitanya Kulkarni wrote:
> Add a common helper to factor out secp/spsp values check in
> nvmet_execute_auth_send() and nvmet_execute_auth_receive().
>
> No functional change in this patch.
>
> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/nvme/target/fabrics-cmd-auth.c | 60 +++++++++++---------------
> 1 file changed, 24 insertions(+), 36 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH V2 2/4] nvmet_auth: use common helper for buffer alloc
2023-06-05 6:44 [PATCH V2 0/4] nvmet-auth: auth send / receive cleanup Chaitanya Kulkarni
2023-06-05 6:44 ` [PATCH V2 1/4] nvmet-auth: use common helper to check secp/spsp Chaitanya Kulkarni
@ 2023-06-05 6:44 ` Chaitanya Kulkarni
2023-06-05 7:45 ` Hannes Reinecke
2023-06-05 6:44 ` [PATCH V2 3/4] nvmet-auth: use helper for auth send/recv cmd prep Chaitanya Kulkarni
2023-06-05 6:44 ` [PATCH V2 4/4] nvmet-auth: use correct type for status variable Chaitanya Kulkarni
3 siblings, 1 reply; 12+ messages in thread
From: Chaitanya Kulkarni @ 2023-06-05 6:44 UTC (permalink / raw)
To: hare; +Cc: hch, sagi, linux-nvme, kbusch, Chaitanya Kulkarni
Add a common helper to factor out buffer allocation in
nvmet_execute_auth_send() and nvmet_execute_auth_receive().
Only functional change in this patch is transfer buffer allocation is
moved before nvmet_check_transfer_len() and it is freed if when
nvmet_check_transfer_len() fails. But similar allocation and free is
used in error unwind path in nvme code and it is not in fast path, so
it shuold be fine.
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/fabrics-cmd-auth.c | 43 ++++++++++++--------------
1 file changed, 19 insertions(+), 24 deletions(-)
diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
index 42594e086de7..778961e231a3 100644
--- a/drivers/nvme/target/fabrics-cmd-auth.c
+++ b/drivers/nvme/target/fabrics-cmd-auth.c
@@ -29,6 +29,18 @@ static u16 nvmet_auth_check_secp_spsp(struct nvmet_req *req)
return NVME_SC_SUCCESS;
}
+static u16 nvmet_auth_alloc_transfer_buffer(struct nvmet_req *req, void **buf,
+ u32 *len)
+{
+ *len = le32_to_cpu(req->cmd->auth_receive.al);
+ if (!*len) {
+ req->error_loc = offsetof(struct nvmf_auth_receive_command, al);
+ return NVME_SC_INVALID_FIELD | NVME_SC_DNR;
+ }
+ *buf = kmalloc(*len, GFP_KERNEL);
+ return *buf ? NVME_SC_SUCCESS : NVME_SC_INTERNAL;
+}
+
static void nvmet_auth_expired_work(struct work_struct *work)
{
struct nvmet_sq *sq = container_of(to_delayed_work(work),
@@ -207,25 +219,16 @@ void nvmet_execute_auth_send(struct nvmet_req *req)
status = nvmet_auth_check_secp_spsp(req);
if (status)
goto done;
-
- tl = le32_to_cpu(req->cmd->auth_send.tl);
- if (!tl) {
- status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
- req->error_loc =
- offsetof(struct nvmf_auth_send_command, tl);
+ status = nvmet_auth_alloc_transfer_buffer(req, &d, &tl);
+ if (status)
goto done;
- }
+
if (!nvmet_check_transfer_len(req, tl)) {
pr_debug("%s: transfer length mismatch (%u)\n", __func__, tl);
+ kfree(d);
return;
}
- d = kmalloc(tl, GFP_KERNEL);
- if (!d) {
- status = NVME_SC_INTERNAL;
- goto done;
- }
-
status = nvmet_copy_from_sgl(req, 0, d, tl);
if (status)
goto done_kfree;
@@ -440,23 +443,15 @@ void nvmet_execute_auth_receive(struct nvmet_req *req)
status = nvmet_auth_check_secp_spsp(req);
if (status)
goto done;
- al = le32_to_cpu(req->cmd->auth_receive.al);
- if (!al) {
- status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
- req->error_loc =
- offsetof(struct nvmf_auth_receive_command, al);
+ status = nvmet_auth_alloc_transfer_buffer(req, &d, &al);
+ if (status)
goto done;
- }
if (!nvmet_check_transfer_len(req, al)) {
pr_debug("%s: transfer length mismatch (%u)\n", __func__, al);
+ kfree(d);
return;
}
- d = kmalloc(al, GFP_KERNEL);
- if (!d) {
- status = NVME_SC_INTERNAL;
- goto done;
- }
pr_debug("%s: ctrl %d qid %d step %x\n", __func__,
ctrl->cntlid, req->sq->qid, req->sq->dhchap_step);
switch (req->sq->dhchap_step) {
--
2.40.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH V2 2/4] nvmet_auth: use common helper for buffer alloc
2023-06-05 6:44 ` [PATCH V2 2/4] nvmet_auth: use common helper for buffer alloc Chaitanya Kulkarni
@ 2023-06-05 7:45 ` Hannes Reinecke
0 siblings, 0 replies; 12+ messages in thread
From: Hannes Reinecke @ 2023-06-05 7:45 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: hch, sagi, linux-nvme, kbusch
On 6/5/23 08:44, Chaitanya Kulkarni wrote:
> Add a common helper to factor out buffer allocation in
> nvmet_execute_auth_send() and nvmet_execute_auth_receive().
>
> Only functional change in this patch is transfer buffer allocation is
> moved before nvmet_check_transfer_len() and it is freed if when
> nvmet_check_transfer_len() fails. But similar allocation and free is
> used in error unwind path in nvme code and it is not in fast path, so
> it shuold be fine.
>
> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/nvme/target/fabrics-cmd-auth.c | 43 ++++++++++++--------------
> 1 file changed, 19 insertions(+), 24 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH V2 3/4] nvmet-auth: use helper for auth send/recv cmd prep
2023-06-05 6:44 [PATCH V2 0/4] nvmet-auth: auth send / receive cleanup Chaitanya Kulkarni
2023-06-05 6:44 ` [PATCH V2 1/4] nvmet-auth: use common helper to check secp/spsp Chaitanya Kulkarni
2023-06-05 6:44 ` [PATCH V2 2/4] nvmet_auth: use common helper for buffer alloc Chaitanya Kulkarni
@ 2023-06-05 6:44 ` Chaitanya Kulkarni
2023-06-05 7:46 ` Hannes Reinecke
2023-06-07 4:57 ` Christoph Hellwig
2023-06-05 6:44 ` [PATCH V2 4/4] nvmet-auth: use correct type for status variable Chaitanya Kulkarni
3 siblings, 2 replies; 12+ messages in thread
From: Chaitanya Kulkarni @ 2023-06-05 6:44 UTC (permalink / raw)
To: hare; +Cc: hch, sagi, linux-nvme, kbusch, Chaitanya Kulkarni
Add a common helper to factor out secp/spsp values check and transfer
buffer allocation in nvmet_execute_auth_send() and
nvmet_execute_auth_receive().
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
drivers/nvme/target/fabrics-cmd-auth.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
index 778961e231a3..d331c22ed26e 100644
--- a/drivers/nvme/target/fabrics-cmd-auth.c
+++ b/drivers/nvme/target/fabrics-cmd-auth.c
@@ -41,6 +41,15 @@ static u16 nvmet_auth_alloc_transfer_buffer(struct nvmet_req *req, void **buf,
return *buf ? NVME_SC_SUCCESS : NVME_SC_INTERNAL;
}
+static u16 nvmet_auth_common_prep(struct nvmet_req *req, void **buf, u32 *len)
+{
+ u16 status = nvmet_auth_check_secp_spsp(req);
+
+ if (status)
+ return status;
+ return nvmet_auth_alloc_transfer_buffer(req, buf, len);
+}
+
static void nvmet_auth_expired_work(struct work_struct *work)
{
struct nvmet_sq *sq = container_of(to_delayed_work(work),
@@ -216,10 +225,7 @@ void nvmet_execute_auth_send(struct nvmet_req *req)
u32 tl;
u16 status;
- status = nvmet_auth_check_secp_spsp(req);
- if (status)
- goto done;
- status = nvmet_auth_alloc_transfer_buffer(req, &d, &tl);
+ status = nvmet_auth_common_prep(req, &d, &tl);
if (status)
goto done;
@@ -440,10 +446,7 @@ void nvmet_execute_auth_receive(struct nvmet_req *req)
u32 al;
u16 status;
- status = nvmet_auth_check_secp_spsp(req);
- if (status)
- goto done;
- status = nvmet_auth_alloc_transfer_buffer(req, &d, &al);
+ status = nvmet_auth_common_prep(req, &d, &al);
if (status)
goto done;
if (!nvmet_check_transfer_len(req, al)) {
--
2.40.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH V2 3/4] nvmet-auth: use helper for auth send/recv cmd prep
2023-06-05 6:44 ` [PATCH V2 3/4] nvmet-auth: use helper for auth send/recv cmd prep Chaitanya Kulkarni
@ 2023-06-05 7:46 ` Hannes Reinecke
2023-06-05 8:41 ` Chaitanya Kulkarni
2023-06-07 4:57 ` Christoph Hellwig
1 sibling, 1 reply; 12+ messages in thread
From: Hannes Reinecke @ 2023-06-05 7:46 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: hch, sagi, linux-nvme, kbusch
On 6/5/23 08:44, Chaitanya Kulkarni wrote:
> Add a common helper to factor out secp/spsp values check and transfer
> buffer allocation in nvmet_execute_auth_send() and
> nvmet_execute_auth_receive().
>
> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
> ---
> drivers/nvme/target/fabrics-cmd-auth.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
> index 778961e231a3..d331c22ed26e 100644
> --- a/drivers/nvme/target/fabrics-cmd-auth.c
> +++ b/drivers/nvme/target/fabrics-cmd-auth.c
> @@ -41,6 +41,15 @@ static u16 nvmet_auth_alloc_transfer_buffer(struct nvmet_req *req, void **buf,
> return *buf ? NVME_SC_SUCCESS : NVME_SC_INTERNAL;
> }
>
> +static u16 nvmet_auth_common_prep(struct nvmet_req *req, void **buf, u32 *len)
> +{
> + u16 status = nvmet_auth_check_secp_spsp(req);
> +
> + if (status)
> + return status;
> + return nvmet_auth_alloc_transfer_buffer(req, buf, len);
> +}
> +
A wrapper for a wrapper?
Please move nvmet_auch_check_secp_spsp() tion
nvmet_auth_alloc_tranfer_buffer().
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 3/4] nvmet-auth: use helper for auth send/recv cmd prep
2023-06-05 7:46 ` Hannes Reinecke
@ 2023-06-05 8:41 ` Chaitanya Kulkarni
0 siblings, 0 replies; 12+ messages in thread
From: Chaitanya Kulkarni @ 2023-06-05 8:41 UTC (permalink / raw)
To: Hannes Reinecke, Chaitanya Kulkarni; +Cc: hch, sagi, linux-nvme, kbusch
On 6/5/23 00:46, Hannes Reinecke wrote:
> On 6/5/23 08:44, Chaitanya Kulkarni wrote:
>> Add a common helper to factor out secp/spsp values check and transfer
>> buffer allocation in nvmet_execute_auth_send() and
>> nvmet_execute_auth_receive().
>>
>> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
>> ---
>> drivers/nvme/target/fabrics-cmd-auth.c | 19 +++++++++++--------
>> 1 file changed, 11 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/nvme/target/fabrics-cmd-auth.c
>> b/drivers/nvme/target/fabrics-cmd-auth.c
>> index 778961e231a3..d331c22ed26e 100644
>> --- a/drivers/nvme/target/fabrics-cmd-auth.c
>> +++ b/drivers/nvme/target/fabrics-cmd-auth.c
>> @@ -41,6 +41,15 @@ static u16 nvmet_auth_alloc_transfer_buffer(struct
>> nvmet_req *req, void **buf,
>> return *buf ? NVME_SC_SUCCESS : NVME_SC_INTERNAL;
>> }
>> +static u16 nvmet_auth_common_prep(struct nvmet_req *req, void
>> **buf, u32 *len)
>> +{
>> + u16 status = nvmet_auth_check_secp_spsp(req);
>> +
>> + if (status)
>> + return status;
>> + return nvmet_auth_alloc_transfer_buffer(req, buf, len);
>> +}
>> +
> A wrapper for a wrapper?
> Please move nvmet_auch_check_secp_spsp() tion
> nvmet_auth_alloc_tranfer_buffer().
>
> Cheers,
>
> Hannes
checking secp and spsp and allocating memory are two different things,
let me restructure this series to remove this wrapper...
-ck
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 3/4] nvmet-auth: use helper for auth send/recv cmd prep
2023-06-05 6:44 ` [PATCH V2 3/4] nvmet-auth: use helper for auth send/recv cmd prep Chaitanya Kulkarni
2023-06-05 7:46 ` Hannes Reinecke
@ 2023-06-07 4:57 ` Christoph Hellwig
1 sibling, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2023-06-07 4:57 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: hare, hch, sagi, linux-nvme, kbusch
On Sun, Jun 04, 2023 at 11:44:33PM -0700, Chaitanya Kulkarni wrote:
> Add a common helper to factor out secp/spsp values check and transfer
> buffer allocation in nvmet_execute_auth_send() and
> nvmet_execute_auth_receive().
While the patch looks correct, I can't say I really like. Having a
"common prep" function for just two unrelated things doesn't exactly
improve readability. And it also doesn't remove all that much code.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH V2 4/4] nvmet-auth: use correct type for status variable
2023-06-05 6:44 [PATCH V2 0/4] nvmet-auth: auth send / receive cleanup Chaitanya Kulkarni
` (2 preceding siblings ...)
2023-06-05 6:44 ` [PATCH V2 3/4] nvmet-auth: use helper for auth send/recv cmd prep Chaitanya Kulkarni
@ 2023-06-05 6:44 ` Chaitanya Kulkarni
2023-06-05 7:49 ` Hannes Reinecke
2023-06-07 4:58 ` Christoph Hellwig
3 siblings, 2 replies; 12+ messages in thread
From: Chaitanya Kulkarni @ 2023-06-05 6:44 UTC (permalink / raw)
To: hare; +Cc: hch, sagi, linux-nvme, kbusch, Chaitanya Kulkarni
In structructure nvmet_sq dhchap_step member is responsible to hold
following values :-
NVME_AUTH_DHCHAP_FAILURE_FAILED = 0x01,
NVME_AUTH_DHCHAP_FAILURE_NOT_USABLE = 0x02,
NVME_AUTH_DHCHAP_FAILURE_CONCAT_MISMATCH = 0x03,
NVME_AUTH_DHCHAP_FAILURE_HASH_UNUSABLE = 0x04,
NVME_AUTH_DHCHAP_FAILURE_DHGROUP_UNUSABLE = 0x05,
NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD = 0x06,
NVME_AUTH_DHCHAP_FAILURE_INCORRECT_MESSAGE = 0x07,
These values can never be negative, hence change int type of
dhchap_step to u16 in the nvmet_sq declaration.
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
drivers/nvme/target/nvmet.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
index 6cf723bc664e..66d8673c3ebf 100644
--- a/drivers/nvme/target/nvmet.h
+++ b/drivers/nvme/target/nvmet.h
@@ -113,7 +113,7 @@ struct nvmet_sq {
struct delayed_work auth_expired_work;
u16 dhchap_tid;
u16 dhchap_status;
- int dhchap_step;
+ u16 dhchap_step;
u8 *dhchap_c1;
u8 *dhchap_c2;
u32 dhchap_s1;
--
2.40.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH V2 4/4] nvmet-auth: use correct type for status variable
2023-06-05 6:44 ` [PATCH V2 4/4] nvmet-auth: use correct type for status variable Chaitanya Kulkarni
@ 2023-06-05 7:49 ` Hannes Reinecke
2023-06-07 4:58 ` Christoph Hellwig
1 sibling, 0 replies; 12+ messages in thread
From: Hannes Reinecke @ 2023-06-05 7:49 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: hch, sagi, linux-nvme, kbusch
On 6/5/23 08:44, Chaitanya Kulkarni wrote:
> In structructure nvmet_sq dhchap_step member is responsible to hold
Spelling.
Also please drop the 'is responsible for' to just read:
'The dhchap_step member of structure nvmet_sq holds the following values:'
> following values :-
>
> NVME_AUTH_DHCHAP_FAILURE_FAILED = 0x01,
> NVME_AUTH_DHCHAP_FAILURE_NOT_USABLE = 0x02,
> NVME_AUTH_DHCHAP_FAILURE_CONCAT_MISMATCH = 0x03,
> NVME_AUTH_DHCHAP_FAILURE_HASH_UNUSABLE = 0x04,
> NVME_AUTH_DHCHAP_FAILURE_DHGROUP_UNUSABLE = 0x05,
> NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD = 0x06,
> NVME_AUTH_DHCHAP_FAILURE_INCORRECT_MESSAGE = 0x07,
>
> These values can never be negative, hence change int type of
> dhchap_step to u16 in the nvmet_sq declaration.
>
> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
> ---
> drivers/nvme/target/nvmet.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Otherwise the patch is okay.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH V2 4/4] nvmet-auth: use correct type for status variable
2023-06-05 6:44 ` [PATCH V2 4/4] nvmet-auth: use correct type for status variable Chaitanya Kulkarni
2023-06-05 7:49 ` Hannes Reinecke
@ 2023-06-07 4:58 ` Christoph Hellwig
1 sibling, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2023-06-07 4:58 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: hare, hch, sagi, linux-nvme, kbusch
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 12+ messages in thread