Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1852661pxb; Mon, 13 Sep 2021 06:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9pQFNOIESkJh0g+3KNNcID7XeHrprMQbAQ72vXCYvagijE9Lr+ha2jM1RmnO2Xygz0jSC X-Received: by 2002:a17:907:10c8:: with SMTP id rv8mr12630707ejb.280.1631541495498; Mon, 13 Sep 2021 06:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631541495; cv=none; d=google.com; s=arc-20160816; b=Z5mwc/UxPqVR05/kNyd2hKHOf4RmYecIfU2SDWVSJg1XzpXhjJbE434gHI3cge0PrB 4oJ4gwdRgja4mKZElRz4EKvPN364e86OIkieKzyXmdMWnPLe1WBEredrMYuEBJg4l7a9 6ILweAua2WDac4x7imkd08PK2kMnOJN4foHI0+oSrv88xaFbtSRjd/r9oUph/ZE/mEAP Qi9kAybNn3ne+ZMVyFTFWpJWcDuLYxceU7rtnBGuv3wigskk/V6BOzGe4l3a2PGiGszP JpAzd7UEO+4W99DTRsohk1pb6R2MFy0eZq05CgPdTdTF9Oj9E4++q/C8l41j6osWpdcy iuaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZXIwvpjIbUImRjH6YrgqAShDBmN8i6wbm5S16GmmA2o=; b=RAZl278rpKqD4J2SC46eEuyAnoClIDlDg0UUbpbNPP9kgXKMU/UPgzdwY/8QvuE5+O KsuawhddzWiL/8jklhMtl4vHhCKdEOP/w3nRZ5cCHx1/2C62sj6QL4/aPb/6ScV8JqSl 3kcpgaFaxpPA+RNQUapqP7t/eSz/mm5KA6kQZPb/tOE3maG3axjO58gserFjIkubp8s+ vUTC9jtAHMlHwDmva1xIYpl9+gE/cyIkUFLYTSNf+DOOWUarS15EyziqyCSLHE9C06OO 3zwMHYL4RYv7Tsxywf5t14e3trOj1w2rpBmVVgBG0sxTTXi5x+ib77b2BY803Wc332yo pJGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zc1YeSIE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k9si9032267edv.565.2021.09.13.06.57.52; Mon, 13 Sep 2021 06:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zc1YeSIE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243956AbhIMN5L (ORCPT + 99 others); Mon, 13 Sep 2021 09:57:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:59272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244182AbhIMNwz (ORCPT ); Mon, 13 Sep 2021 09:52:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5CAFB6187A; Mon, 13 Sep 2021 13:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540070; bh=ZkBB5WuHosXe/9jqN8ntx8HZyJ4sv1now/CKp4qhYGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zc1YeSIEd0YpCi9iTLBtqSjdlXyQp09LDF4nYhvMW0gF83Q4S9Mk52OWgSLC30g8T JOfnFqNC8i4DgwLwwNEHyYZFp9CilBkm4w6Jlce0mCFbSU4Nebn5c7U0IDl4ViNWT8 di6xzPsnepwBLGvn8JePMCIhVMlhGmN1vd1lJjds= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ruozhu Li , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.13 021/300] nvme-rdma: dont update queue count when failing to set io queues Date: Mon, 13 Sep 2021 15:11:22 +0200 Message-Id: <20210913131110.012030365@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ruozhu Li [ Upstream commit 85032874f80ba17bf187de1d14d9603bf3f582b8 ] 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 Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/rdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 4697a94c0945..f80682f7df54 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -736,13 +736,13 @@ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl) if (ret) return ret; - ctrl->ctrl.queue_count = nr_io_queues + 1; - if (ctrl->ctrl.queue_count < 2) { + if (nr_io_queues == 0) { dev_err(ctrl->ctrl.device, "unable to set any I/O queues\n"); return -ENOMEM; } + ctrl->ctrl.queue_count = nr_io_queues + 1; dev_info(ctrl->ctrl.device, "creating %d I/O queues.\n", nr_io_queues); -- 2.30.2