scsi: lpfc: Fix sysfs Speed value on CNA ports

CNA ports were showing speed as "unknown" even if the link is up.

Add speed decoding for FCOE-based adapters.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
James Smart 2018-07-31 17:23:19 -07:00 коммит произвёл Martin K. Petersen
Родитель faa832e97a
Коммит b615a20adf
1 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -5927,6 +5927,24 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
break; break;
} }
} else if (lpfc_is_link_up(phba) && (phba->hba_flag & HBA_FCOE_MODE)) {
switch (phba->fc_linkspeed) {
case LPFC_ASYNC_LINK_SPEED_10GBPS:
fc_host_speed(shost) = FC_PORTSPEED_10GBIT;
break;
case LPFC_ASYNC_LINK_SPEED_25GBPS:
fc_host_speed(shost) = FC_PORTSPEED_25GBIT;
break;
case LPFC_ASYNC_LINK_SPEED_40GBPS:
fc_host_speed(shost) = FC_PORTSPEED_40GBIT;
break;
case LPFC_ASYNC_LINK_SPEED_100GBPS:
fc_host_speed(shost) = FC_PORTSPEED_100GBIT;
break;
default:
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
break;
}
} else } else
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;