Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: qla2xxx: 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>

authored by

Hannes Reinecke and committed by
Martin K. Petersen
baea0e83 87f77d37

+13 -8
+6
drivers/scsi/qla2xxx/qla_attr.c
··· 2700 2700 static inline void 2701 2701 qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) 2702 2702 { 2703 + fc_port_t *fcport = *(fc_port_t **)rport->dd_data; 2704 + 2703 2705 rport->dev_loss_tmo = timeout ? timeout : 1; 2706 + 2707 + if (IS_ENABLED(CONFIG_NVME_FC) && fcport && fcport->nvme_remote_port) 2708 + nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 2709 + rport->dev_loss_tmo); 2704 2710 } 2705 2711 2706 2712 static void
+3 -7
drivers/scsi/qla2xxx/qla_init.c
··· 5828 5828 5829 5829 qla2x00_dfs_create_rport(vha, fcport); 5830 5830 5831 - if (NVME_TARGET(vha->hw, fcport)) { 5832 - qla_nvme_register_remote(vha, fcport); 5833 - qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_COMPLETE); 5834 - qla2x00_set_fcport_state(fcport, FCS_ONLINE); 5835 - return; 5836 - } 5837 - 5838 5831 qla24xx_update_fcport_fcp_prio(vha, fcport); 5839 5832 5840 5833 switch (vha->host->active_mode) { ··· 5848 5855 default: 5849 5856 break; 5850 5857 } 5858 + 5859 + if (NVME_TARGET(vha->hw, fcport)) 5860 + qla_nvme_register_remote(vha, fcport); 5851 5861 5852 5862 qla2x00_set_fcport_state(fcport, FCS_ONLINE); 5853 5863
+4 -1
drivers/scsi/qla2xxx/qla_nvme.c
··· 43 43 req.port_name = wwn_to_u64(fcport->port_name); 44 44 req.node_name = wwn_to_u64(fcport->node_name); 45 45 req.port_role = 0; 46 - req.dev_loss_tmo = 0; 46 + req.dev_loss_tmo = fcport->dev_loss_tmo; 47 47 48 48 if (fcport->nvme_prli_service_param & NVME_PRLI_SP_INITIATOR) 49 49 req.port_role = FC_PORT_ROLE_NVME_INITIATOR; ··· 69 69 ret); 70 70 return ret; 71 71 } 72 + 73 + nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 74 + fcport->dev_loss_tmo); 72 75 73 76 if (fcport->nvme_prli_service_param & NVME_PRLI_SP_SLER) 74 77 ql_log(ql_log_info, vha, 0x212a,