From: Gleb C. <lno...@gm...> - 2022-02-23 12:16:06
|
Commit: 6d353e0 GitHub URL: https://github.com/SCST-project/scst/commit/6d353e0a06db8f635f2fe38f12ed291750020191 Author: Gleb Chesnokov Date: 2022-02-23T15:15:18+03:00 Log Message: ----------- qla2x00t-32gbit: Backport to older kernel versions Unbreak the build for the previous commit against kernel versions before v4.15. See also commit ac7fe82b6fcf ("nvme-fc: add a dev_loss_tmo field to the remoteport") v4.15. Modified Paths: -------------- qla2x00t-32gbit/qla_attr.c | 4 ++++ qla2x00t-32gbit/qla_nvme.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) =================================================================== diff --git a/qla2x00t-32gbit/qla_attr.c b/qla2x00t-32gbit/qla_attr.c index c802484..bba716c 100644 --- a/qla2x00t-32gbit/qla_attr.c +++ b/qla2x00t-32gbit/qla_attr.c @@ -2768,13 +2768,17 @@ qla2x00_get_starget_port_id(struct scsi_target *starget) static inline void qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) fc_port_t *fcport = *(fc_port_t **)rport->dd_data; +#endif rport->dev_loss_tmo = timeout ? timeout : 1; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) if (IS_ENABLED(CONFIG_NVME_FC) && fcport && fcport->nvme_remote_port) nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, rport->dev_loss_tmo); +#endif } static void diff --git a/qla2x00t-32gbit/qla_nvme.c b/qla2x00t-32gbit/qla_nvme.c index e38c01d..97d6562 100644 --- a/qla2x00t-32gbit/qla_nvme.c +++ b/qla2x00t-32gbit/qla_nvme.c @@ -83,8 +83,10 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport) return ret; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, fcport->dev_loss_tmo); +#endif if (fcport->nvme_prli_service_param & NVME_PRLI_SP_SLER) ql_log(ql_log_info, vha, 0x212a, @@ -752,7 +754,7 @@ void qla_nvme_unregister_remote_port(struct fc_port *fcport) "%s: unregister remoteport on %p %8phN\n", __func__, fcport, fcport->port_name); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) if (test_bit(PFLG_DRIVER_REMOVING, &fcport->vha->pci_flags)) nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); #endif |