From patchwork Sun Jun 18 15:21:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 9794871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52668601C8 for ; Sun, 18 Jun 2017 15:22:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 451AD283AF for ; Sun, 18 Jun 2017 15:22:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A27E283C0; Sun, 18 Jun 2017 15:22:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF70A283AF for ; Sun, 18 Jun 2017 15:22:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225AbdFRPW1 (ORCPT ); Sun, 18 Jun 2017 11:22:27 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52142 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753176AbdFRPW1 (ORCPT ); Sun, 18 Jun 2017 11:22:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hSKcIrFR24pQ57cnvPuyBlrGW9Jre0iBqLDI7cGy1j0=; b=25ZyMk6BvAfLnMB43YeFvT+2E jjP8pkT8KS5jfrkQbIAVr485/Or7SAQ4ouy0RNc4VUOVoNN1m1iqSfDmc6kvRS9HGDJfdWj6r+fg0 djcoxA5j4qF3eqoXsINMDbwSHLrhFqrUWxJ+Em154z+SSPmp34h+xTViKqt/PQdXjmr8uAiJCx5a/ zNP+yOTZtiuxxno+5mm+bZ2x1tm2mhDHeO7wJ8Am/7c15Ys2GgGPUYgKlQ7OR/ypbwfLPTBHauYz0 /sa+L3DfN6MMCDmiIboVvYNxZOdLLhtcsWFc2aIyw5pYipZpPYRb6jsbgZl5m5M43AMz4cNq1Q7fF BlEMkG21g==; Received: from bzq-82-81-101-184.red.bezeqint.net ([82.81.101.184] helo=bombadil.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dMc1w-0006WN-1q; Sun, 18 Jun 2017 15:22:24 +0000 From: Sagi Grimberg To: linux-nvme@lists.infradead.org Cc: Christoph Hellwig , Keith Busch , linux-block@vger.kernel.org Subject: [PATCH rfc 12/30] nvme-rdma: disable controller in reset instead of shutdown Date: Sun, 18 Jun 2017 18:21:46 +0300 Message-Id: <1497799324-19598-13-git-send-email-sagi@grimberg.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497799324-19598-1-git-send-email-sagi@grimberg.me> References: <1497799324-19598-1-git-send-email-sagi@grimberg.me> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For controller resets we can avoid a full controller shutdown. This makes rdma similar to pci. Signed-off-by: Sagi Grimberg Reviewed-by: Christoph Hellwig --- drivers/nvme/host/rdma.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index cd637e28647b..34518c90609a 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -1720,7 +1720,7 @@ static const struct blk_mq_ops nvme_rdma_admin_mq_ops = { .timeout = nvme_rdma_timeout, }; -static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown) +static void nvme_rdma_teardown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown) { nvme_stop_keep_alive(&ctrl->ctrl); cancel_work_sync(&ctrl->err_work); @@ -1733,8 +1733,12 @@ static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown) nvme_rdma_destroy_io_queues(ctrl, shutdown); } - if (test_bit(NVME_RDMA_Q_LIVE, &ctrl->queues[0].flags)) - nvme_shutdown_ctrl(&ctrl->ctrl); + if (test_bit(NVME_RDMA_Q_LIVE, &ctrl->queues[0].flags)) { + if (shutdown) + nvme_shutdown_ctrl(&ctrl->ctrl); + else + nvme_disable_ctrl(&ctrl->ctrl, ctrl->ctrl.cap); + } blk_mq_stop_hw_queues(ctrl->ctrl.admin_q); blk_mq_tagset_busy_iter(&ctrl->admin_tag_set, @@ -1748,7 +1752,7 @@ static void nvme_rdma_del_ctrl_work(struct work_struct *work) struct nvme_rdma_ctrl, delete_work); nvme_uninit_ctrl(&ctrl->ctrl); - nvme_rdma_shutdown_ctrl(ctrl, true); + nvme_rdma_teardown_ctrl(ctrl, true); nvme_put_ctrl(&ctrl->ctrl); } @@ -1788,7 +1792,7 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work) int ret; bool changed; - nvme_rdma_shutdown_ctrl(ctrl, false); + nvme_rdma_teardown_ctrl(ctrl, false); ret = nvme_rdma_configure_admin_queue(ctrl, false); if (ret)