Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1467270pxy; Mon, 2 Aug 2021 02:15:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUWyZW8ylaSvOOM0o6nZdbfrDrKSALtjPwUui8JAD3VMooVki3c1cuIcsiJYZ9wMk6eEMA X-Received: by 2002:a05:6602:3404:: with SMTP id n4mr205014ioz.31.1627895737195; Mon, 02 Aug 2021 02:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627895737; cv=none; d=google.com; s=arc-20160816; b=X8PjfgwI4tGi3kLYk7GJOibW49dYGGoxbP6qD2WqGqm5/3JTZVXNalzgymWlnrHA3l 9pH8KdRm8E95n3e/juOUGwhmh9W2NlxVvITy2Hh7V2YyIWzPS10bQ1+qoD+ZsanMFQzz LP5IECr2u1Z5NkAln8AUyjpZsMDHjGb9Fo1+oABx1lukFux7R37RBcup1e75/FiqRiyp AKkBJIowN+h2V9k8njTnUqM6JSW6M6Ce4W18z8F3KEA48vK2KgyzxMFA3sAQEksgkJPD JkO7rktqBVIdl57NMs+S8lLbb2EPmjAgi4k/K3uqTBrFLCvpwfH1CwRY/Uri4vIwXrPO kXHg== 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=Jtl0y8POSfif+00SfdcebgofhPh59aOWxbp+JOZmi+4Rxt5qmt6bCgv4GHoNnitrZ4 yMj/UtL0X0vYTavC+giNL6sHvfzmBiX0v1tojTrIV3lUU2iSrv/qZWe5lP9UArRnGvRG 3MUYIWhWPKbDiNmzoec5fEArL92awjx3BIopEKPpfie5GIsEPL+p2qBuMdqKZmWAOIGh uoYqqBBcWr+vZNuhgMOttNewME4NBexrYqwxKc9dybK2ff6goXElG/WORUW1YTpLSrtD ctzavc6TXji0FrIWd/1FCDeUfM9MLD0rqijhLoKPl2rqAyk4QhYoOwz9V9zoSUZu9PVF sSWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=WsLhSgkd; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Nc3zrTKV; 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 w12si11649061iox.55.2021.08.02.02.15.26; Mon, 02 Aug 2021 02:15:37 -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=WsLhSgkd; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Nc3zrTKV; 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 S233003AbhHBJOt (ORCPT + 99 others); Mon, 2 Aug 2021 05:14:49 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:58766 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232856AbhHBJOc (ORCPT ); Mon, 2 Aug 2021 05:14:32 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id D169D1FF55; Mon, 2 Aug 2021 09:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627895661; 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=WsLhSgkdTMoot24sdfNIENc2BltH4dftk5O8eH+w9GDQO3k7a4jdbwdM5a0r6ux/h+lKSH Nzr48OkEmgHxXN7xOv/dbvOy3ShuEOzNr5dOr2Jz+3vp7PB4X1vPD3XKdEgZHwuYn9yyCJ kFlUak18isXNU0noVif3lgOK6ssXhYI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627895661; 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=Nc3zrTKV8Tmbq5B7seJJqe2Wy/QhnAHy7zNyFcVHlY326iljy1oYHQQuMWLtC8gmRfV5Ap CEdFO19HtzrFpeDw== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 13032A3BAE; Mon, 2 Aug 2021 09:14:21 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id 0185F518C08B; Mon, 2 Aug 2021 11:14:20 +0200 (CEST) From: Daniel Wagner To: linux-kernel@vger.kernel.org Cc: 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 11:14:13 +0200 Message-Id: <20210802091419.56425-3-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210802091419.56425-1-dwagner@suse.de> References: <20210802091419.56425-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