Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1773758pxb; Mon, 23 Aug 2021 04:25:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmgikWR9s0Le+jsGwEkLcQFuYtJqmTYun76U9rI7hpezlJrgnt661gHJgk4dE8X0BOeNGv X-Received: by 2002:a05:6e02:134e:: with SMTP id k14mr23883566ilr.31.1629717921877; Mon, 23 Aug 2021 04:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629717921; cv=none; d=google.com; s=arc-20160816; b=K7LjQi+fTnJ0ZELDlho5lu+O/s/g79JcCprzq1qMzhrsnproLaBgjL2TVim0laQSP6 HZdnKVRHXFRK96p3WREU0jPTm8zLH72onpiQx+nzYy5UFM/CRzO/Eg7Jxiker35BrrH4 c02JqbHTg7SVlD1SSah5NPqvmOYE2dd1gXqEn4cIFO4jFTR0Ms1VNo/rwuYNtNyKDXNl a4aawZhhqbLsoabjMXBZmN1FaGSyZdEZR1vu27icsCJDLX53lyJph7yXzjzZFAfuMb94 LtEAgUSiOKZNQiwutICIPfSP/mCfZs2PvJqfAh6hr+Q/xIqSMw8Xv42kx0b5nFElgC/N QXJw== 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=/ZvEHujhPbI0vjXjTblcd7JIdCXd8Q2VXrYKdXia7AI=; b=FW69USZvLdE3iEKEv4ZASORMsQgNtJor5IXoQBFPb+BYPddm+sMDJ3qPuMxmuQf/sT b66WlirqIVoIcKiDpNcC1kjsp3/Kup3OPkSuWCvABJzZHWLfKYY6QJLNAamJzVBv/ZxR bZcwenKGjBjvwkqxNY40Ok1hTXIGxVDbWWqWu0SSt1mLPjJ4mEVNZ38W96GKrbZopxZd ugKhSWsUDlv8ksfHNNb83xbaICVQPK10MDXTuL/dnNhvYom8F92QpfsyXIEiBT8Jrq5c QcABCQfWud/gpc4A1sgamMHyqOH1xu9/6g6IdtteJZGVBa/lRs0xVgOzEZLFK0xF69+R qLDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=sYF0BtV3; 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; 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 l5si14949181iln.118.2021.08.23.04.25.09; Mon, 23 Aug 2021 04:25:21 -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=sYF0BtV3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236617AbhHWLYh (ORCPT + 99 others); Mon, 23 Aug 2021 07:24:37 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:37642 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236434AbhHWLYg (ORCPT ); Mon, 23 Aug 2021 07:24:36 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id EE2B61FFAC; Mon, 23 Aug 2021 11:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1629717832; 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=/ZvEHujhPbI0vjXjTblcd7JIdCXd8Q2VXrYKdXia7AI=; b=sYF0BtV3KauPYQWpQQu3RYbkfTMeQPqodURKI48WhlkqcIqT3yXYLTfu2IOJecUZzld/P5 V4bm4ad+gKCWAiS3hM+PWC7K8B0JQNJdEyPpHdiF7BomkE2rtRBVlwN3lJ8MJQuYytGMiT S+SDtsPLAnuR5ctDXMiiVnxwKTxu9V0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1629717832; 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=/ZvEHujhPbI0vjXjTblcd7JIdCXd8Q2VXrYKdXia7AI=; b=4FIIap5Wb87YHTOQ5cDQlmFp/RoWSpDKv4QjBxB0lolgweQ3a+SaWexKxeVJDe+PENqkC5 j7fv4/dM1tAjlsDw== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 2BE95A3BB9; Mon, 23 Aug 2021 11:23:52 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id 1D366518D88B; Mon, 23 Aug 2021 13:23:52 +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 , Himanshu Madhani , Daniel Wagner , James Smart Subject: [PATCH v6 1/3] nvme-fc: Update hardware queues before using them Date: Mon, 23 Aug 2021 13:23:49 +0200 Message-Id: <20210823112351.82899-2-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210823112351.82899-1-dwagner@suse.de> References: <20210823112351.82899-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 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