Skip to content

Commit a1e4d3d

Browse files
Dick Kennedymartinkpetersen
authored andcommitted
scsi: lpfc: Fix FCoE speed reporting
Current Link speed was shown as "unknown" in sysfs for FCoE ports. In this scenario, the port was working in 20G speed, which happens to not be a speed handled by the driver. Add support for all possible link speeds that could get reported from port_speed field in link state ACQE. Additionally, as supported_speeds can't be manipulated via the FCoE driver on a converged ethernet port (it must be managed by the nic function), don't fill out the supported_speeds field for the fc host object in sysfs. Revise debug logging to report Link speed mgmt valuess. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dick Kennedy <[email protected]> Signed-off-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1eaff53 commit a1e4d3d

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

drivers/scsi/lpfc/lpfc_attr.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6679,9 +6679,15 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
66796679
}
66806680
} else if (lpfc_is_link_up(phba) && (phba->hba_flag & HBA_FCOE_MODE)) {
66816681
switch (phba->fc_linkspeed) {
6682+
case LPFC_ASYNC_LINK_SPEED_1GBPS:
6683+
fc_host_speed(shost) = FC_PORTSPEED_1GBIT;
6684+
break;
66826685
case LPFC_ASYNC_LINK_SPEED_10GBPS:
66836686
fc_host_speed(shost) = FC_PORTSPEED_10GBIT;
66846687
break;
6688+
case LPFC_ASYNC_LINK_SPEED_20GBPS:
6689+
fc_host_speed(shost) = FC_PORTSPEED_20GBIT;
6690+
break;
66856691
case LPFC_ASYNC_LINK_SPEED_25GBPS:
66866692
fc_host_speed(shost) = FC_PORTSPEED_25GBIT;
66876693
break;

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4577,6 +4577,13 @@ static void lpfc_host_supported_speeds_set(struct Scsi_Host *shost)
45774577
struct lpfc_hba *phba = vport->phba;
45784578

45794579
fc_host_supported_speeds(shost) = 0;
4580+
/*
4581+
* Avoid reporting supported link speed for FCoE as it can't be
4582+
* controlled via FCoE.
4583+
*/
4584+
if (phba->hba_flag & HBA_FCOE_MODE)
4585+
return;
4586+
45804587
if (phba->lmt & LMT_128Gb)
45814588
fc_host_supported_speeds(shost) |= FC_PORTSPEED_128GBIT;
45824589
if (phba->lmt & LMT_64Gb)
@@ -4910,6 +4917,9 @@ lpfc_sli4_port_speed_parse(struct lpfc_hba *phba, uint32_t evt_code,
49104917
case LPFC_ASYNC_LINK_SPEED_40GBPS:
49114918
port_speed = 40000;
49124919
break;
4920+
case LPFC_ASYNC_LINK_SPEED_100GBPS:
4921+
port_speed = 100000;
4922+
break;
49134923
default:
49144924
port_speed = 0;
49154925
}
@@ -8589,7 +8599,7 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
85898599
"VPI(B:%d M:%d) "
85908600
"VFI(B:%d M:%d) "
85918601
"RPI(B:%d M:%d) "
8592-
"FCFI:%d EQ:%d CQ:%d WQ:%d RQ:%d\n",
8602+
"FCFI:%d EQ:%d CQ:%d WQ:%d RQ:%d lmt:x%x\n",
85938603
phba->sli4_hba.extents_in_use,
85948604
phba->sli4_hba.max_cfg_param.xri_base,
85958605
phba->sli4_hba.max_cfg_param.max_xri,
@@ -8603,7 +8613,8 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
86038613
phba->sli4_hba.max_cfg_param.max_eq,
86048614
phba->sli4_hba.max_cfg_param.max_cq,
86058615
phba->sli4_hba.max_cfg_param.max_wq,
8606-
phba->sli4_hba.max_cfg_param.max_rq);
8616+
phba->sli4_hba.max_cfg_param.max_rq,
8617+
phba->lmt);
86078618

86088619
/*
86098620
* Calculate queue resources based on how

0 commit comments

Comments
 (0)