Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1540656pxy; Mon, 2 Aug 2021 04:28:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxokeaBLvwuaw08I1nyAHU36Xz/apHh91kPnpXa6/I98ynuYjv3xoCS4OgZB7THlr2x0OF3 X-Received: by 2002:a6b:2b44:: with SMTP id r65mr1220699ior.99.1627903707493; Mon, 02 Aug 2021 04:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627903707; cv=none; d=google.com; s=arc-20160816; b=uI5DvyiNcF5LPOe25KQNE95i7Fh6grJHjPBp4LfUEzDYyOZ5+iK+xurLwMfSFrgXf9 +dTL4ZHHW+eoSrf4fFP+EFxxTyeWEXTkl+A25QKAkVoBB2w9w+G78fx2kuX+Sm7zAIYc Fc8QmX/7sEZEndbWG0c16gGaXb0sRKhnb2/9hYrQNqQwWRRzF0JBx+lb9Y+IkpUcyYfz DNL4AmiL+5TTVa+0ZIw9gn9naRTGaNIkPsBdytDsns3OzCkoVIE0v1x5Cg4keyNJ7XgN fMMYFCnLib96YVemRwEuq2wvPPZpGXGfVEVOk9I/dS8CGauL3ZMRzUUx9wVKzYUv+Wdn Xrbg== 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=g5Dv6QSRopYt+IEkWfubvU2x5TlLAENN9LR3ro7upZE=; b=gIo7zG2JzAs7j5OTp0Cz2z9WOEss1TXNYyaGKNVoJBXHk1fQWSlqr4PCV3fsatRrLT RWos7lOJtB9xOkQywn8V40gjycV4n0DapJHcxKrqLEjE+3/iPCZy38GEBMBqAOJgIeIZ xuVorWcrVuj8dMl9OOsosi7mLLy8vjVRdjir2CyV4dGjoqh79ze38ISFUxsxdd5BamM0 Vf9fadfOr47Ukr9lWVflqDB5/071cFl0dBrsED3NA8h6JZuBmZl2fOsbYfFYdhi12txq KLpfd3TrVdAbyFNsL0CJlJaqqQ33mdA8WCzhLUXDtqXajW9TXfZsJTQPW1JPXZWUOoAn 9rGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=hU4IpHJA; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=lAzJ0RX8; 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 r4si11449630ioh.93.2021.08.02.04.28.16; Mon, 02 Aug 2021 04:28:27 -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=hU4IpHJA; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=lAzJ0RX8; 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 S233552AbhHBL1d (ORCPT + 99 others); Mon, 2 Aug 2021 07:27:33 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:51264 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233386AbhHBL1S (ORCPT ); Mon, 2 Aug 2021 07:27:18 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0F9D41FF7A; Mon, 2 Aug 2021 11:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627903628; 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=g5Dv6QSRopYt+IEkWfubvU2x5TlLAENN9LR3ro7upZE=; b=hU4IpHJARFQo6L/ZNRtZr5Rb7GOWjqAS/2h+8qIGlPo0feZPl4apky6Sam/wpf2JUBc9jB f8N9/jJTB4z1S8dapzDxZsuvWIScAgSe/mIkIXsi/gIXzBQQ5RdQz1wuHgimn6riUIu1oZ Oi0kvOmG4rgaQwB4T5n7e+ActqRn5gc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627903628; 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=g5Dv6QSRopYt+IEkWfubvU2x5TlLAENN9LR3ro7upZE=; b=lAzJ0RX8Y4N/v9EwR/1mQwcSWPvGWiFuhMA5K+7yDqTm1Fi7GcFJxpdo/eOh8KzzORfhpG IO3WJ96jtcquEECg== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id EBB25A3BC2; Mon, 2 Aug 2021 11:27:07 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id D72F8518C0A8; Mon, 2 Aug 2021 13:27:07 +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 , Wen Xiong , Daniel Wagner Subject: [PATCH v4 2/8] nvme-tcp: Update number of hardware queues before using them Date: Mon, 2 Aug 2021 13:26:52 +0200 Message-Id: <20210802112658.75875-3-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210802112658.75875-1-dwagner@suse.de> References: <20210802112658.75875-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 0a97ba02f61e..32268f24f62a 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1789,6 +1789,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) @@ -1806,14 +1807,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 @@ -1828,6 +1822,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