From patchwork Sun Jun 18 15:21:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 9794875 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 2DF9D601C8 for ; Sun, 18 Jun 2017 15:22:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20C06283AF for ; Sun, 18 Jun 2017 15:22:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15D7A283C0; Sun, 18 Jun 2017 15:22:31 +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 BC368283AF for ; Sun, 18 Jun 2017 15:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753232AbdFRPWa (ORCPT ); Sun, 18 Jun 2017 11:22:30 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52158 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753176AbdFRPW3 (ORCPT ); Sun, 18 Jun 2017 11:22:29 -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=8yx8d3IhWDxjsCfi4/bwwCvnreJ0X6wXbt2WXRUxmOI=; b=nQAh57UMdKJcgIrMbL7FI+4G3 kUGptqrEZDam0FKGvr2FDQXX+uHIJBBc54s7T4mwJts4jZnPod/EUU3FEEuLGgymp+GecD4ghgaLT dCSwK+LNatrN75SdcD0U5Lhd7lRuJKOePPYw8GgIYtfYmMGphH+YTBXFv7MzTDQ56CyCDBMy/6FaW TLI+N3wRA6Kp2/fSKOHnW/ujxgDJ2cefHsix4WAIYVISOet4XCJcdkkhs8uaA6okl67d9XszguIog UytMckQVjHyBi7QrxRIw7EGIK96auVjQzBJ4j6/yQLt2leko3L+Dhsvws09sdTYaXxNQutLE5RAOo 856O1lyvw==; 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 1dMc1y-0006WN-Kp; Sun, 18 Jun 2017 15:22:26 +0000 From: Sagi Grimberg To: linux-nvme@lists.infradead.org Cc: Christoph Hellwig , Keith Busch , linux-block@vger.kernel.org Subject: [PATCH rfc 14/30] nvme-rdma: stop queues instead of simply flipping their state Date: Sun, 18 Jun 2017 18:21:48 +0300 Message-Id: <1497799324-19598-15-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 If we move the queues from LIVE state, we might as well stop them (drain for rdma). Do it after we stop the sw request queues to prevent a stray request sneaking in .queue_rq after we stop the queue. Signed-off-by: Sagi Grimberg Reviewed-by: Christoph Hellwig --- drivers/nvme/host/rdma.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index d9524389aedd..fbe2ca4f4ba3 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -952,16 +952,15 @@ static void nvme_rdma_error_recovery_work(struct work_struct *work) { struct nvme_rdma_ctrl *ctrl = container_of(work, struct nvme_rdma_ctrl, err_work); - int i; nvme_stop_keep_alive(&ctrl->ctrl); - for (i = 0; i < ctrl->ctrl.queue_count; i++) - clear_bit(NVME_RDMA_Q_LIVE, &ctrl->queues[i].flags); - - if (ctrl->ctrl.queue_count > 1) + if (ctrl->ctrl.queue_count > 1) { nvme_stop_queues(&ctrl->ctrl); + nvme_rdma_stop_io_queues(ctrl); + } blk_mq_stop_hw_queues(ctrl->ctrl.admin_q); + nvme_rdma_stop_queue(ctrl, 0); /* We must take care of fastfail/requeue all our inflight requests */ if (ctrl->ctrl.queue_count > 1)