From: James Smart Date: Tue, 14 Jul 2020 21:14:12 +0000 (-0700) Subject: scsi: lpfc: NVMe remote port devloss_tmo from lldd X-Git-Tag: v5.15~3084^2~164 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f546823147693a054320d05d94f4515fb01748f;p=platform%2Fkernel%2Flinux-starfive.git scsi: lpfc: NVMe remote port devloss_tmo from lldd nvme-fc allows the driver to specify a default devloss_tmo value when registering the remote port. The lpfc driver is currently not doing so, although it is implementing a driver internal node loss value of 30s which also is used on the SCSI FC remote port. As no devloss_tmo is set, the nvme-fc transport defaults to 60s. So there are competing timers. Additionally, due to the competing timers, it is possible the NVMe rport is removed but the SCSI rport remains. It is possible that the SCSI FC rport, which was registered for the NVMe port even if it doesn't utilize the SCSI protocol, had been tuned to not match either the 60s (nvme-fc default) or 30s (lldd default), it gets out of whack. The lldd will defer to the SCSI FC rport as long as the SCSI FC rport has not had its devloss_tmo expire. Correct the situation by specifying a default devloss_tmo to the nvme-fc transport when registering the rport. Take the value from the SCSI FC rport if it exists, otherwise use the driver default. Link: https://lore.kernel.org/r/20200714211412.11773-1-jsmart2021@gmail.com Tested-by: Martin George Signed-off-by: James Smart Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index fdfca02..793388f 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -2423,6 +2423,7 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) struct nvme_fc_remote_port *remote_port; struct nvme_fc_port_info rpinfo; struct lpfc_nodelist *prev_ndlp = NULL; + struct fc_rport *srport = ndlp->rport; lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NVME_DISC, "6006 Register NVME PORT. DID x%06x nlptype x%x\n", @@ -2452,6 +2453,10 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) rpinfo.port_name = wwn_to_u64(ndlp->nlp_portname.u.wwn); rpinfo.node_name = wwn_to_u64(ndlp->nlp_nodename.u.wwn); + if (srport) + rpinfo.dev_loss_tmo = srport->dev_loss_tmo; + else + rpinfo.dev_loss_tmo = vport->cfg_devloss_tmo; spin_lock_irq(&vport->phba->hbalock); oldrport = lpfc_ndlp_get_nrport(ndlp);