From 0653d40935f7cc125bfab34fd702559c61ce7560 Mon Sep 17 00:00:00 2001 From: Justin Tee Date: Thu, 7 Dec 2023 14:40:36 -0800 Subject: scsi: lpfc: Change VMID driver load time parameters to read only VMID driver support is a load time configuration setting. Thus, change sysfs attributes to read only. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231207224039.35466-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen --- drivers/scsi/lpfc/lpfc_attr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 48c727a51193..d3a5d6ecdf7d 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -5954,7 +5954,7 @@ LPFC_ATTR_R(enable_mi, 1, 0, 1, "Enable MI"); * 4 - 255 = vmid support enabled for 4-255 VMs * Value range is [4,255]. */ -LPFC_ATTR_RW(max_vmid, LPFC_MIN_VMID, LPFC_MIN_VMID, LPFC_MAX_VMID, +LPFC_ATTR_R(max_vmid, LPFC_MIN_VMID, LPFC_MIN_VMID, LPFC_MAX_VMID, "Maximum number of VMs supported"); /* @@ -5962,7 +5962,7 @@ LPFC_ATTR_RW(max_vmid, LPFC_MIN_VMID, LPFC_MIN_VMID, LPFC_MAX_VMID, * 0 = Timeout is disabled * Value range is [0,24]. */ -LPFC_ATTR_RW(vmid_inactivity_timeout, 4, 0, 24, +LPFC_ATTR_R(vmid_inactivity_timeout, 4, 0, 24, "Inactivity timeout in hours"); /* @@ -5971,7 +5971,7 @@ LPFC_ATTR_RW(vmid_inactivity_timeout, 4, 0, 24, * 1 = Support is enabled * Value range is [0,1]. */ -LPFC_ATTR_RW(vmid_app_header, LPFC_VMID_APP_HEADER_DISABLE, +LPFC_ATTR_R(vmid_app_header, LPFC_VMID_APP_HEADER_DISABLE, LPFC_VMID_APP_HEADER_DISABLE, LPFC_VMID_APP_HEADER_ENABLE, "Enable App Header VMID support"); @@ -5982,7 +5982,7 @@ LPFC_ATTR_RW(vmid_app_header, LPFC_VMID_APP_HEADER_DISABLE, * 2 = Allow all targets * Value range is [0,2]. */ -LPFC_ATTR_RW(vmid_priority_tagging, LPFC_VMID_PRIO_TAG_DISABLE, +LPFC_ATTR_R(vmid_priority_tagging, LPFC_VMID_PRIO_TAG_DISABLE, LPFC_VMID_PRIO_TAG_DISABLE, LPFC_VMID_PRIO_TAG_ALL_TARGETS, "Enable Priority Tagging VMID support"); -- cgit v1.2.3 From 8dc8eb89f4df74593ba4bf30c3d31a0fc6d3ea47 Mon Sep 17 00:00:00 2001 From: Justin Tee Date: Thu, 7 Dec 2023 14:40:37 -0800 Subject: scsi: lpfc: Reinitialize an NPIV's VMID data structures after FDISC After a follow up FDISC cmpl, an NPIV's VMID data structures are not updated. Fix by calling lpfc_reinit_vmid and copying the physical port's vmid_flag to the NPIV's vmid_flag in the NPIV registration cmpl code path. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231207224039.35466-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen --- drivers/scsi/lpfc/lpfc_els.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers') diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index f04326db8c19..3b7ed8bca01a 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -11143,6 +11143,14 @@ mbox_err_exit: lpfc_nlp_put(ndlp); mempool_free(pmb, phba->mbox_mem_pool); + + /* reinitialize the VMID datastructure before returning. + * this is specifically for vport + */ + if (lpfc_is_vmid_enabled(phba)) + lpfc_reinit_vmid(vport); + vport->vmid_flag = vport->phba->pport->vmid_flag; + return; } -- cgit v1.2.3 From aba0fb0ef607a71511d23a07406f11130c1a54c5 Mon Sep 17 00:00:00 2001 From: Justin Tee Date: Thu, 7 Dec 2023 14:40:38 -0800 Subject: scsi: lpfc: Move determination of vmid_flag after VMID reinitialization completes If priority tagging is set in the service parameters of a FLOGI cmpl, then we update the vmid_flag. In the current logic, if a follow up FLOGI cmpl updates its service parameters such that priority tagging is no longer set, then the vmid_flag ends up keeping stale data. Fix by ensuring we clear the vmid_flag member during lpfc_reinit_vmid, and check the priority tagging service parameter after reinitialization of the vmid data structures. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231207224039.35466-4-justintee8345@gmail.com Signed-off-by: Martin K. Petersen --- drivers/scsi/lpfc/lpfc_els.c | 6 +++--- drivers/scsi/lpfc/lpfc_vmid.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 3b7ed8bca01a..4d723200690a 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1130,12 +1130,12 @@ stop_rr_fcf_flogi: vport->port_state, vport->fc_flag, sp->cmn.priority_tagging, kref_read(&ndlp->kref)); - if (sp->cmn.priority_tagging) - vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA | - LPFC_VMID_TYPE_PRIO); /* reinitialize the VMID datastructure before returning */ if (lpfc_is_vmid_enabled(phba)) lpfc_reinit_vmid(vport); + if (sp->cmn.priority_tagging) + vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA | + LPFC_VMID_TYPE_PRIO); /* * Address a timing race with dev_loss. If dev_loss is active on diff --git a/drivers/scsi/lpfc/lpfc_vmid.c b/drivers/scsi/lpfc/lpfc_vmid.c index cf8ba840d0ea..773e02ae20c3 100644 --- a/drivers/scsi/lpfc/lpfc_vmid.c +++ b/drivers/scsi/lpfc/lpfc_vmid.c @@ -321,5 +321,6 @@ lpfc_reinit_vmid(struct lpfc_vport *vport) if (!hash_empty(vport->hash_table)) hash_for_each_safe(vport->hash_table, bucket, tmp, cur, hnode) hash_del(&cur->hnode); + vport->vmid_flag = 0; write_unlock(&vport->vmid_lock); } -- cgit v1.2.3 From 819952d58478b121bab52c1bf6ec21e46e752191 Mon Sep 17 00:00:00 2001 From: Justin Tee Date: Thu, 7 Dec 2023 14:40:39 -0800 Subject: scsi: lpfc: Update lpfc version to 14.2.0.17 Update lpfc version to 14.2.0.17 Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231207224039.35466-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index b7d39e2f19fc..aba1c1cee8c4 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h @@ -20,7 +20,7 @@ * included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "14.2.0.16" +#define LPFC_DRIVER_VERSION "14.2.0.17" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */ -- cgit v1.2.3