Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
From: "Meneghini, John" <John.Meneghini@netapp.com>
To: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Jen Axboe <axboe@kernel.dk>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"Knight, Frederick" <Frederick.Knight@netapp.com>,
	Keith Busch <kbusch@kernel.org>
Cc: "Meneghini, John" <John.Meneghini@netapp.com>
Subject: Re: [PATCH V2] nvme: Add support for ACRE Command Interrupted status
Date: Tue, 3 Dec 2019 17:38:04 +0000
Message-ID: <24E2530B-B88E-43E7-AFA2-4FDA417B6C1E@netapp.com> (raw)
In-Reply-To: <8D7B5AD6-F195-4E80-8F24-9B42DE68F664@netapp.com>

This is an update to say that I've tested this patch and it works as expected. 

When the controller returns a Command Interrupted status the request is avoids nvme_failover_req()
and goes down the nvme_retry_req() path where the CRD is implemented and the command is 
retried after a delay.

If the controllers returns Command Interrupted too many times, and nvme_req(req)->retries
runs down, this results in a device resource error returned to the block layer.  But I think we'll
have this problem with any error.  

[Tue Dec  3 08:18:33 2019] print_req_error: device resource error, dev nvme0c0n1, sector 4610048
[Tue Dec  3 08:18:33 2019] print_req_error: device resource error, dev nvme0c0n1, sector 7112704

The alternative is to stop incrementing nvme_req(req)->retries in nvme_retry_req() when CRD is set.

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 24dc9ed1a11b..ec9794698a20 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -258,8 +258,8 @@ static void nvme_retry_req(struct request *req)
        crd = (nvme_req(req)->status & NVME_SC_CRD) >> 11;
        if (ns && crd)
                delay = ns->ctrl->crdt[crd - 1] * 100;
-
-       nvme_req(req)->retries++;
+       else
+               nvme_req(req)->retries++;
        blk_mq_requeue_request(req, false);
        blk_mq_delay_kick_requeue_list(req->q, delay);
 }

Thoughts?

/John

On 11/27/19, 2:12 PM, "Meneghini, John" <John.Meneghini@netapp.com> wrote:

    From: John Meneghini <johnm@netapp.com>

     - Fixes bug in nvme_complete_rq logic introduced by
       Enhanced Command Retry code. According to TP-4033
       when ACRE is enabled the host needs to support
       the Command Interrupted status.
     - The current code interprets Command Interrupted status
       as a BLK_STS_IOERR. This results in a controller reset
       when REQ_NVME_MPATH is set; in nvme_failover_req.
    
    Fixes: 49cd84b6f8b677e ("nvme: implement Enhanced Command Retry")
    Signed-off-by: John Meneghini <johnm@netapp.com>
    Signed-off-by: Hannes Reinecke <hare@suse.de>
    ---
     drivers/nvme/host/core.c  | 2 ++
     include/linux/blk_types.h | 1 +
     2 files changed, 3 insertions(+)
    
    diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
    index 9696404a6182..24dc9ed1a11b 100644
    --- a/drivers/nvme/host/core.c
    +++ b/drivers/nvme/host/core.c
    @@ -230,6 +230,8 @@ static blk_status_t nvme_error_status(u16 status)
                    return BLK_STS_NEXUS;
            case NVME_SC_HOST_PATH_ERROR:
                    return BLK_STS_TRANSPORT;
    +       case NVME_SC_CMD_INTERRUPTED:
    +               return BLK_STS_DEV_RESOURCE;
            default:
                    return BLK_STS_IOERR;
            }
    diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
    index d688b96d1d63..6efee8f1b91b 100644
    --- a/include/linux/blk_types.h
    +++ b/include/linux/blk_types.h
    @@ -84,6 +84,7 @@ static inline bool blk_path_error(blk_status_t error)
            case BLK_STS_NEXUS:
            case BLK_STS_MEDIUM:
            case BLK_STS_PROTECTION:
    +       case BLK_STS_DEV_RESOURCE:
                    return false;
            }
     
    -- 
    2.21.0
    

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27 19:12 Meneghini, John
2019-12-03 17:38 ` Meneghini, John [this message]
2019-12-03 21:00   ` Keith Busch
2019-12-04 13:26     ` Hannes Reinecke
2019-12-04 14:48       ` Meneghini, John
2019-12-04 16:07       ` Keith Busch
2019-12-04 18:33         ` Meneghini, John

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24E2530B-B88E-43E7-AFA2-4FDA417B6C1E@netapp.com \
    --to=john.meneghini@netapp.com \
    --cc=Frederick.Knight@netapp.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git