All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guan Junxiong <guanjunxiong@huawei.com>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
Cc: Keith Busch <keith.busch@intel.com>,
	<linux-block@vger.kernel.org>, "Sagi Grimberg" <sagi@grimberg.me>,
	<linux-nvme@lists.infradead.org>,
	niuhaoxin <niuhaoxin@huawei.com>,
	"Shenhong (C)" <shenhong09@huawei.com>
Subject: Re: [PATCH 10/10] nvme: implement multipath access to nvme subsystems
Date: Tue, 29 Aug 2017 18:22:50 +0800	[thread overview]
Message-ID: <e751810f-bb91-f764-dd51-ce2faaf209f0@huawei.com> (raw)
In-Reply-To: <20170823175815.3646-11-hch@lst.de>



On 2017/8/24 1:58, Christoph Hellwig wrote:
> -static inline bool nvme_req_needs_retry(struct request *req)
> +static bool nvme_failover_rq(struct request *req)
>  {
> -	if (blk_noretry_request(req))
> +	struct nvme_ns *ns = req->q->queuedata;
> +	unsigned long flags;
> +
> +	/*
> +	 * Only fail over commands that came in through the the multipath
> +	 * aware submissions path.  Note that ns->head might not be set up
> +	 * for commands used during controller initialization, but those
> +	 * must never set REQ_FAILFAST_TRANSPORT.
> +	 */
> +	if (!(req->cmd_flags & REQ_FAILFAST_TRANSPORT))
> +		return false;
> +
> +	switch (nvme_req(req)->status & 0x7ff) {
> +	/*
> +	 * Generic command status:
> +	 */
> +	case NVME_SC_INVALID_OPCODE:
> +	case NVME_SC_INVALID_FIELD:
> +	case NVME_SC_INVALID_NS:
> +	case NVME_SC_LBA_RANGE:
> +	case NVME_SC_CAP_EXCEEDED:
> +	case NVME_SC_RESERVATION_CONFLICT:
> +		return false;
> +
> +	/*
> +	 * I/O command set specific error.  Unfortunately these values are
> +	 * reused for fabrics commands, but those should never get here.
> +	 */
> +	case NVME_SC_BAD_ATTRIBUTES:
> +	case NVME_SC_INVALID_PI:
> +	case NVME_SC_READ_ONLY:
> +	case NVME_SC_ONCS_NOT_SUPPORTED:
> +		WARN_ON_ONCE(nvme_req(req)->cmd->common.opcode ==
> +			nvme_fabrics_command);
> +		return false;
> +
> +	/*
> +	 * Media and Data Integrity Errors:
> +	 */
> +	case NVME_SC_WRITE_FAULT:
> +	case NVME_SC_READ_ERROR:
> +	case NVME_SC_GUARD_CHECK:
> +	case NVME_SC_APPTAG_CHECK:
> +	case NVME_SC_REFTAG_CHECK:
> +	case NVME_SC_COMPARE_FAILED:
> +	case NVME_SC_ACCESS_DENIED:
> +	case NVME_SC_UNWRITTEN_BLOCK:
>  		return false;
> +	}
> +
> +	/* Anything else could be a path failure, so should be retried */
> +	spin_lock_irqsave(&ns->head->requeue_lock, flags);
> +	blk_steal_bios(&ns->head->requeue_list, req);
> +	spin_unlock_irqrestore(&ns->head->requeue_lock, flags);
> +
> +	nvme_reset_ctrl(ns->ctrl);
> +	kblockd_schedule_work(&ns->head->requeue_work);
> +	return true;
> +}
> +
> +static inline bool nvme_req_needs_retry(struct request *req)
> +{
>  	if (nvme_req(req)->status & NVME_SC_DNR)
>  		return false;
>  	if (jiffies - req->start_time >= req->timeout)
>  		return false;
>  	if (nvme_req(req)->retries >= nvme_max_retries)
>  		return false;
> +	if (nvme_failover_rq(req))
> +		return false;
> +	if (blk_noretry_request(req))
> +		return false;
>  	return true;
>  }

Does this introduce conflicts with current DM-Multipath used for NVMe/NVMeF
when path IO error occurs?  Such IO will be retried not only on the nvme-mpath
internal path, but also on the dm-mpath path.

In general, I wonder whether nvme-mpath can co-exist with DM-multipath
in a well-defined fashion.

WARNING: multiple messages have this Message-ID (diff)
From: guanjunxiong@huawei.com (Guan Junxiong)
Subject: [PATCH 10/10] nvme: implement multipath access to nvme subsystems
Date: Tue, 29 Aug 2017 18:22:50 +0800	[thread overview]
Message-ID: <e751810f-bb91-f764-dd51-ce2faaf209f0@huawei.com> (raw)
In-Reply-To: <20170823175815.3646-11-hch@lst.de>



On 2017/8/24 1:58, Christoph Hellwig wrote:
> -static inline bool nvme_req_needs_retry(struct request *req)
> +static bool nvme_failover_rq(struct request *req)
>  {
> -	if (blk_noretry_request(req))
> +	struct nvme_ns *ns = req->q->queuedata;
> +	unsigned long flags;
> +
> +	/*
> +	 * Only fail over commands that came in through the the multipath
> +	 * aware submissions path.  Note that ns->head might not be set up
> +	 * for commands used during controller initialization, but those
> +	 * must never set REQ_FAILFAST_TRANSPORT.
> +	 */
> +	if (!(req->cmd_flags & REQ_FAILFAST_TRANSPORT))
> +		return false;
> +
> +	switch (nvme_req(req)->status & 0x7ff) {
> +	/*
> +	 * Generic command status:
> +	 */
> +	case NVME_SC_INVALID_OPCODE:
> +	case NVME_SC_INVALID_FIELD:
> +	case NVME_SC_INVALID_NS:
> +	case NVME_SC_LBA_RANGE:
> +	case NVME_SC_CAP_EXCEEDED:
> +	case NVME_SC_RESERVATION_CONFLICT:
> +		return false;
> +
> +	/*
> +	 * I/O command set specific error.  Unfortunately these values are
> +	 * reused for fabrics commands, but those should never get here.
> +	 */
> +	case NVME_SC_BAD_ATTRIBUTES:
> +	case NVME_SC_INVALID_PI:
> +	case NVME_SC_READ_ONLY:
> +	case NVME_SC_ONCS_NOT_SUPPORTED:
> +		WARN_ON_ONCE(nvme_req(req)->cmd->common.opcode ==
> +			nvme_fabrics_command);
> +		return false;
> +
> +	/*
> +	 * Media and Data Integrity Errors:
> +	 */
> +	case NVME_SC_WRITE_FAULT:
> +	case NVME_SC_READ_ERROR:
> +	case NVME_SC_GUARD_CHECK:
> +	case NVME_SC_APPTAG_CHECK:
> +	case NVME_SC_REFTAG_CHECK:
> +	case NVME_SC_COMPARE_FAILED:
> +	case NVME_SC_ACCESS_DENIED:
> +	case NVME_SC_UNWRITTEN_BLOCK:
>  		return false;
> +	}
> +
> +	/* Anything else could be a path failure, so should be retried */
> +	spin_lock_irqsave(&ns->head->requeue_lock, flags);
> +	blk_steal_bios(&ns->head->requeue_list, req);
> +	spin_unlock_irqrestore(&ns->head->requeue_lock, flags);
> +
> +	nvme_reset_ctrl(ns->ctrl);
> +	kblockd_schedule_work(&ns->head->requeue_work);
> +	return true;
> +}
> +
> +static inline bool nvme_req_needs_retry(struct request *req)
> +{
>  	if (nvme_req(req)->status & NVME_SC_DNR)
>  		return false;
>  	if (jiffies - req->start_time >= req->timeout)
>  		return false;
>  	if (nvme_req(req)->retries >= nvme_max_retries)
>  		return false;
> +	if (nvme_failover_rq(req))
> +		return false;
> +	if (blk_noretry_request(req))
> +		return false;
>  	return true;
>  }

Does this introduce conflicts with current DM-Multipath used for NVMe/NVMeF
when path IO error occurs?  Such IO will be retried not only on the nvme-mpath
internal path, but also on the dm-mpath path.

In general, I wonder whether nvme-mpath can co-exist with DM-multipath
in a well-defined fashion.

  parent reply	other threads:[~2017-08-29 10:22 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 17:58 RFC: nvme multipath support Christoph Hellwig
2017-08-23 17:58 ` Christoph Hellwig
2017-08-23 17:58 ` [PATCH 01/10] nvme: report more detailed status codes to the block layer Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-28  6:06   ` Sagi Grimberg
2017-08-28  6:06     ` Sagi Grimberg
2017-08-28 18:50   ` Keith Busch
2017-08-28 18:50     ` Keith Busch
2017-08-23 17:58 ` [PATCH 02/10] nvme: allow calling nvme_change_ctrl_state from irq context Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-28  6:06   ` Sagi Grimberg
2017-08-28  6:06     ` Sagi Grimberg
2017-08-28 18:50   ` Keith Busch
2017-08-28 18:50     ` Keith Busch
2017-08-23 17:58 ` [PATCH 03/10] nvme: remove unused struct nvme_ns fields Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-28  6:07   ` Sagi Grimberg
2017-08-28  6:07     ` Sagi Grimberg
2017-08-28 19:13   ` Keith Busch
2017-08-28 19:13     ` Keith Busch
2017-08-23 17:58 ` [PATCH 04/10] nvme: remove nvme_revalidate_ns Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-28  6:12   ` Sagi Grimberg
2017-08-28  6:12     ` Sagi Grimberg
2017-08-28 19:14   ` Keith Busch
2017-08-28 19:14     ` Keith Busch
2017-08-23 17:58 ` [PATCH 05/10] nvme: don't blindly overwrite identifiers on disk revalidate Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-28  6:17   ` Sagi Grimberg
2017-08-28  6:17     ` Sagi Grimberg
2017-08-28  6:23     ` Christoph Hellwig
2017-08-28  6:23       ` Christoph Hellwig
2017-08-28  6:32       ` Sagi Grimberg
2017-08-28  6:32         ` Sagi Grimberg
2017-08-28 19:15   ` Keith Busch
2017-08-28 19:15     ` Keith Busch
2017-08-23 17:58 ` [PATCH 06/10] nvme: track subsystems Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-23 22:04   ` Keith Busch
2017-08-23 22:04     ` Keith Busch
2017-08-24  8:52     ` Christoph Hellwig
2017-08-24  8:52       ` Christoph Hellwig
2017-08-28  6:22   ` Sagi Grimberg
2017-08-28  6:22     ` Sagi Grimberg
2017-08-23 17:58 ` [PATCH 07/10] nvme: track shared namespaces Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-28  6:51   ` Sagi Grimberg
2017-08-28  6:51     ` Sagi Grimberg
2017-08-28  8:50     ` Christoph Hellwig
2017-08-28  8:50       ` Christoph Hellwig
2017-08-28 20:21     ` J Freyensee
2017-08-28 20:21       ` J Freyensee
2017-08-29  8:25       ` Christoph Hellwig
2017-08-29  8:25         ` Christoph Hellwig
2017-08-29  6:54     ` Guan Junxiong
2017-08-29  6:54       ` Guan Junxiong
2017-08-28 12:04   ` javigon
2017-08-28 12:04     ` javigon
2017-08-28 12:41   ` Guan Junxiong
2017-08-28 12:41     ` Guan Junxiong
2017-08-28 14:30     ` Christoph Hellwig
2017-08-28 14:30       ` Christoph Hellwig
2017-08-29  2:42       ` Guan Junxiong
2017-08-29  2:42         ` Guan Junxiong
2017-08-29  8:30         ` Christoph Hellwig
2017-08-29  8:30           ` Christoph Hellwig
2017-08-29  8:29     ` Christoph Hellwig
2017-08-29  8:29       ` Christoph Hellwig
2017-08-28 19:18   ` Keith Busch
2017-08-28 19:18     ` Keith Busch
2017-08-23 17:58 ` [PATCH 08/10] block: provide a generic_make_request_fast helper Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-28  7:00   ` Sagi Grimberg
2017-08-28  7:00     ` Sagi Grimberg
2017-08-28  8:54     ` Christoph Hellwig
2017-08-28  8:54       ` Christoph Hellwig
2017-08-28 11:01       ` Sagi Grimberg
2017-08-28 11:01         ` Sagi Grimberg
2017-08-28 11:54         ` Christoph Hellwig
2017-08-28 11:54           ` Christoph Hellwig
2017-08-28 12:38           ` Sagi Grimberg
2017-08-28 12:38             ` Sagi Grimberg
2017-08-23 17:58 ` [PATCH 09/10] blk-mq: add a blk_steal_bios helper Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-28  7:04   ` Sagi Grimberg
2017-08-28  7:04     ` Sagi Grimberg
2017-08-23 17:58 ` [PATCH 10/10] nvme: implement multipath access to nvme subsystems Christoph Hellwig
2017-08-23 17:58   ` Christoph Hellwig
2017-08-23 18:21   ` Bart Van Assche
2017-08-23 18:21     ` Bart Van Assche
2017-08-24  8:59     ` hch
2017-08-24  8:59       ` hch
2017-08-24 20:17       ` Bart Van Assche
2017-08-24 20:17         ` Bart Van Assche
2017-09-05 11:53         ` Christoph Hellwig
2017-09-05 11:53           ` Christoph Hellwig
2017-09-11  6:34           ` Tony Yang
2017-08-23 22:53   ` Keith Busch
2017-08-23 22:53     ` Keith Busch
2017-08-24  8:52     ` Christoph Hellwig
2017-08-24  8:52       ` Christoph Hellwig
2017-08-28  7:23   ` Sagi Grimberg
2017-08-28  7:23     ` Sagi Grimberg
2017-08-28  9:06     ` Christoph Hellwig
2017-08-28  9:06       ` Christoph Hellwig
2017-08-28 13:40       ` Sagi Grimberg
2017-08-28 13:40         ` Sagi Grimberg
2017-08-28 14:24         ` Christoph Hellwig
2017-08-28 14:24           ` Christoph Hellwig
2017-09-07 15:17       ` Tony Yang
2017-08-29 10:22   ` Guan Junxiong [this message]
2017-08-29 10:22     ` Guan Junxiong
2017-08-29 14:51     ` Christoph Hellwig
2017-08-29 14:51       ` Christoph Hellwig
2017-08-29 14:54   ` Keith Busch
2017-08-29 14:54     ` Keith Busch
2017-08-29 14:55     ` Christoph Hellwig
2017-08-29 14:55       ` Christoph Hellwig
2017-08-29 15:41       ` Keith Busch
2017-08-29 15:41         ` Keith Busch
2017-09-18  0:17         ` Christoph Hellwig
2017-09-18  0:17           ` Christoph Hellwig

Reply instructions:

You may reply publicly 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=e751810f-bb91-f764-dd51-ce2faaf209f0@huawei.com \
    --to=guanjunxiong@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=niuhaoxin@huawei.com \
    --cc=sagi@grimberg.me \
    --cc=shenhong09@huawei.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.