Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp425776pxb; Tue, 14 Sep 2021 00:07:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdZ1UD30mz5dDT6iz9v7l/Umz0VePXDa+Q6DXhhZwOykyd70ZxwQ+3PcRTRYzlfbXAnLxJ X-Received: by 2002:a05:6402:26c6:: with SMTP id x6mr17680551edd.10.1631603220116; Tue, 14 Sep 2021 00:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631603220; cv=none; d=google.com; s=arc-20160816; b=d5Qa3cb6BWEj72Et6bpCKOAzm4yUdNsvzry/oJki/XdnqLDNNeFVw95FzzDF1jGB7W zuE7LiM4wKbZ4D2hvLb2Tg9CJjo7qK/IUxbD1YvG9H3qvUuqHNPEKnx5BmANhWBZs2/9 HiLx0Bv8AF5FUsG5qLxLjpiFA5UphL5rnO1Bi9SJ3YmzSiINKh6D7OWSE8ROQ5vcFg3C uj4J/E0CFe9zZhbmm16qeIpAQV6yxOxubhhrauyFpaICteXERD6GCRvFIUu9fTVeCoVz FT0gJStvejmkwb61ArSm85fbSNRjG2kOueBXJ7jTaRwRFdks3SFxYB1SaG6MqkUhyjAi ltRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ASSw//9AOWQ7NN/5WP5M7iKdi8iqcYmLot2EnNzllx0=; b=izYp5PBSphPK1rZfpZnYTo1YlxMFpav2twISgvWGo05xVqTMu8YXMxJjXcnq5UUo89 wL9tWRb+CyTwzkmQojerDEzBqMNj+OEmWTPTQCX1qX/89J9BdSCmgdQXJsQ3kBC4eTYS xb0hCQ74C+wxyAnUoRmeHgAHAatoQ8nSpYT4S3xfJLedClEKVkbkR9iHxLpM+XSB+rc1 xh3LMpl370gR7qlmFehQsyCtJ0h7J8evoceCNNWaumrexa7I3zsH0Vj+tfOI0Z6QHbkC AFggIqgHS8yMQkd98Yr72JW3EzNzmTj9VEiTeY4T7cOTRn5QDZZtRZNY7z4zEhsUDSSD Nvxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ml21si9724487ejb.585.2021.09.14.00.06.26; Tue, 14 Sep 2021 00:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240468AbhINHH3 (ORCPT + 99 others); Tue, 14 Sep 2021 03:07:29 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:38612 "EHLO mail-wr1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240490AbhINHH2 (ORCPT ); Tue, 14 Sep 2021 03:07:28 -0400 Received: by mail-wr1-f51.google.com with SMTP id u16so18476983wrn.5 for ; Tue, 14 Sep 2021 00:06:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ASSw//9AOWQ7NN/5WP5M7iKdi8iqcYmLot2EnNzllx0=; b=MIQZOp0SYnbs2EJzEFEsx1y/kW8BrXBnbIzTxEy50vREtDOc3o0DFhElq+/4cv3xTV 2puXWHaXrae9A+9OrxLaM2ZvOOQyia2CT5FlZFThWO2/dqnhqgwUfZ699tpPVcNQBz7u Ib3QNiATNL6XERtEfW9j4C2154+9M8oxFkMzGce1rSlLMG2twaQoVWhD6s+ztBfidkVu otsd117NWSwOBKXBqWD5hMSfkDoG/Hxe7ZXEoj7yMqmnQ2JxPupkhMGumKLftEey7biC danUf6RcSz2PnkMD6Ek9tHB01NrYPBAIDDvkR26gX2i+6AAWyLXv4j28NMsIyPdmShCL y4hg== X-Gm-Message-State: AOAM532X5uvD6Jlhox/ZvU2t9U9tlwsTPPh4ZXJ/McCMpRwmZudxXPXR j7q8G6zJCCmk+TqeSwS4HoaiZBYCpTM= X-Received: by 2002:adf:eb4f:: with SMTP id u15mr16598752wrn.352.1631603170982; Tue, 14 Sep 2021 00:06:10 -0700 (PDT) Received: from [192.168.64.123] (bzq-219-42-90.isdn.bezeqint.net. [62.219.42.90]) by smtp.gmail.com with ESMTPSA id n66sm239555wmn.2.2021.09.14.00.06.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Sep 2021 00:06:10 -0700 (PDT) Subject: Re: [PATCH 07/12] nvme: Implement In-Band authentication To: Hannes Reinecke , Christoph Hellwig Cc: Keith Busch , Herbert Xu , "David S . Miller" , linux-nvme@lists.infradead.org, linux-crypto@vger.kernel.org References: <20210910064322.67705-1-hare@suse.de> <20210910064322.67705-8-hare@suse.de> <99cbf790-c276-b3d0-6140-1f5bfa8665eb@grimberg.me> <8bff9a88-a5d4-d7bb-8ce9-81d30438bfbb@suse.de> From: Sagi Grimberg Message-ID: <6eeae78a-a4eb-bb18-6cad-273e1a21050a@grimberg.me> Date: Tue, 14 Sep 2021 10:06:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <8bff9a88-a5d4-d7bb-8ce9-81d30438bfbb@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org >>> @@ -361,11 +366,13 @@ static inline void nvme_end_req(struct request >>> *req) >>>     void nvme_complete_rq(struct request *req) >>>   { >>> +    struct nvme_ctrl *ctrl = nvme_req(req)->ctrl; >>> + >>>       trace_nvme_complete_rq(req); >>>       nvme_cleanup_cmd(req); >>>   -    if (nvme_req(req)->ctrl->kas) >>> -        nvme_req(req)->ctrl->comp_seen = true; >>> +    if (ctrl->kas) >>> +        ctrl->comp_seen = true; >>>         switch (nvme_decide_disposition(req)) { >>>       case COMPLETE: >>> @@ -377,6 +384,15 @@ void nvme_complete_rq(struct request *req) >>>       case FAILOVER: >>>           nvme_failover_req(req); >>>           return; >>> +    case AUTHENTICATE: >>> +#ifdef CONFIG_NVME_AUTH >>> +        if (nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING)) >>> +            queue_work(nvme_wq, &ctrl->dhchap_auth_work); >> >> Why is the state change here and not in nvme_dhchap_auth_work? >> > Because switching to 'resetting' is an easy way to synchronize with the > admin queue. Maybe fold this into nvme_authenticate_ctrl? in case someone adds/moves this in the future and forgets the ctrl state serialization?