All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lpfc: nvme remote port devloss_tmo from lldd
@ 2020-07-14 21:14 James Smart
  2020-07-15 22:14 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: James Smart @ 2020-07-14 21:14 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Smart, Martin George

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's competing timers.

Additionally, due to the competing timers, its possible the nvme rport
is removed but the scsi rport remains. Its 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.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Tested-by: Martin George <Martin.George@netapp.com>
---
 drivers/scsi/lpfc/lpfc_nvme.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index fdfca02704dc..793388fff332 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);
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lpfc: nvme remote port devloss_tmo from lldd
  2020-07-14 21:14 [PATCH] lpfc: nvme remote port devloss_tmo from lldd James Smart
@ 2020-07-15 22:14 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2020-07-15 22:14 UTC (permalink / raw)
  To: James Smart, linux-scsi; +Cc: Martin K . Petersen, Martin George

On Tue, 14 Jul 2020 14:14:12 -0700, James Smart wrote:

> 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's competing timers.
> 
> Additionally, due to the competing timers, its possible the nvme rport
> is removed but the scsi rport remains. Its 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.
> 
> [...]

Applied to 5.9/scsi-queue, thanks!

[1/1] scsi: lpfc: NVMe remote port devloss_tmo from lldd
      https://git.kernel.org/mkp/scsi/c/1f5468231476

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-15 22:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 21:14 [PATCH] lpfc: nvme remote port devloss_tmo from lldd James Smart
2020-07-15 22:14 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.