Loading drivers/nvme/host/fabrics.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -474,7 +474,7 @@ EXPORT_SYMBOL_GPL(nvmf_connect_io_queue); bool nvmf_should_reconnect(struct nvme_ctrl *ctrl) bool nvmf_should_reconnect(struct nvme_ctrl *ctrl) { { if (ctrl->opts->max_reconnects != -1 && if (ctrl->opts->max_reconnects != -1 && ctrl->opts->nr_reconnects < ctrl->opts->max_reconnects) ctrl->nr_reconnects < ctrl->opts->max_reconnects) return true; return true; return false; return false; Loading drivers/nvme/host/fabrics.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -80,7 +80,6 @@ enum { * @discovery_nqn: indicates if the subsysnqn is the well-known discovery NQN. * @discovery_nqn: indicates if the subsysnqn is the well-known discovery NQN. * @kato: Keep-alive timeout. * @kato: Keep-alive timeout. * @host: Virtual NVMe host, contains the NQN and Host ID. * @host: Virtual NVMe host, contains the NQN and Host ID. * @nr_reconnects: number of reconnect attempted since the last ctrl failure * @max_reconnects: maximum number of allowed reconnect attempts before removing * @max_reconnects: maximum number of allowed reconnect attempts before removing * the controller, (-1) means reconnect forever, zero means remove * the controller, (-1) means reconnect forever, zero means remove * immediately; * immediately; Loading @@ -98,7 +97,6 @@ struct nvmf_ctrl_options { bool discovery_nqn; bool discovery_nqn; unsigned int kato; unsigned int kato; struct nvmf_host *host; struct nvmf_host *host; int nr_reconnects; int max_reconnects; int max_reconnects; }; }; Loading drivers/nvme/host/fc.c +3 −3 Original line number Original line Diff line number Diff line Loading @@ -2310,7 +2310,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) int ret; int ret; bool changed; bool changed; ++ctrl->ctrl.opts->nr_reconnects; ++ctrl->ctrl.nr_reconnects; /* /* * Create the admin queue * Create the admin queue Loading Loading @@ -2407,7 +2407,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); WARN_ON_ONCE(!changed); WARN_ON_ONCE(!changed); ctrl->ctrl.opts->nr_reconnects = 0; ctrl->ctrl.nr_reconnects = 0; if (ctrl->queue_count > 1) { if (ctrl->queue_count > 1) { nvme_start_queues(&ctrl->ctrl); nvme_start_queues(&ctrl->ctrl); Loading Loading @@ -2612,7 +2612,7 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status) dev_warn(ctrl->ctrl.device, dev_warn(ctrl->ctrl.device, "NVME-FC{%d}: Max reconnect attempts (%d) " "NVME-FC{%d}: Max reconnect attempts (%d) " "reached. Removing controller\n", "reached. Removing controller\n", ctrl->cnum, ctrl->ctrl.opts->nr_reconnects); ctrl->cnum, ctrl->ctrl.nr_reconnects); WARN_ON(__nvme_fc_schedule_delete_work(ctrl)); WARN_ON(__nvme_fc_schedule_delete_work(ctrl)); } } } } Loading drivers/nvme/host/nvme.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -177,6 +177,7 @@ struct nvme_ctrl { u32 iorcsz; u32 iorcsz; u16 icdoff; u16 icdoff; u16 maxcmd; u16 maxcmd; int nr_reconnects; struct nvmf_ctrl_options *opts; struct nvmf_ctrl_options *opts; }; }; Loading drivers/nvme/host/rdma.c +3 −3 Original line number Original line Diff line number Diff line Loading @@ -725,7 +725,7 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) bool changed; bool changed; int ret; int ret; ++ctrl->ctrl.opts->nr_reconnects; ++ctrl->ctrl.nr_reconnects; if (ctrl->queue_count > 1) { if (ctrl->queue_count > 1) { nvme_rdma_free_io_queues(ctrl); nvme_rdma_free_io_queues(ctrl); Loading Loading @@ -769,7 +769,7 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); WARN_ON_ONCE(!changed); WARN_ON_ONCE(!changed); ctrl->ctrl.opts->nr_reconnects = 0; ctrl->ctrl.nr_reconnects = 0; if (ctrl->queue_count > 1) { if (ctrl->queue_count > 1) { nvme_queue_scan(&ctrl->ctrl); nvme_queue_scan(&ctrl->ctrl); Loading @@ -782,7 +782,7 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) requeue: requeue: dev_info(ctrl->ctrl.device, "Failed reconnect attempt %d\n", dev_info(ctrl->ctrl.device, "Failed reconnect attempt %d\n", ctrl->ctrl.opts->nr_reconnects); ctrl->ctrl.nr_reconnects); nvme_rdma_reconnect_or_remove(ctrl); nvme_rdma_reconnect_or_remove(ctrl); } } Loading Loading
drivers/nvme/host/fabrics.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -474,7 +474,7 @@ EXPORT_SYMBOL_GPL(nvmf_connect_io_queue); bool nvmf_should_reconnect(struct nvme_ctrl *ctrl) bool nvmf_should_reconnect(struct nvme_ctrl *ctrl) { { if (ctrl->opts->max_reconnects != -1 && if (ctrl->opts->max_reconnects != -1 && ctrl->opts->nr_reconnects < ctrl->opts->max_reconnects) ctrl->nr_reconnects < ctrl->opts->max_reconnects) return true; return true; return false; return false; Loading
drivers/nvme/host/fabrics.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -80,7 +80,6 @@ enum { * @discovery_nqn: indicates if the subsysnqn is the well-known discovery NQN. * @discovery_nqn: indicates if the subsysnqn is the well-known discovery NQN. * @kato: Keep-alive timeout. * @kato: Keep-alive timeout. * @host: Virtual NVMe host, contains the NQN and Host ID. * @host: Virtual NVMe host, contains the NQN and Host ID. * @nr_reconnects: number of reconnect attempted since the last ctrl failure * @max_reconnects: maximum number of allowed reconnect attempts before removing * @max_reconnects: maximum number of allowed reconnect attempts before removing * the controller, (-1) means reconnect forever, zero means remove * the controller, (-1) means reconnect forever, zero means remove * immediately; * immediately; Loading @@ -98,7 +97,6 @@ struct nvmf_ctrl_options { bool discovery_nqn; bool discovery_nqn; unsigned int kato; unsigned int kato; struct nvmf_host *host; struct nvmf_host *host; int nr_reconnects; int max_reconnects; int max_reconnects; }; }; Loading
drivers/nvme/host/fc.c +3 −3 Original line number Original line Diff line number Diff line Loading @@ -2310,7 +2310,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) int ret; int ret; bool changed; bool changed; ++ctrl->ctrl.opts->nr_reconnects; ++ctrl->ctrl.nr_reconnects; /* /* * Create the admin queue * Create the admin queue Loading Loading @@ -2407,7 +2407,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); WARN_ON_ONCE(!changed); WARN_ON_ONCE(!changed); ctrl->ctrl.opts->nr_reconnects = 0; ctrl->ctrl.nr_reconnects = 0; if (ctrl->queue_count > 1) { if (ctrl->queue_count > 1) { nvme_start_queues(&ctrl->ctrl); nvme_start_queues(&ctrl->ctrl); Loading Loading @@ -2612,7 +2612,7 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status) dev_warn(ctrl->ctrl.device, dev_warn(ctrl->ctrl.device, "NVME-FC{%d}: Max reconnect attempts (%d) " "NVME-FC{%d}: Max reconnect attempts (%d) " "reached. Removing controller\n", "reached. Removing controller\n", ctrl->cnum, ctrl->ctrl.opts->nr_reconnects); ctrl->cnum, ctrl->ctrl.nr_reconnects); WARN_ON(__nvme_fc_schedule_delete_work(ctrl)); WARN_ON(__nvme_fc_schedule_delete_work(ctrl)); } } } } Loading
drivers/nvme/host/nvme.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -177,6 +177,7 @@ struct nvme_ctrl { u32 iorcsz; u32 iorcsz; u16 icdoff; u16 icdoff; u16 maxcmd; u16 maxcmd; int nr_reconnects; struct nvmf_ctrl_options *opts; struct nvmf_ctrl_options *opts; }; }; Loading
drivers/nvme/host/rdma.c +3 −3 Original line number Original line Diff line number Diff line Loading @@ -725,7 +725,7 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) bool changed; bool changed; int ret; int ret; ++ctrl->ctrl.opts->nr_reconnects; ++ctrl->ctrl.nr_reconnects; if (ctrl->queue_count > 1) { if (ctrl->queue_count > 1) { nvme_rdma_free_io_queues(ctrl); nvme_rdma_free_io_queues(ctrl); Loading Loading @@ -769,7 +769,7 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); WARN_ON_ONCE(!changed); WARN_ON_ONCE(!changed); ctrl->ctrl.opts->nr_reconnects = 0; ctrl->ctrl.nr_reconnects = 0; if (ctrl->queue_count > 1) { if (ctrl->queue_count > 1) { nvme_queue_scan(&ctrl->ctrl); nvme_queue_scan(&ctrl->ctrl); Loading @@ -782,7 +782,7 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) requeue: requeue: dev_info(ctrl->ctrl.device, "Failed reconnect attempt %d\n", dev_info(ctrl->ctrl.device, "Failed reconnect attempt %d\n", ctrl->ctrl.opts->nr_reconnects); ctrl->ctrl.nr_reconnects); nvme_rdma_reconnect_or_remove(ctrl); nvme_rdma_reconnect_or_remove(ctrl); } } Loading