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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD4E7E77188 for ; Sat, 4 Jan 2025 05:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6oqYk9IxcO4WFmnm83mOoKqci8Yv2a8clO8Wu/dSMYQ=; b=vF6smiZ4x3MvnlHJ5OnuNoDl4H z4JcylJRr55ecg1hnsbMruh2IOQsj3NuSdpwpdq71RDgwe2h0asYmb+HNwVOzI7b6vrj3LotEN9GE PSKy9gtQZJkd6qniictsLRMaGVV92xkRkc8r8dFI+DSg01eNbHynXU0bZ0geygJQD/BkWjC4/OgbG XkpcD5H+yuUjq6gN+GaHlzs3DmmEOTlhvkXFdoPMQgh+b4iWM/+TiOIIbtYAE+9GNW61A1OuORppH htqZRhNVp2JhRVPsoXF5KQMQOWcH3OKml6uF1yDX6kvKOROBvLcpsi7zY0UcRbYoEpbjryn/vvgOr NgEZI4lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTwH8-0000000ETiN-2Lm9; Sat, 04 Jan 2025 05:00:38 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTwH5-0000000ETez-2BV7 for linux-nvme@lists.infradead.org; Sat, 04 Jan 2025 05:00:36 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id AAF5AA40244; Sat, 4 Jan 2025 04:58:45 +0000 (UTC) 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?Krzysztof=20Wilczy=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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_210035_625526_4C66641D X-CRM114-Status: GOOD ( 10.83 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org 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; -- 2.47.1