Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1540819pxy; Mon, 2 Aug 2021 04:28:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzisgti48cb5/xoW0daz7VsF04ExXAPhQ5zn8p2vZ36OnkE8bauWI+jfhR5ZK0qxUqddRob X-Received: by 2002:a17:906:d045:: with SMTP id bo5mr15191430ejb.461.1627903727911; Mon, 02 Aug 2021 04:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627903727; cv=none; d=google.com; s=arc-20160816; b=WGgT/3wFuqAt/2nkzcdHzIUe4Q4zQVPj1BZveGmkBXI7PWh0+WZeLtd2E7qJHBpyFn COdCFf0W0cCdxUka2ZVZmwuUKjaHTX+ztmBajJ4EIU9Tgd3NHOR+/TynGcEadefICcx6 0EBmgx8VhAzJXUWf+32vGM+5AGgXexxKrNVPMAqz338RXoZ719JeJAx/eJNhn5dIlK3C zdnhTDa02zAaHaAwTCND6KNnxs4EVrdfWxPerIFhC2QJ23DTWUvZ7pmlYnVe3mvA1ACL FyWo/H/JN3pJxTZpA+Dc5+80V+ttULHCVJ/SUVbehrHCnZynr/RVlWWbv5W9lwAHlEgy kVWQ== 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=0+zgSqIkcez6QRZOoh03QIraHBKZrpt4BlrZg6ObJF0=; b=AlRG6bbCAK51qc8yVYRXZdmv9CIRlPjoyRfD0cKVSrFxfow2DNuisc7SPnMf/xLCU3 05Tt47rSu2eFAJs/aGChNi1dTW3oARssf2IxLS5sDrOp/VpIK25Cy0wsZYstnd1LbMsG Hs4EX9schOY2+u7kQRGg4p6suvmRlPV+h21AMKldoL/bOydl61yfGUlSfDygfCTVjVog OEzN0whovtTQR+NUTG7sDFQXhEBJQsaUzZKcuxBRDuxomOc9+6Xin3aAny5k50W/w9Bx 80XuwKhXeTaQ2J3sBYq/m+F5hYqJQau0m84271KESAPiXhT+7BzZkuwHSqwsqVIMcknN iTcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="em/eQo60"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=sSo1dtL0; 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 i18si8174691edc.507.2021.08.02.04.28.25; Mon, 02 Aug 2021 04:28:47 -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="em/eQo60"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=sSo1dtL0; 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 S233464AbhHBL1U (ORCPT + 99 others); Mon, 2 Aug 2021 07:27:20 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:37054 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232553AbhHBL1R (ORCPT ); Mon, 2 Aug 2021 07:27:17 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 0279821E9C; 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=0+zgSqIkcez6QRZOoh03QIraHBKZrpt4BlrZg6ObJF0=; b=em/eQo603TbM/sNhvVhkBoLMoLd8U8vQyNZIt9s083wDhkv3KjD6Og7j+1bP4s/gQ4KxDN 941j8xVsZ2YFIVdHatHIvgbZj5sZQVhf95/Hx8GRE2jgbaS+KGtd4diIMW9DVtPCn2vsI0 jO0wuVNlh1O+H4O9ngULMnolaZgzY/U= 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=0+zgSqIkcez6QRZOoh03QIraHBKZrpt4BlrZg6ObJF0=; b=sSo1dtL0T8UcRG+bDKOO2LzX4gdccw+/liEvOC3hDZI9xKxOJ/yJ05s72iau4jry6jrGVZ 4AkX2TFJnrAbS4AQ== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id EF493A3BC3; Mon, 2 Aug 2021 11:27:07 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id DC3AD518C0AA; 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 3/8] nvme-rdma: Update number of hardware queues before using them Date: Mon, 2 Aug 2021 13:26:53 +0200 Message-Id: <20210802112658.75875-4-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 When the number of hardware queues changes during resetting we should update the tagset first before using it. Reviewed-by: Hannes Reinecke Signed-off-by: Daniel Wagner --- drivers/nvme/host/rdma.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 69ae67652f38..de2a8950d282 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -965,6 +965,7 @@ static void nvme_rdma_destroy_io_queues(struct nvme_rdma_ctrl *ctrl, static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new) { int ret; + u32 prior_q_cnt = ctrl->ctrl.queue_count; ret = nvme_rdma_alloc_io_queues(ctrl); if (ret) @@ -982,13 +983,7 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new) ret = PTR_ERR(ctrl->ctrl.connect_q); goto out_free_tag_set; } - } - - ret = nvme_rdma_start_io_queues(ctrl); - if (ret) - goto out_cleanup_connect_q; - - if (!new) { + } else if (prior_q_cnt != ctrl->ctrl.queue_count) { nvme_start_queues(&ctrl->ctrl); if (!nvme_wait_freeze_timeout(&ctrl->ctrl, NVME_IO_TIMEOUT)) { /* @@ -1004,6 +999,10 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new) nvme_unfreeze(&ctrl->ctrl); } + ret = nvme_rdma_start_io_queues(ctrl); + if (ret) + goto out_cleanup_connect_q; + return 0; out_wait_freeze_timed_out: -- 2.29.2