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 5D4F1C433EF for ; Mon, 6 Sep 2021 01:21:24 +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 2D69B61104 for ; Mon, 6 Sep 2021 01:21:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D69B61104 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=6097nH77qbe0v8WdSMyG/279O0+2Dl8QQQHC+/05LB4=; b=xhR39mBNIwTc3C Gat4hDBp8uVgNZD2CNffWBKaNrBcHUOPVG6paBO5KR5IZGfKUygs00/i9SQ8BAd04inx+a89gShIG 04CMYcD3wE4rqHB+j3g/w1/RT+8Wbtw7xhcIq2f1G4LEbccroFZ++SGEe2oZlZEYQTNpwBNYaf4Bl 1B3S4YtI7zMCACcA1gbOqDEc2jpi5vaLnzk4SDJenhTnL8bBWDOwtFwoLEVgUGTKi4MtAl3isO2j1 8dvAcjFnastYFd7KeDekznNOhP2iyNu35oBvkIBJtwX5So+PIMhyOXYS1RTprPHIqVfpw8RrK3v4o dlPqlJwNG7iqf7+3A+gQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mN3K5-00GtoF-Jm; Mon, 06 Sep 2021 01:21:21 +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 1mN3K2-00Gtlj-70 for linux-nvme@lists.infradead.org; Mon, 06 Sep 2021 01:21:19 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 36EFF610FB; Mon, 6 Sep 2021 01:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630891277; bh=49Cf0XBogBH+KIVaAGYpc5gUU39wKS7XCC7Ix+4eFJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=acdqkgalVarFG1Zrec8jvIf8ne4xWuN3VGQi7BLqk/zIhMMCVrONKQ2av5AXgblAv 6cblHFPTNqFFdTYLE7Q9MFV3G7qPSIkeKiTrQqqtHMoMQaRAM+T/Vd5Q2jDMzb3+Qz fnF0qaxF/B+uGWDHS+8D1f3LIwRDxN2iU9bV/z2jITiUYIyDRScvsw+GtrGYAgQc61 wKzHm+8cm3lPNVQFSGn8Wp3Q+vxtpG7Gs067l9ZujoEQ/wv2DGUkvcuDfjUhUBT6D/ g/8RWC+r03ftgGthVkXD1lpxjy1yiGsmu6n1F5uNYCiL9Cm2a8ZD2dBY8zWvYhmvw7 QXjgP+0gbzanw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ruozhu Li , Christoph Hellwig , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.13 20/46] nvme-tcp: don't update queue count when failing to set io queues Date: Sun, 5 Sep 2021 21:20:25 -0400 Message-Id: <20210906012052.929174-20-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210906012052.929174-1-sashal@kernel.org> References: <20210906012052.929174-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_182118_309823_426FADF2 X-CRM114-Status: GOOD ( 13.62 ) 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: Ruozhu Li [ Upstream commit 664227fde63844d69e9ec9e90a8a7801e6ff072d ] We update ctrl->queue_count and schedule another reconnect when io queue count is zero.But we will never try to create any io queue in next reco- nnection, because ctrl->queue_count already set to zero.We will end up having an admin-only session in Live state, which is exactly what we try to avoid in the original patch. Update ctrl->queue_count after queue_count zero checking to fix it. Signed-off-by: Ruozhu Li Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 79a463090dd3..ab1ea5b0888e 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1755,13 +1755,13 @@ static int nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl) if (ret) return ret; - ctrl->queue_count = nr_io_queues + 1; - if (ctrl->queue_count < 2) { + if (nr_io_queues == 0) { dev_err(ctrl->device, "unable to set any I/O queues\n"); return -ENOMEM; } + ctrl->queue_count = nr_io_queues + 1; dev_info(ctrl->device, "creating %d I/O queues.\n", nr_io_queues); -- 2.30.2 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme