From patchwork Sat Jan 4 04:59:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 13926080 X-Patchwork-Delegate: kw@linux.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B851D14AD3F for ; Sat, 4 Jan 2025 05:00:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735966834; cv=none; b=Nbw0/j0gv/Ug5CpBXriTx130LTSdjkwLX5D5G6Gscrc0DLuPT/BNSIt6HpLWZEqlWhRXY2jtiia35Q6NoLJtVyZ8xwER00FAXTcaJGX7D3/CfFPURaRt0Wjwisb8xgEuXGFo78NwxktshhNLjPgTPijzlIkpqutGKTB+ngMq8WA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735966834; c=relaxed/simple; bh=QXQYPtAUaWOi3c8UNTLNt8QY3FYh0M86WwTt1a18xr0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N3L9AFGpH6lWKICGYnbguCrHMlAHCbpknooL4+lw/g4ZeQX630Km1ARlb+/Lcv8aPrvpS1c4G9jFsTLoy7KVmxNhat+zkJtRW05xz/3p0JstTg3AUh8swPeAbbQ2SBma7Fwu6iTkycu1R/7G2+Qy0poic9zIteu8KlHBr2X0ILQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jxTSqAL8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jxTSqAL8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C1CFC4CED1; Sat, 4 Jan 2025 05:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735966834; bh=QXQYPtAUaWOi3c8UNTLNt8QY3FYh0M86WwTt1a18xr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jxTSqAL8V2hRSsafi4pS83LiathQH4NH38Bk0dub44h5AW7sg1pm/1jI8bMEoX1wX zQNPl0PWANrYpZnnEutkWLfZ9qk83NWz6tl+OOnQa4vbobs8s887IWPBtIHB5Q9Tc9 k8v2uQZUD+Az1H0kz44cX8wYWY3NtqxiizF6A/rdJ+14f6LTnTDkfKW2IL1+qW74Uz hG98wYXW/a32U1K7bdDILBwf6yXe+gyYlY/GPeFmDpT+XPlNVf+dTATlGNo2sLwZfh WKrxapqpJZEoPMiwj6CRTPSEyHQJd+Xt2pCjbdv4mTN5OKN0KO853l/LzDvGm1PJh+ wPqbc6Xu4FDoQ== From: Damien Le Moal To: linux-nvme@lists.infradead.org, Christoph Hellwig , Keith Busch , Sagi Grimberg , linux-pci@vger.kernel.org, Manivannan Sadhasivam , =?utf-8?q?Krzyszt?= =?utf-8?q?of_Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , Lorenzo Pieralisi Cc: Rick Wertenbroek , Niklas Cassel Subject: [PATCH v9 04/18] nvmet: Introduce nvmet_get_cmd_effects_admin() Date: Sat, 4 Jan 2025 13:59:37 +0900 Message-ID: <20250104045951.157830-5-dlemoal@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250104045951.157830-1-dlemoal@kernel.org> References: <20250104045951.157830-1-dlemoal@kernel.org> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In order to have a logically better organized implementation of the effects log page, split out reporting the supported admin commands from nvmet_get_cmd_effects_nvm() into the new function nvmet_get_cmd_effects_admin(). Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Tested-by: Rick Wertenbroek Tested-by: Manivannan Sadhasivam --- drivers/nvme/target/admin-cmd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index b73f5fde4d9e..78478a4a2e4d 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -230,7 +230,7 @@ static void nvmet_execute_get_log_page_smart(struct nvmet_req *req) nvmet_req_complete(req, status); } -static void nvmet_get_cmd_effects_nvm(struct nvme_effects_log *log) +static void nvmet_get_cmd_effects_admin(struct nvme_effects_log *log) { log->acs[nvme_admin_get_log_page] = log->acs[nvme_admin_identify] = @@ -240,7 +240,10 @@ static void nvmet_get_cmd_effects_nvm(struct nvme_effects_log *log) log->acs[nvme_admin_async_event] = log->acs[nvme_admin_keep_alive] = cpu_to_le32(NVME_CMD_EFFECTS_CSUPP); +} +static void nvmet_get_cmd_effects_nvm(struct nvme_effects_log *log) +{ log->iocs[nvme_cmd_read] = log->iocs[nvme_cmd_flush] = log->iocs[nvme_cmd_dsm] = @@ -276,6 +279,7 @@ static void nvmet_execute_get_log_cmd_effects_ns(struct nvmet_req *req) switch (req->cmd->get_log_page.csi) { case NVME_CSI_NVM: + nvmet_get_cmd_effects_admin(log); nvmet_get_cmd_effects_nvm(log); break; case NVME_CSI_ZNS: @@ -283,6 +287,7 @@ static void nvmet_execute_get_log_cmd_effects_ns(struct nvmet_req *req) status = NVME_SC_INVALID_IO_CMD_SET; goto free; } + nvmet_get_cmd_effects_admin(log); nvmet_get_cmd_effects_nvm(log); nvmet_get_cmd_effects_zns(log); break;