Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp499292pxb; Tue, 14 Sep 2021 02:22:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZH7s+d7ZpEkr43AYClQncnD7EZ7llaz6yes73at3QHs4hur8jG5UTUfuWH7SjX6oJFXvK X-Received: by 2002:a05:6638:35ac:: with SMTP id v44mr3887872jal.48.1631611353153; Tue, 14 Sep 2021 02:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631611353; cv=none; d=google.com; s=arc-20160816; b=TbA7asnAoruBoqx/5hv2EDERPdg+4IdKC+HKsLFZF8jwj8UICHAh3ST1lZawVr59a9 k9IVdNXUCy3ObJf7p7KYWk4EQ+7Y1DjgpjWm4odlkypCv/U9pgNIFTW6KGtZ5SB+LSPJ 3HD2m1VODddekIZFp9fiXMLysJDyKUnErhdETljeCcZwpzCCMQ/kRFrqP9/+OWh2WLT7 O4eB/EvQxGvJ5Tbh6qG+8b9ZHeMR7sDEYylhaJCeMiLdeWEDDxJKyOG0Ku1LNYcb7ftG gkHqG697JEGKoBZo6D1WZNMog2cgZB3QYyk7O4OjufEvNaLFTgJYbzXh87yM4DCU34YE aT9A== 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=oHYpYRewHY94KuzmKH3Tro9r4VcJFbgYqHJWEF6cmC0=; b=ss41y3lw3VYQRr+qo4WZcItYGXE8PJGXT47MF+gpbKbdyK/dmW71yWWfMWV5F4+Gov NSdeva0i9FpGHQcrzuo1vpHj3irk+c+5NFU3VL4M5ocf7WqH+VzeR16JbErUGPwjCuju FOBtxkOyDDdGwusBd+PafPEGHtbhjRpigPr5GiWvviR6uIG7ifyy2+Vs6ndigYTIdtZX zlyMh3PQoNlNzehj/HLFKOJ8kOpvp3vkhWd2kZdmtBNfJV47HVliUKxT4ZImUpQepo/Q zn8ZrERP8vlIYxhY8bLLYtkFdVvONbEcEwEJW047YtCWT5F297AR5I2zYmt1EXQS4Q6V DWyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=B411N3ic; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k1si9121402ilo.14.2021.09.14.02.22.21; Tue, 14 Sep 2021 02:22:33 -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=B411N3ic; dkim=neutral (no key) header.i=@suse.de; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230291AbhINJVk (ORCPT + 99 others); Tue, 14 Sep 2021 05:21:40 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:45404 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231203AbhINJV1 (ORCPT ); Tue, 14 Sep 2021 05:21:27 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id A12972003B; Tue, 14 Sep 2021 09:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1631611209; 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=oHYpYRewHY94KuzmKH3Tro9r4VcJFbgYqHJWEF6cmC0=; b=B411N3icdvL2Ybdmbh9fGGmmU2/l/Yj4T+OqVrQ8HWIG2+qbd+xQkh5XgLvPpGPe4F7jXD 4ISbXfaBx4MCfyorqf2RzsmgaCeH/8uCh9ub5mSOPsL80BoANOwMfqAxcCfaRnypNK8Ot+ zkdXzMA+QpvxdgSNDhOltCkHeLarAD4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1631611209; 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=oHYpYRewHY94KuzmKH3Tro9r4VcJFbgYqHJWEF6cmC0=; b=kEtWNccR3epsifNEq70DvK2/s0fBKFqhRbHUo7vvcs1vBehSo2CWGy2G3YpNOOom8vWdUq e5mJh/BFHjaRMMDw== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 9515DA3BCD; Tue, 14 Sep 2021 09:20:09 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id 83EB9518E629; Tue, 14 Sep 2021 11:20:09 +0200 (CEST) From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Hannes Reinecke , Sagi Grimberg , Keith Busch , Ming Lei , Wen Xiong , Himanshu Madhani , Daniel Wagner , James Smart Subject: [PATCH v7 1/3] nvme-fc: Update hardware queues before using them Date: Tue, 14 Sep 2021 11:20:06 +0200 Message-Id: <20210914092008.40370-2-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210914092008.40370-1-dwagner@suse.de> References: <20210914092008.40370-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, we need to update the tagset and the mapping of ctx to hctx first. If we try to create and connect the I/O queues first, this operation will fail (target will reject the connect call due to the wrong number of queues) and hence we bail out of the recreate function. Then we will to try the very same operation again, thus we don't make any progress. 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 b08a61ca283f..b5d9a5507de5 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