Skip to content

Commit 0b86325

Browse files
mrangankarmartinkpetersen
authored andcommitted
scsi: qla2xxx: Use transport-defined speed mask for supported_speeds
One of the sysfs values reported for supported_speeds was not valid (20Gb/s reported instead of 64Gb/s). Instead of driver internal speed mask definition, use speed mask defined in transport_fc for reporting host->supported_speeds. Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Manish Rangankar <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent f915f58 commit 0b86325

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

drivers/scsi/qla2xxx/qla_attr.c

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3330,11 +3330,34 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
33303330
.bsg_timeout = qla24xx_bsg_timeout,
33313331
};
33323332

3333+
static uint
3334+
qla2x00_get_host_supported_speeds(scsi_qla_host_t *vha, uint speeds)
3335+
{
3336+
uint supported_speeds = FC_PORTSPEED_UNKNOWN;
3337+
3338+
if (speeds & FDMI_PORT_SPEED_64GB)
3339+
supported_speeds |= FC_PORTSPEED_64GBIT;
3340+
if (speeds & FDMI_PORT_SPEED_32GB)
3341+
supported_speeds |= FC_PORTSPEED_32GBIT;
3342+
if (speeds & FDMI_PORT_SPEED_16GB)
3343+
supported_speeds |= FC_PORTSPEED_16GBIT;
3344+
if (speeds & FDMI_PORT_SPEED_8GB)
3345+
supported_speeds |= FC_PORTSPEED_8GBIT;
3346+
if (speeds & FDMI_PORT_SPEED_4GB)
3347+
supported_speeds |= FC_PORTSPEED_4GBIT;
3348+
if (speeds & FDMI_PORT_SPEED_2GB)
3349+
supported_speeds |= FC_PORTSPEED_2GBIT;
3350+
if (speeds & FDMI_PORT_SPEED_1GB)
3351+
supported_speeds |= FC_PORTSPEED_1GBIT;
3352+
3353+
return supported_speeds;
3354+
}
3355+
33333356
void
33343357
qla2x00_init_host_attr(scsi_qla_host_t *vha)
33353358
{
33363359
struct qla_hw_data *ha = vha->hw;
3337-
u32 speeds = FC_PORTSPEED_UNKNOWN;
3360+
u32 speeds = 0, fdmi_speed = 0;
33383361

33393362
fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count;
33403363
fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name);
@@ -3344,7 +3367,8 @@ qla2x00_init_host_attr(scsi_qla_host_t *vha)
33443367
fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports;
33453368
fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count;
33463369

3347-
speeds = qla25xx_fdmi_port_speed_capability(ha);
3370+
fdmi_speed = qla25xx_fdmi_port_speed_capability(ha);
3371+
speeds = qla2x00_get_host_supported_speeds(vha, fdmi_speed);
33483372

33493373
fc_host_supported_speeds(vha->host) = speeds;
33503374
}

0 commit comments

Comments
 (0)