Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1540608pxy; Mon, 2 Aug 2021 04:28:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEqR8Z3Tsmewy1lpYf6J5kq4VUxZk2z3YVe8Z5GweoB9vAc4vlihZ3O98pOgeK87sGuCnc X-Received: by 2002:a6b:e009:: with SMTP id z9mr17717iog.56.1627903699369; Mon, 02 Aug 2021 04:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627903699; cv=none; d=google.com; s=arc-20160816; b=itFGL6PJsMJG0fIjjwIKWLv9Lg2RSyjN7VvBR/VU5NCrlDTAZHsgpB7euYwcplM7nk Sun85DBKLwhg0vuuvOZGhZzbKC2C70ne7vm5NGi1oJ+HfXC7lE5LzfnKW/t15UsP3Pn3 Hzo7MtDmTjluYPQvXgszAeEopULh3TVGWsyDW5hu0VOwnTcXaVpG19bLnNEU2hNX/w2V N6NfGf4Q83oQ6S/IpyO+Xu/6B6zDUNcQ9qM8fFWm/JsKEMssIHipoV4c9huXQ+c1uZKF eqXSzfBOP/MT8XACb7zwvziTDVpt2gx0aPJVtMSv1WhNQr6OK0kpD7vp6fUDqgGHimnA u59Q== 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=dZOuzvx1phja24aAWw8Llh5el782SjhEfTlnpRDPjWI=; b=dn2ZK8qb54Kr8tB59VXIYsXPut5W2OH98K1zq1cjU+bCN4BZoE+gFa5co+ufktJXjD A61CN0oVw64WBz2ttiZKA48lYrWjceV14aq6y2KKYF3vRR7Kh/DAJ9GyFnnKiccyXlcs jt7F4/1nnDEq3nIUkhn75m4+BDrf89bhfvW8OdUJIiu8YqcRYUX0aAj5mmz8DDEQUd7a 9bwC8+nivSV6GsmVyp6UQkg842CrA6aYBGcunmj8O8gXnWWOiNwRQc1KMPBp3zzxg/0w 5HklHYbvE85HC+Uz5E2QM+XZCtLwVx+lbm9vPs8SPkGKq2LBYhhw2R6Q+cCN5EhLUH+q Joig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=u4PmMJMO; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=KbEvpdEo; 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 k5si13765405jaa.25.2021.08.02.04.28.06; Mon, 02 Aug 2021 04:28:19 -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=u4PmMJMO; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=KbEvpdEo; 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 S233495AbhHBL1X (ORCPT + 99 others); Mon, 2 Aug 2021 07:27:23 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:51212 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233255AbhHBL1S (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 0965C1FF5D; 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=dZOuzvx1phja24aAWw8Llh5el782SjhEfTlnpRDPjWI=; b=u4PmMJMOK4YKRIa8TOVPp91ocQbWQaJtaT7ZIm29f/vGNrc0GJTeJUzKzUlPFHy2eFxmXG FFSgy5BaoYSTxnsVSITwOeFwGKjZNnaBwvdJI8p4Cq74jCCgAVVrUd50TQ8+K9uBQlBZde Utn0ZfCrxxLuQc6qe0IHTw3fQoOClcU= 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=dZOuzvx1phja24aAWw8Llh5el782SjhEfTlnpRDPjWI=; b=KbEvpdEoO9kyYg2dGCc6xrXCQrYismXC/xQDX0YT8bggO/lzi95xRaEmSt3cC/E8zgfddW JQ/EenTfAKRq6NCQ== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id E3766A3BC0; Mon, 2 Aug 2021 11:27:07 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id D502D518C0A6; 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 , James Smart Subject: [PATCH v4 1/8] nvme-fc: Update hardware queues before using them Date: Mon, 2 Aug 2021 13:26:51 +0200 Message-Id: <20210802112658.75875-2-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 In case the number of hardware queues changes, do the update the tagset and ctx to hctx first before using the mapping to recreate and connnect the IO queues. Reviewed-by: James Smart Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Signed-off-by: Daniel Wagner --- drivers/nvme/host/fc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 7f462af1b02a..8a903769364f 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2951,14 +2951,6 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl) if (ctrl->ctrl.queue_count == 1) return 0; - ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1); - if (ret) - goto out_free_io_queues; - - ret = nvme_fc_connect_io_queues(ctrl, ctrl->ctrl.sqsize + 1); - if (ret) - goto out_delete_hw_queues; - if (prior_ioq_cnt != nr_io_queues) { dev_info(ctrl->ctrl.device, "reconnect: revising io queue count from %d to %d\n", @@ -2968,6 +2960,14 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl) nvme_unfreeze(&ctrl->ctrl); } + ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1); + if (ret) + goto out_free_io_queues; + + ret = nvme_fc_connect_io_queues(ctrl, ctrl->ctrl.sqsize + 1); + if (ret) + goto out_delete_hw_queues; + return 0; out_delete_hw_queues: -- 2.29.2