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

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 <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20231207224039.35466-4-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Justin Tee and committed by
Martin K. Petersen
aba0fb0e 8dc8eb89

+4 -3
+3 -3
drivers/scsi/lpfc/lpfc_els.c
··· 1130 1130 vport->port_state, vport->fc_flag, 1131 1131 sp->cmn.priority_tagging, kref_read(&ndlp->kref)); 1132 1132 1133 - if (sp->cmn.priority_tagging) 1134 - vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA | 1135 - LPFC_VMID_TYPE_PRIO); 1136 1133 /* reinitialize the VMID datastructure before returning */ 1137 1134 if (lpfc_is_vmid_enabled(phba)) 1138 1135 lpfc_reinit_vmid(vport); 1136 + if (sp->cmn.priority_tagging) 1137 + vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA | 1138 + LPFC_VMID_TYPE_PRIO); 1139 1139 1140 1140 /* 1141 1141 * Address a timing race with dev_loss. If dev_loss is active on
+1
drivers/scsi/lpfc/lpfc_vmid.c
··· 321 321 if (!hash_empty(vport->hash_table)) 322 322 hash_for_each_safe(vport->hash_table, bucket, tmp, cur, hnode) 323 323 hash_del(&cur->hnode); 324 + vport->vmid_flag = 0; 324 325 write_unlock(&vport->vmid_lock); 325 326 }