From: Justin Tee Date: Thu, 7 Dec 2023 22:40:37 +0000 (-0800) Subject: scsi: lpfc: Reinitialize an NPIV's VMID data structures after FDISC X-Git-Tag: v6.6.17~326 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d38434f427c659e45570dba43d008bea0365d0d;p=platform%2Fkernel%2Flinux-starfive.git scsi: lpfc: Reinitialize an NPIV's VMID data structures after FDISC [ Upstream commit 8dc8eb89f4df74593ba4bf30c3d31a0fc6d3ea47 ] 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 Signed-off-by: Sasha Levin --- diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 54e47f2..932d479 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -11110,6 +11110,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; }