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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 E91BAC07E9B for ; Tue, 20 Jul 2021 12:44:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB1F360C41 for ; Tue, 20 Jul 2021 12:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238325AbhGTMDq (ORCPT ); Tue, 20 Jul 2021 08:03:46 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:51784 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238116AbhGTMDV (ORCPT ); Tue, 20 Jul 2021 08:03:21 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E214B202DC; Tue, 20 Jul 2021 12:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626785038; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SfQP/+Z/F79I26kRG9+BGx4zqVCtVRjP1OyJvjdgAVM=; b=vudcYIgNRY0tLMsZy/K1+XYsV47MbIKanmlENzete1/JZ/w1JXQ/Uju8JCDllOipDwOACi TFg/rB9cxjAby7r4GhbQX+veUu2TXEBeOVNGlDZyMeiyYur0E2wM6pY4ZQa5Fv8/o0CHlx lUTXcOpah0Z4v6ZILSAByxGaHatekW8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626785038; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SfQP/+Z/F79I26kRG9+BGx4zqVCtVRjP1OyJvjdgAVM=; b=QOGg1IKxKkEO8913jmMKnelAfe8RGCcZa5gDKl/GFvcoTNTFbM3STxwSuuNQSPJCkm0LD5 OfY6KnkPbLqgFGAw== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 1C0BAA3BAA; Tue, 20 Jul 2021 12:43:58 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id 077E7517192C; Tue, 20 Jul 2021 14:43:58 +0200 (CEST) From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, James Smart , Keith Busch , Ming Lei , Sagi Grimberg , Daniel Wagner Subject: [PATCH v3 3/6] nvme-rdma: Update number of hardware queues before using them Date: Tue, 20 Jul 2021 14:43:50 +0200 Message-Id: <20210720124353.127959-4-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210720124353.127959-1-dwagner@suse.de> References: <20210720124353.127959-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the number of hardware queues changes during resetting we should update the tagset first before using it. Signed-off-by: Daniel Wagner --- drivers/nvme/host/rdma.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 00fcbd985102..57d20100be56 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -966,6 +966,7 @@ static void nvme_rdma_destroy_io_queues(struct nvme_rdma_ctrl *ctrl, static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new) { int ret; + u32 prior_q_cnt = ctrl->ctrl.queue_count; ret = nvme_rdma_alloc_io_queues(ctrl); if (ret) @@ -983,13 +984,7 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new) ret = PTR_ERR(ctrl->ctrl.connect_q); goto out_free_tag_set; } - } - - ret = nvme_rdma_start_io_queues(ctrl); - if (ret) - goto out_cleanup_connect_q; - - if (!new) { + } else if (prior_q_cnt != ctrl->ctrl.queue_count) { nvme_start_queues(&ctrl->ctrl); if (!nvme_wait_freeze_timeout(&ctrl->ctrl, NVME_IO_TIMEOUT)) { /* @@ -1005,6 +1000,10 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new) nvme_unfreeze(&ctrl->ctrl); } + ret = nvme_rdma_start_io_queues(ctrl); + if (ret) + goto out_cleanup_connect_q; + return 0; out_wait_freeze_timed_out: -- 2.29.2