Skip to content

Commit a2f0934

Browse files
mrangankargregkh
authored andcommitted
scsi: qla2xxx: Use transport-defined speed mask for supported_speeds
commit 0b86325 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2b1a317 commit a2f0934

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
@@ -3318,11 +3318,34 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
33183318
.bsg_timeout = qla24xx_bsg_timeout,
33193319
};
33203320

3321+
static uint
3322+
qla2x00_get_host_supported_speeds(scsi_qla_host_t *vha, uint speeds)
3323+
{
3324+
uint supported_speeds = FC_PORTSPEED_UNKNOWN;
3325+
3326+
if (speeds & FDMI_PORT_SPEED_64GB)
3327+
supported_speeds |= FC_PORTSPEED_64GBIT;
3328+
if (speeds & FDMI_PORT_SPEED_32GB)
3329+
supported_speeds |= FC_PORTSPEED_32GBIT;
3330+
if (speeds & FDMI_PORT_SPEED_16GB)
3331+
supported_speeds |= FC_PORTSPEED_16GBIT;
3332+
if (speeds & FDMI_PORT_SPEED_8GB)
3333+
supported_speeds |= FC_PORTSPEED_8GBIT;
3334+
if (speeds & FDMI_PORT_SPEED_4GB)
3335+
supported_speeds |= FC_PORTSPEED_4GBIT;
3336+
if (speeds & FDMI_PORT_SPEED_2GB)
3337+
supported_speeds |= FC_PORTSPEED_2GBIT;
3338+
if (speeds & FDMI_PORT_SPEED_1GB)
3339+
supported_speeds |= FC_PORTSPEED_1GBIT;
3340+
3341+
return supported_speeds;
3342+
}
3343+
33213344
void
33223345
qla2x00_init_host_attr(scsi_qla_host_t *vha)
33233346
{
33243347
struct qla_hw_data *ha = vha->hw;
3325-
u32 speeds = FC_PORTSPEED_UNKNOWN;
3348+
u32 speeds = 0, fdmi_speed = 0;
33263349

33273350
fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count;
33283351
fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name);
@@ -3332,7 +3355,8 @@ qla2x00_init_host_attr(scsi_qla_host_t *vha)
33323355
fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports;
33333356
fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count;
33343357

3335-
speeds = qla25xx_fdmi_port_speed_capability(ha);
3358+
fdmi_speed = qla25xx_fdmi_port_speed_capability(ha);
3359+
speeds = qla2x00_get_host_supported_speeds(vha, fdmi_speed);
33363360

33373361
fc_host_supported_speeds(vha->host) = speeds;
33383362
}

0 commit comments

Comments
 (0)