qla2x00t-32gbit: Synchronize rport dev_loss_tmo setting

Currently, the dev_loss_tmo setting is only ever used for SCSI
devices. This patch reshuffles initialisation such that the SCSI remote
ports are registered before the NVMe ones, allowing the dev_loss_tmo
setting to be synchronized between SCSI and NVMe.

Link: https://lore.kernel.org/r/20211214111139.52503-1-dwagner@suse.de
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit baea0e833f76 upstream ]
This commit is contained in:
Gleb Chesnokov
2022-02-04 13:44:30 +03:00
parent c2f9ce8df8
commit 29d73d7d7c
3 changed files with 13 additions and 8 deletions

View File

@@ -2768,7 +2768,13 @@ qla2x00_get_starget_port_id(struct scsi_target *starget)
static inline void
qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
{
fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
rport->dev_loss_tmo = timeout ? timeout : 1;
if (IS_ENABLED(CONFIG_NVME_FC) && fcport && fcport->nvme_remote_port)
nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port,
rport->dev_loss_tmo);
}
static void

View File

@@ -5831,13 +5831,6 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
qla2x00_dfs_create_rport(vha, fcport);
if (NVME_TARGET(vha->hw, fcport)) {
qla_nvme_register_remote(vha, fcport);
qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_COMPLETE);
qla2x00_set_fcport_state(fcport, FCS_ONLINE);
return;
}
qla24xx_update_fcport_fcp_prio(vha, fcport);
switch (vha->host->active_mode) {
@@ -5859,6 +5852,9 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
break;
}
if (NVME_TARGET(vha->hw, fcport))
qla_nvme_register_remote(vha, fcport);
qla2x00_set_fcport_state(fcport, FCS_ONLINE);
if (IS_IIDMA_CAPABLE(vha->hw) && vha->hw->flags.gpsc_supported) {

View File

@@ -55,7 +55,7 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport)
* ("scsi: qla2xxx: Fix I/O failures during remote port toggle
* testing") # v5.10.
*/
req.dev_loss_tmo = 0;
req.dev_loss_tmo = fcport->dev_loss_tmo;
#endif
if (fcport->nvme_prli_service_param & NVME_PRLI_SP_INITIATOR)
@@ -83,6 +83,9 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport)
return ret;
}
nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port,
fcport->dev_loss_tmo);
if (fcport->nvme_prli_service_param & NVME_PRLI_SP_SLER)
ql_log(ql_log_info, vha, 0x212a,
"PortID:%06x Supports SLER\n", req.port_id);