Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69fa9646 authored by James Smart's avatar James Smart Committed by Jens Axboe
Browse files

nvme_fc: fix error recovery on link down.



Currently, the fc transport invokes nvme_fc_error_recovery() on every
io in which the transport detects an error.  Which means:
a) it's really noisy on large io loads that all get hit by a link down.
b) we repeatively call nvme_stop_queues() even though queues are
 stopped upon the first error or as first steps of reset_work.

Correct by:
Errors are only meaningful if the controller is in the LIVE state.
Thus, enact the reset_work only if LIVE. If called repeatively, state
will have already transitioned.
There's no need to stop the queues here. Let the first steps of
reset_work do the queue stopping.

Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 188f7e8a
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1749,16 +1749,16 @@ nvme_fc_nvme_ctrl_freed(struct nvme_ctrl *nctrl)
static void
static void
nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg)
nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg)
{
{
	/* only proceed if in LIVE state - e.g. on first error */
	if (ctrl->ctrl.state != NVME_CTRL_LIVE)
		return;

	dev_warn(ctrl->ctrl.device,
	dev_warn(ctrl->ctrl.device,
		"NVME-FC{%d}: transport association error detected: %s\n",
		"NVME-FC{%d}: transport association error detected: %s\n",
		ctrl->cnum, errmsg);
		ctrl->cnum, errmsg);
	dev_warn(ctrl->ctrl.device,
	dev_warn(ctrl->ctrl.device,
		"NVME-FC{%d}: resetting controller\n", ctrl->cnum);
		"NVME-FC{%d}: resetting controller\n", ctrl->cnum);


	/* stop the queues on error, cleanup is in reset thread */
	if (ctrl->queue_count > 1)
		nvme_stop_queues(&ctrl->ctrl);

	if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_RECONNECTING)) {
	if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_RECONNECTING)) {
		dev_err(ctrl->ctrl.device,
		dev_err(ctrl->ctrl.device,
			"NVME-FC{%d}: error_recovery: Couldn't change state "
			"NVME-FC{%d}: error_recovery: Couldn't change state "