Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1467182pxy; Mon, 2 Aug 2021 02:15:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKnH8y8kE+ModU320JBhj3u+pWltnGcxboXRVN1YnYN19dpoYSLWisfXD9mdSfNvvKllEF X-Received: by 2002:a92:4a0d:: with SMTP id m13mr288789ilf.129.1627895726012; Mon, 02 Aug 2021 02:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627895726; cv=none; d=google.com; s=arc-20160816; b=W78YNWlbRYa98XcYZ7xEjUBRg5+v1GVtouRp1ap4ak3jJUjPkkDYHuxG+sJzR0+wAa lvVde0zQXOBnJyuAKI6qu3DJsMNuBqAIXT6pBbkp+zShQqYcUfz9U8/k2GNBtmJZw1do SR7Xv4o62OuxilGvlDPYoolt+9UgJ+a6K3rgr3EMoLzmrZOBZ3OI1esvgCH5jXgwgm2Q 6UurX8uj9qaBvkwh1vALW5eQmwPylXBPoqBNgbcFaBpHYwEj1INc5/ihhDhssOLhndUr ZRHuwVMoFHL3xyd/2iZ7scA5s4vdMoyKadlv9uEiGK3KoRxjofdy2RuMBZfcuuWIC8nk 4UqA== 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=Kq/R1fVHSF5hNMJ0lxXFRyuRzBUb3Hsx164nvDSM4YJrNVo2iojJRgZk7WwgwB2W0b nxf3lBnGu/gkeKKV4fT8NmaooeVGRPpjtK1yyOhBzaXYsNF6TteHrZKUxrdfQn5o5H5h O5DYqAn4RT0QzuxOojyV292wO11h9zn20nXXrFUma+5vWT8+R+pgHOuW4tPu3DWcneM7 FoC8suqUrTRZQA2ietxiC8BLAWvGhIufXftqc9ROUi/kzF0YtsbtAMzDRnQIruoaP01+ IIsxae1ZsfuvSPb6DOZCRDAfTAFCg1A17wztaXAV6Pjx+vZSgiiNXB/LDrrBu3UCH/hD +y7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=WXJQQ8PV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=XaKYI8Tu; 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 k16si106347ilr.117.2021.08.02.02.15.15; Mon, 02 Aug 2021 02:15:26 -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=WXJQQ8PV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=XaKYI8Tu; 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 S232966AbhHBJOc (ORCPT + 99 others); Mon, 2 Aug 2021 05:14:32 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:44222 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232670AbhHBJOb (ORCPT ); Mon, 2 Aug 2021 05:14:31 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id D0A5F21F8C; 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=0+zgSqIkcez6QRZOoh03QIraHBKZrpt4BlrZg6ObJF0=; b=WXJQQ8PVIkJom85HkUFoxRw09wedFo0GiglcwcCmqLMJPOeSRgj5JScWemBqElguzm4BYx e1Vi9TFwJ2tbM/coL52ylBPawc22jsmwWFeMtCSAjVAPTRNt4miOKUePWXsBUFH3kJ7oiv RMUdUtyBh0jpASXkz9vAp4gKIqkpQMM= 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=0+zgSqIkcez6QRZOoh03QIraHBKZrpt4BlrZg6ObJF0=; b=XaKYI8TuFM5MoIjjmrWaxUlACIpJ1dEcGF1qKK9Q4EthKQgdtJEcXASzOp8kAqn3f3+reW lQlO+nXijyH26XAg== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 181D4A3BB0; Mon, 2 Aug 2021 09:14:21 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id 07B1E518C08D; Mon, 2 Aug 2021 11:14:21 +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 3/8] nvme-rdma: Update number of hardware queues before using them Date: Mon, 2 Aug 2021 11:14:14 +0200 Message-Id: <20210802091419.56425-4-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 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