nvme_fc: retry initial controller connections 3 times
Subsystems (2)
PATCH 1/1 nvme_fc: retry initial controller connections 3 times
Currently, if a frame is lost of command fails as part of initial association create for a new controller, the new controller connection request will immediately fail.
Add in an immediate 3 retry loop before giving up.
--- drivers/nvme/host/fc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/nvme/host/fc.c +12 -2
@@ -2734,7 +2734,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, {struct nvme_fc_ctrl *ctrl;unsigned long flags; -int ret, idx; +int ret, idx, retry;if (!(rport->remoteport.port_role & (FC_PORT_ROLE_NVME_DISCOVERY |FC_PORT_ROLE_NVME_TARGET ))) {
@@ -2825,9 +2825,19 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,list_add_tail (&ctrl->ctrl_list, &rport->ctrl_list);spin_unlock_irqrestore (&rport->lock, flags); - ret =nvme_fc_create_association (ctrl); +for (retry =0 ; retry <3 ; retry++) { + ret =nvme_fc_create_association (ctrl); +if (!ret) +break ; + } +if (ret) { +/* couldn't schedule retry - fail out */ +dev_err (ctrl->ctrl.device, +"NVME-FC{%d}: Connect retry failed\n" , ctrl->cnum); + ctrl->ctrl.opts =NULL ; +/* initiate nvme ctrl ref counting teardown */ nvme_uninit_ctrl (&ctrl->ctrl);nvme_put_ctrl (&ctrl->ctrl);
Signature · 1 line
2.13.1
PATCH 1/1 nvme_fc: retry initial controller connections 3 times
Quoted 5 lines · James Smart
Currently, if a frame is lost of command fails as part of initial association create for a new controller, the new controller connection request will immediately fail.
Add in an immediate 3 retry loop before giving up.
How do we end up with the magic 3 value?
PATCH 1/1 nvme_fc: retry initial controller connections 3 times
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · James Smart
Currently, if a frame is lost of command fails as part of initial association create for a new controller, the new controller connection request will immediately fail.
Add in an immediate 3 retry loop before giving up.
How do we end up with the magic 3 value?
:) it's better than 2 ?