scsi: fnic: Remove bogus ratelimit messages
Commit b43abcbbd5
("scsi: fnic: Ratelimit printks to avoid flooding when
vlan is not set by the switch.i") added printk_ratelimit() in front of a
couple of debug-mode messages to reduce logging overrun when debugging the
driver. The code:
> if (printk_ratelimit())
> FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
> "Start VLAN Discovery\n");
ends up calling printk_ratelimit() quite often, triggering many kernel
messages about callbacks being supressed.
The fix is to decompose FNIC_FCS_DBG(), then change the order of checks so
that printk_ratelimit() is only called if driver debugging is enabled.
Link: https://lore.kernel.org/r/20210323172756.5743-1-lduncan@suse.com
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
10d91a15f2
commit
d2478dd256
|
@ -1343,9 +1343,10 @@ void fnic_handle_fip_timer(struct fnic *fnic)
|
||||||
if (list_empty(&fnic->vlans)) {
|
if (list_empty(&fnic->vlans)) {
|
||||||
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
||||||
/* no vlans available, try again */
|
/* no vlans available, try again */
|
||||||
if (printk_ratelimit())
|
if (unlikely(fnic_log_level & FNIC_FCS_LOGGING))
|
||||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
|
if (printk_ratelimit())
|
||||||
"Start VLAN Discovery\n");
|
shost_printk(KERN_DEBUG, fnic->lport->host,
|
||||||
|
"Start VLAN Discovery\n");
|
||||||
fnic_event_enq(fnic, FNIC_EVT_START_VLAN_DISC);
|
fnic_event_enq(fnic, FNIC_EVT_START_VLAN_DISC);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1363,9 +1364,10 @@ void fnic_handle_fip_timer(struct fnic *fnic)
|
||||||
case FIP_VLAN_FAILED:
|
case FIP_VLAN_FAILED:
|
||||||
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
||||||
/* if all vlans are in failed state, restart vlan disc */
|
/* if all vlans are in failed state, restart vlan disc */
|
||||||
if (printk_ratelimit())
|
if (unlikely(fnic_log_level & FNIC_FCS_LOGGING))
|
||||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
|
if (printk_ratelimit())
|
||||||
"Start VLAN Discovery\n");
|
shost_printk(KERN_DEBUG, fnic->lport->host,
|
||||||
|
"Start VLAN Discovery\n");
|
||||||
fnic_event_enq(fnic, FNIC_EVT_START_VLAN_DISC);
|
fnic_event_enq(fnic, FNIC_EVT_START_VLAN_DISC);
|
||||||
break;
|
break;
|
||||||
case FIP_VLAN_SENT:
|
case FIP_VLAN_SENT:
|
||||||
|
|
Loading…
Reference in New Issue