Re: [PATCH 1/9] lpfc: Synchronize NVME transport and lpfc driver devloss_tmo

James Smart
2020-05-03T14:42:05Z

On 5/1/2020 2:43 PM, James Smart wrote:
> The driver is not passing it's devloss tmo to the nvme-fc transport when
> registering the remote port. Thus devloss tmo for the nvme-fc remote port
> will be set to the transport's default. This causes driver actions to be
> out of sync with transport actions and out of sync with scsi actions for
> perhaps the same remote port.
>
> This is especially notable in the following scenario: while remote port
> is attached, devloss is changed globally for lpfc remote ports via lpfc
> sysfs parameter. lpfc ties this change in with nvme-fc transport. If the
> device disconnects long enough for devloss to expire thus the existing
> remote port is deleted, then the remote port is re-discovered, the newly
> created remote port will end up set at the transport default, not lpfc's
> value.
>
> Fix by setting devloss tmo value when registering the remote port.
>
> Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> ---
> drivers/scsi/lpfc/lpfc_nvme.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
> index 12d2b2775773..43df08aeecf1 100644
> --- a/drivers/scsi/lpfc/lpfc_nvme.c
> +++ b/drivers/scsi/lpfc/lpfc_nvme.c
> @@ -2296,6 +2296,7 @@ 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);
> + rpinfo.dev_loss_tmo = vport->cfg_devloss_tmo;
>
> spin_lock_irq(&vport->phba->hbalock);
> oldrport = lpfc_ndlp_get_nrport(ndlp);

Please drop this patch from this set.  Christoph is having me change a
patch submitted to the nvme tree that will require this change and one
other lpfc modification. Easier to manage if this patch merges via the
nvme tree rather than the scsi tree.

-- james