Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53598C433EF for ; Mon, 6 Sep 2021 01:24:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2550461076 for ; Mon, 6 Sep 2021 01:24:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2550461076 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jsf8W5PiRDsCEIPSInmTWDo8I+2dlm5vLMtRjl0so/Q=; b=ry6ZHn7bkA4IWb wVwrJDatQqb4NuQ3GZZXajWrqN0ubmx08BbZ0sIZ7Q8MUi2GBUynKBKfI6NRn1jch+CEw1EiJhmPR MMpv1rTKdPz8FncB5XUFU8MKq31p0CFphYHuIU1Y6z4cpECou3RqvH5fck3HFBCG8SkOBNdJfeGX6 C89ZrweZeppXC8XFauuJNaZPQdLS6Jo9RZeYCFo3N5z5ex7DCDYh2UHu9GWRAcEfOVZO6l1vvhUqj NmlRIp9ll7WlvzPzqQVmTRVZnq1eIpHOvU10CDGv0ROw/rXJX1UNbqpMhkWt4JbUpnouA6OTy6HN3 SIG6t3uhS2sljeBlkFOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mN3NT-00GvMM-37; Mon, 06 Sep 2021 01:24:51 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mN3L1-00GuIY-LE for linux-nvme@lists.infradead.org; Mon, 06 Sep 2021 01:22:21 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA96261156; Mon, 6 Sep 2021 01:22:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630891339; bh=srCEX5hDH1f1BlauxJ8yXAYw6/Hk5sS8nPcQ4WwwupE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CMIMRwpnJIEDuVg8UedO5CjYG6TwnlF+JHOFoeUpWEnUSnPiY7mC4KjQ4cE0t50KR yOUIEyVdpgiD1gvmeyl8mQc8EW/O6m5c1ioNsl/81sDc7gj+bYccOz9DSB7z4WGbz9 t2eu54mSgSQAMXC+x4cMPBJRNg9JD+RP1W2yDxzD6tPcC56kzyxZ0ilWzxaGcAK5Ug jmHM1nGcCZ96Iu7216NWGxLlx63vsi+39F3poXeVPPi9vzSdpDtoXiF7N2UZqGJdSE 6kacwbg53sWDnlkdgjzNX4W6dTF4GWB2qU3P443UyXIF8JScM8gjDqg7QuFa6AE02C lwIsBuHrfqXEw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Amit Engel , Christoph Hellwig , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 21/39] nvmet: pass back cntlid on successful completion Date: Sun, 5 Sep 2021 21:21:35 -0400 Message-Id: <20210906012153.929962-21-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210906012153.929962-1-sashal@kernel.org> References: <20210906012153.929962-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210905_182219_756388_DDCF541B X-CRM114-Status: GOOD ( 11.56 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org From: Amit Engel [ Upstream commit e804d5abe2d74cfe23f5f83be580d1cdc9307111 ] According to the NVMe specification, the response dword 0 value of the Connect command is based on status code: return cntlid for successful compeltion return IPO and IATTR for connect invalid parameters. Fix a missing error information for a zero sized queue, and return the cntlid also for I/O queue Connect commands. Signed-off-by: Amit Engel Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/target/fabrics-cmd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c index 42bd12b8bf00..e62d3d0fa6c8 100644 --- a/drivers/nvme/target/fabrics-cmd.c +++ b/drivers/nvme/target/fabrics-cmd.c @@ -120,6 +120,7 @@ static u16 nvmet_install_queue(struct nvmet_ctrl *ctrl, struct nvmet_req *req) if (!sqsize) { pr_warn("queue size zero!\n"); req->error_loc = offsetof(struct nvmf_connect_command, sqsize); + req->cqe->result.u32 = IPO_IATTR_CONNECT_SQE(sqsize); ret = NVME_SC_CONNECT_INVALID_PARAM | NVME_SC_DNR; goto err; } @@ -263,11 +264,11 @@ static void nvmet_execute_io_connect(struct nvmet_req *req) } status = nvmet_install_queue(ctrl, req); - if (status) { - /* pass back cntlid that had the issue of installing queue */ - req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid); + if (status) goto out_ctrl_put; - } + + /* pass back cntlid for successful completion */ + req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid); pr_debug("adding queue %d to ctrl %d.\n", qid, ctrl->cntlid); -- 2.30.2 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme