Commit c364c453 authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Revise FDMI reporting of supported port speed for trunk groups

Trunk port FDMI supported port speed shows single port supported speed
rather than the trunked port speed.

Modify supported port speed logic calculation during registration.

Link: https://lore.kernel.org/r/20220412222008.126521-17-jsmart2021@gmail.comCo-developed-by: default avatarJustin Tee <justin.tee@broadcom.com>
Signed-off-by: default avatarJustin Tee <justin.tee@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d6d45f67
......@@ -2830,31 +2830,59 @@ lpfc_fdmi_port_attr_support_speed(struct lpfc_vport *vport,
struct lpfc_hba *phba = vport->phba;
struct lpfc_fdmi_attr_entry *ae;
uint32_t size;
u32 tcfg;
u8 i, cnt;
ae = &ad->AttrValue;
ae->un.AttrInt = 0;
if (!(phba->hba_flag & HBA_FCOE_MODE)) {
if (phba->lmt & LMT_256Gb)
ae->un.AttrInt |= HBA_PORTSPEED_256GFC;
if (phba->lmt & LMT_128Gb)
ae->un.AttrInt |= HBA_PORTSPEED_128GFC;
if (phba->lmt & LMT_64Gb)
ae->un.AttrInt |= HBA_PORTSPEED_64GFC;
if (phba->lmt & LMT_32Gb)
ae->un.AttrInt |= HBA_PORTSPEED_32GFC;
if (phba->lmt & LMT_16Gb)
ae->un.AttrInt |= HBA_PORTSPEED_16GFC;
if (phba->lmt & LMT_10Gb)
ae->un.AttrInt |= HBA_PORTSPEED_10GFC;
if (phba->lmt & LMT_8Gb)
ae->un.AttrInt |= HBA_PORTSPEED_8GFC;
if (phba->lmt & LMT_4Gb)
ae->un.AttrInt |= HBA_PORTSPEED_4GFC;
if (phba->lmt & LMT_2Gb)
ae->un.AttrInt |= HBA_PORTSPEED_2GFC;
if (phba->lmt & LMT_1Gb)
ae->un.AttrInt |= HBA_PORTSPEED_1GFC;
cnt = 0;
if (phba->sli_rev == LPFC_SLI_REV4) {
tcfg = phba->sli4_hba.conf_trunk;
for (i = 0; i < 4; i++, tcfg >>= 1)
if (tcfg & 1)
cnt++;
}
if (cnt > 2) { /* 4 lane trunk group */
if (phba->lmt & LMT_64Gb)
ae->un.AttrInt |= HBA_PORTSPEED_256GFC;
if (phba->lmt & LMT_32Gb)
ae->un.AttrInt |= HBA_PORTSPEED_128GFC;
if (phba->lmt & LMT_16Gb)
ae->un.AttrInt |= HBA_PORTSPEED_64GFC;
} else if (cnt) { /* 2 lane trunk group */
if (phba->lmt & LMT_128Gb)
ae->un.AttrInt |= HBA_PORTSPEED_256GFC;
if (phba->lmt & LMT_64Gb)
ae->un.AttrInt |= HBA_PORTSPEED_128GFC;
if (phba->lmt & LMT_32Gb)
ae->un.AttrInt |= HBA_PORTSPEED_64GFC;
if (phba->lmt & LMT_16Gb)
ae->un.AttrInt |= HBA_PORTSPEED_32GFC;
} else {
if (phba->lmt & LMT_256Gb)
ae->un.AttrInt |= HBA_PORTSPEED_256GFC;
if (phba->lmt & LMT_128Gb)
ae->un.AttrInt |= HBA_PORTSPEED_128GFC;
if (phba->lmt & LMT_64Gb)
ae->un.AttrInt |= HBA_PORTSPEED_64GFC;
if (phba->lmt & LMT_32Gb)
ae->un.AttrInt |= HBA_PORTSPEED_32GFC;
if (phba->lmt & LMT_16Gb)
ae->un.AttrInt |= HBA_PORTSPEED_16GFC;
if (phba->lmt & LMT_10Gb)
ae->un.AttrInt |= HBA_PORTSPEED_10GFC;
if (phba->lmt & LMT_8Gb)
ae->un.AttrInt |= HBA_PORTSPEED_8GFC;
if (phba->lmt & LMT_4Gb)
ae->un.AttrInt |= HBA_PORTSPEED_4GFC;
if (phba->lmt & LMT_2Gb)
ae->un.AttrInt |= HBA_PORTSPEED_2GFC;
if (phba->lmt & LMT_1Gb)
ae->un.AttrInt |= HBA_PORTSPEED_1GFC;
}
} else {
/* FCoE links support only one speed */
switch (phba->fc_linkspeed) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment