From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 099C6C83F12 for ; Mon, 28 Aug 2023 21:30:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233185AbjH1VaC (ORCPT ); Mon, 28 Aug 2023 17:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjH1V3e (ORCPT ); Mon, 28 Aug 2023 17:29:34 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56FD0FC for ; Mon, 28 Aug 2023 14:29:31 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1F82D240029 for ; Mon, 28 Aug 2023 23:29:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1693258169; bh=Fbrv6/1iFxoYEdTeMNow9HZyGp6d2072/70AjKQfGu8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=aqq5QCAxQZCOP00JPCGbAS8JKUmFPql+GGJW/CGvSMRIoSK3GWTObvMbBwgChc30V F8wwYavsX6+VAJ4Yg35dRfcp+cfINvqWAqcCgbwO5e3DEx1PGYQ62CWz3zGsSxpWgN wf4RBKQPirGg+fEQANJ//rDqLxATGKUyeDeAq/ZFYaVU9bMZsVmzCTmxUNYbXaXkBk oEjCi+QYgsVL2nFLY8oCb3cLak1fId7K6HXm3uAxhXIYHYFJCQYJ6TpNJWKz1cLTPp 6H676ky02owvhivD3psKNrnkpkcNKImwTZVW5rVhW/J4z7ZY5g2yvCapmAF0PBWkNL eYwwahQvQRhqA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RZNwv0SkDz9s0P; Mon, 28 Aug 2023 23:29:18 +0200 (CEST) From: Mark O'Donovan 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 Subject: [PATCH 1/2] nvme-tcp: auth success1 msg always includes resp Date: Mon, 28 Aug 2023 21:20:32 +0000 Message-Id: <20230828212033.3244512-1-shiftee@posteo.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 daf5d144a8ea..49f8c46bddf1 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->ctrl_key) - 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