Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1700472imm; Thu, 19 Jul 2018 06:32:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpewLNfqGUsXV8XSuNm78b+9Rn61f0z/t1GjPxBjyc9XLs+7YS5fSPFGtnsNEFwtgE47fIKf X-Received: by 2002:a17:902:bb8d:: with SMTP id m13-v6mr10023209pls.46.1532007150165; Thu, 19 Jul 2018 06:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532007150; cv=none; d=google.com; s=arc-20160816; b=XxnCgr2THs8NWmomDcWPz8MfH+c++w6lDVhzoFNWPpfmMBFI60GUG9Hl5MjJiTgCxE W9mp2JPVamNLziraVrZg6krUgXHC+Bzs51DEyFqsI5udqRsulYmRynj/VI1gMt+2L+Sa 6KdnWeYPtqK5KsWGk7T+Tf+prYuWNXmmfwQG+B4uZxTIsCGdqcAPQYMgliFf8QEYVXPa 6RLkUVU1APHWg6fdTEo70HOnk8j5kmn7nXrURu6RORmruhpCjUTxulirhCSuu2bLcaWG H5rzTwev+xZF20AJN0F0jJblXWYgv23HNuGgqAuiPaaTPQiwvprEuI+FxreEug4I4QF5 VvKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=yZdwgUpS5V6+6W7M8TNanTl71X9ikyO7EZYfjsljFA4=; b=0V/f11QehLmg7H41r007+Kf33qPZp9z74KLRYMnuPm13JOXxPOmdbcunIHiH1bELV5 YYmhRjAdC9VsH/waIq5QsuXF4RF7SEm17yG7zop2Dt+3Tuqmexj6+6Png6n2BUoCsLE/ rgStYXqGFSUReg6KSMu6o+TPC/K+58AC7AI3YOVuJxJhf9yDDkybuepnJyuPhRFB8TZ6 vbaqkHs4FX1Q7DyK9fQppfqFiR/S1fz7RrWJyChlDka0lY73uz40OXhH5DeDkVhbmWmN s7yEtV5qHEqkDQ1arAxVR7gH6RKiWSL5wxoiwq6VjB5TuuMruLVRIXGCkds3lGUVtqcw Q1Qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16-v6si5857882pfd.276.2018.07.19.06.32.15; Thu, 19 Jul 2018 06:32:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731850AbeGSON4 (ORCPT + 99 others); Thu, 19 Jul 2018 10:13:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:54174 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731738AbeGSON4 (ORCPT ); Thu, 19 Jul 2018 10:13:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 35921AF4B; Thu, 19 Jul 2018 13:30:44 +0000 (UTC) From: Johannes Thumshirn To: Christoph Hellwig , Sagi Grimberg , Keith Busch Cc: James Smart , Hannes Reinecke , Ewan Milne , Max Gurtovoy , Linux NVMe Mailinglist , Linux Kernel Mailinglist , Johannes Thumshirn Subject: [PATCH 2/4] nvme: rdma: abort commands before resetting controller Date: Thu, 19 Jul 2018 15:28:36 +0200 Message-Id: <20180719132838.15556-3-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180719132838.15556-1-jthumshirn@suse.de> References: <20180719132838.15556-1-jthumshirn@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently if a timeout on rdma happens we just go ahead and reset the underlying transport. Instead try to abort the timeout out command and if this fails as well continue the error path escalation and tear down the transport. Signed-off-by: Johannes Thumshirn --- drivers/nvme/host/rdma.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 13a6064e4794..aed4752cfac6 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -1671,10 +1671,26 @@ static enum blk_eh_timer_return nvme_rdma_timeout(struct request *rq, bool reserved) { struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq); + struct nvme_ctrl *ctrl = &req->queue->ctrl->ctrl; + u16 qid = nvme_rdma_queue_idx(req->queue); + int ret; + + dev_warn(ctrl->device, + "I/O %d QID %d timeout, aborting\n", + rq->tag, qid); + + ret = nvme_abort_cmd(ctrl, rq, cpu_to_le16(qid)); + if (!ret) + return BLK_EH_RESET_TIMER; - dev_warn(req->queue->ctrl->ctrl.device, - "I/O %d QID %d timeout, reset controller\n", - rq->tag, nvme_rdma_queue_idx(req->queue)); + /* + * If the request was already cancelled once there's no need + * in doing it again, escalate to the next error recovery + * level. + */ + dev_warn(ctrl->device, + "I/O %d QID %d abort failed %d, reset controller\n", + rq->tag, qid, ret); /* queue error recovery */ nvme_rdma_error_recovery(req->queue->ctrl); -- 2.16.4