Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4517860pxv; Tue, 20 Jul 2021 05:45:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPvKpr4aVA1o+QpuFNed5Ip0y1UwC51WnOnr50A0JZGnpBWUVv0ov/wZ3OqOrDBz5x9uto X-Received: by 2002:a17:906:2716:: with SMTP id z22mr31913890ejc.372.1626785153836; Tue, 20 Jul 2021 05:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626785153; cv=none; d=google.com; s=arc-20160816; b=qKnlxOGBlzV+Dn/+rbdV/uWgNwErZ5d/yvvENzPxriPCQiGWjOwswB5Izm40QtObPo N7yww9CVaVTbeVjmp/nNp0VBzADA/76G73eT07CEAFzGiztvfPKow9y5xAmXl5mSC22Y tWnrriA1a/SzJmVnXEiXz0fr4mBBaAeQ10AYJIs/+9HFXli+vBQ4GYqGaByo6fMKs3MT Gre6mvGNtCw+BghWzbYZCayAkAXOKCpFOhf8Uq0QJwLa5P+Vz8bXBzRKIiP6U9ZZ2mzw kUKOTlPv2obHYa5p6iL1SvIRfk9GiMvOkJ/+/uh7oksLwirpEUdii8RuS91ZLxo75i90 +9Ww== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=gt1WlTf8P4ACBthbjpoZHuxeoWC03SZl9KVFVscbuPc=; b=0zoAgCCNZnTOHWTAThjTzbIejRROQtZomTCnsN5xFFqQkU8U329YlIb1dqovr/4yPN lMIgIeOtij/Kw+C2RRD1TPNjMYsQREdpB55bK9Sf9uM8cJRIXtUiIeTTuwP+UHjNgSTD 5sxWsP1VGUDvEwYmGP4hIwZX3x12ZXewnDE8qDYpsJir8yhCc2yJ2gOOkavbc3dUlEzk DfseH0dZ2+TIl58y6qQmxSrZjHVhXimsQjAFfHqGRQd9IBosyR/44Y7B+pYW0zFudFfj 1x6xG2aXV5BNMjwhUM65AuB3JeJZpQbvVVWrx560GxADkbwPMl7GWHTonpelgS8beivz 6LZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=09kIZ0Br; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k26si16344389eds.397.2021.07.20.05.45.30; Tue, 20 Jul 2021 05:45:53 -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=@suse.de header.s=susede2_rsa header.b=09kIZ0Br; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238262AbhGTMDZ (ORCPT + 99 others); Tue, 20 Jul 2021 08:03:25 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:50816 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230451AbhGTMDV (ORCPT ); Tue, 20 Jul 2021 08:03:21 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id DB34B22461; 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=gt1WlTf8P4ACBthbjpoZHuxeoWC03SZl9KVFVscbuPc=; b=09kIZ0BrxdXcxI+gMZTqrrv+2TxrcOtg2zP8a1FxUpR0Zs88XNOBoK4iz0gIM5Js2rHPdj Cu/1+EClCP0KaGtah6bOBFUlz3scOGWckVEjgPOzBLgOE017thBiJA5vzwINy5VWZU0qJl hODefdHyF85rv643hiex5AT1zZCA2c4= 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=gt1WlTf8P4ACBthbjpoZHuxeoWC03SZl9KVFVscbuPc=; b=cGO9X/pNj64FFDyUpVjw1kw3/1QOS/LQAGEjDiXn+btL857WyajnyWeprxBQiNoGOHiy9i LLkx34wW3zWJz4BA== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 12EECA3BA9; Tue, 20 Jul 2021 12:43:58 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id 01241517192A; 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 , Hannes Reinecke , Daniel Wagner Subject: [PATCH v3 2/6] nvme-tcp: Update number of hardware queues before using them Date: Tue, 20 Jul 2021 14:43:49 +0200 Message-Id: <20210720124353.127959-3-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 From: Hannes Reinecke When the number of hardware queues changes during resetting we should update the tagset first before using it. Signed-off-by: Hannes Reinecke Signed-off-by: Daniel Wagner --- drivers/nvme/host/tcp.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index cf3440fdada8..286e318403cb 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1791,6 +1791,7 @@ static void nvme_tcp_destroy_io_queues(struct nvme_ctrl *ctrl, bool remove) static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new) { int ret; + u32 prior_q_cnt = ctrl->queue_count; ret = nvme_tcp_alloc_io_queues(ctrl); if (ret) @@ -1808,14 +1809,7 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new) ret = PTR_ERR(ctrl->connect_q); goto out_free_tag_set; } - } - - ret = nvme_tcp_start_io_queues(ctrl); - if (ret) - goto out_cleanup_connect_q; - - if (!new) { - nvme_start_queues(ctrl); + } else if (prior_q_cnt != ctrl->queue_count) { if (!nvme_wait_freeze_timeout(ctrl, NVME_IO_TIMEOUT)) { /* * If we timed out waiting for freeze we are likely to @@ -1830,6 +1824,10 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new) nvme_unfreeze(ctrl); } + ret = nvme_tcp_start_io_queues(ctrl); + if (ret) + goto out_cleanup_connect_q; + return 0; out_wait_freeze_timed_out: -- 2.29.2