Commit 90302e95 authored by John Pittman's avatar John Pittman Committed by Martin K. Petersen

scsi: fnic: print port speed only at driver init or speed change

Port speed printing was added by commit d948e638 ("scsi: fnic: Add port
speed stat to fnic debug stats"). As currently configured, this will cause
the port speed to be printed to syslog every 2 seconds. To prevent log
spamming, only print the vnic port speed at driver initialization and if
the speed changes. Also clean up a small typo in fnic_trace.c.

Fixes: d948e638 ("scsi: fnic: Add port speed stat to fnic debug stats")
Signed-off-by: default avatarJohn Pittman <jpittman@redhat.com>
Reviewed-by: default avatarSatish Kharat <satishkh@cisco.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 84769706
...@@ -52,6 +52,7 @@ void fnic_handle_link(struct work_struct *work) ...@@ -52,6 +52,7 @@ void fnic_handle_link(struct work_struct *work)
unsigned long flags; unsigned long flags;
int old_link_status; int old_link_status;
u32 old_link_down_cnt; u32 old_link_down_cnt;
u64 old_port_speed, new_port_speed;
spin_lock_irqsave(&fnic->fnic_lock, flags); spin_lock_irqsave(&fnic->fnic_lock, flags);
...@@ -62,14 +63,19 @@ void fnic_handle_link(struct work_struct *work) ...@@ -62,14 +63,19 @@ void fnic_handle_link(struct work_struct *work)
old_link_down_cnt = fnic->link_down_cnt; old_link_down_cnt = fnic->link_down_cnt;
old_link_status = fnic->link_status; old_link_status = fnic->link_status;
old_port_speed = atomic64_read(
&fnic->fnic_stats.misc_stats.current_port_speed);
fnic->link_status = vnic_dev_link_status(fnic->vdev); fnic->link_status = vnic_dev_link_status(fnic->vdev);
fnic->link_down_cnt = vnic_dev_link_down_cnt(fnic->vdev); fnic->link_down_cnt = vnic_dev_link_down_cnt(fnic->vdev);
new_port_speed = vnic_dev_port_speed(fnic->vdev);
atomic64_set(&fnic->fnic_stats.misc_stats.current_port_speed, atomic64_set(&fnic->fnic_stats.misc_stats.current_port_speed,
vnic_dev_port_speed(fnic->vdev)); new_port_speed);
shost_printk(KERN_INFO, fnic->lport->host, "Current vnic speed set to : %llu\n", if (old_port_speed != new_port_speed)
(u64)atomic64_read( shost_printk(KERN_INFO, fnic->lport->host,
&fnic->fnic_stats.misc_stats.current_port_speed)); "Current vnic speed set to : %llu\n",
new_port_speed);
switch (vnic_dev_port_speed(fnic->vdev)) { switch (vnic_dev_port_speed(fnic->vdev)) {
case DCEM_PORTSPEED_10G: case DCEM_PORTSPEED_10G:
......
...@@ -453,7 +453,7 @@ int fnic_get_stats_data(struct stats_debug_info *debug, ...@@ -453,7 +453,7 @@ int fnic_get_stats_data(struct stats_debug_info *debug,
(u64)atomic64_read(&stats->misc_stats.frame_errors)); (u64)atomic64_read(&stats->misc_stats.frame_errors));
len += snprintf(debug->debug_buffer + len, buf_size - len, len += snprintf(debug->debug_buffer + len, buf_size - len,
"Firmware reported port seed: %llu\n", "Firmware reported port speed: %llu\n",
(u64)atomic64_read( (u64)atomic64_read(
&stats->misc_stats.current_port_speed)); &stats->misc_stats.current_port_speed));
......
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