nvme-fc: add dev_loss_tmo timeout and remoteport resume support
authorJames Smart <jsmart2021@gmail.com>
Wed, 25 Oct 2017 23:43:17 +0000 (16:43 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 Nov 2017 15:34:41 +0000 (16:34 +0100)
commit2b632970da4f288e6dbdc826c34fbf74f40ec94c
tree211680023fb17a5eec414d678ddafb599dbe5e42
parent3cec7f9de448131778a1428100621fd371db75f4
nvme-fc: add dev_loss_tmo timeout and remoteport resume support

When a remoteport is unregistered (connectivity lost), the following
actions are taken:

 - the remoteport is marked DELETED
 - the time when dev_loss_tmo would expire is set in the remoteport
 - all controllers on the remoteport are reset.

After a controller resets, it will stall in a RECONNECTING state waiting
for one of the following:

 - the controller will continue to attempt reconnect per max_retries and
   reconnect_delay.  As no remoteport connectivity, the reconnect attempt
   will immediately fail.  If max reconnects has not been reached, a new
   reconnect_delay timer will be schedule.  If the current time plus
   another reconnect_delay exceeds when dev_loss_tmo expires on the remote
   port, then the reconnect_delay will be shortend to schedule no later
   than when dev_loss_tmo expires.  If max reconnect attempts are reached
   (e.g. ctrl_loss_tmo reached) or dev_loss_tmo ix exceeded without
   connectivity, the controller is deleted.
 - the remoteport is re-registered prior to dev_loss_tmo expiring.
   The resume of the remoteport will immediately attempt to reconnect
   each of its suspended controllers.

Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
[hch: updated to use nvme_delete_ctrl]
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fc.c