Skip to content

Commit aba0fb0

Browse files
Justin Teemartinkpetersen
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 8dc8eb8 commit aba0fb0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,12 +1130,12 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
11301130
vport->port_state, vport->fc_flag,
11311131
sp->cmn.priority_tagging, kref_read(&ndlp->kref));
11321132

1133-
if (sp->cmn.priority_tagging)
1134-
vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA |
1135-
LPFC_VMID_TYPE_PRIO);
11361133
/* reinitialize the VMID datastructure before returning */
11371134
if (lpfc_is_vmid_enabled(phba))
11381135
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);
11391139

11401140
/*
11411141
* Address a timing race with dev_loss. If dev_loss is active on

drivers/scsi/lpfc/lpfc_vmid.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,5 +321,6 @@ lpfc_reinit_vmid(struct lpfc_vport *vport)
321321
if (!hash_empty(vport->hash_table))
322322
hash_for_each_safe(vport->hash_table, bucket, tmp, cur, hnode)
323323
hash_del(&cur->hnode);
324+
vport->vmid_flag = 0;
324325
write_unlock(&vport->vmid_lock);
325326
}

0 commit comments

Comments
 (0)