summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fnic
diff options
context:
space:
mode:
authorSatish Kharat <satishkh@cisco.com>2017-03-01 01:11:57 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2017-03-23 14:51:25 +0100
commitb43abcbbd5b10d5f057c8388cc4eff9ff1fe2fd6 (patch)
tree678c4ea7848cb66c33ec905751696860d34f4c6a /drivers/scsi/fnic
parentscsi: fnic: switch to pci_alloc_irq_vectors (diff)
downloadlinux-b43abcbbd5b10d5f057c8388cc4eff9ff1fe2fd6.tar.xz
linux-b43abcbbd5b10d5f057c8388cc4eff9ff1fe2fd6.zip
scsi: fnic: Ratelimit printks to avoid flooding when vlan is not set by the switch.i
This is to avoid the log from being filled with vlan discovery messages when there is no vlan configured on the switch. Signed-off-by: Satish Kharat <satishkh@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/fnic')
-rw-r--r--drivers/scsi/fnic/fnic_fcs.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
index 3b7da66e2771..8d2d86e0bc72 100644
--- a/drivers/scsi/fnic/fnic_fcs.c
+++ b/drivers/scsi/fnic/fnic_fcs.c
@@ -342,8 +342,11 @@ static void fnic_fcoe_send_vlan_req(struct fnic *fnic)
fnic_fcoe_reset_vlans(fnic);
fnic->set_vlan(fnic, 0);
- FNIC_FCS_DBG(KERN_INFO, fnic->lport->host,
- "Sending VLAN request...\n");
+
+ if (printk_ratelimit())
+ FNIC_FCS_DBG(KERN_INFO, fnic->lport->host,
+ "Sending VLAN request...\n");
+
skb = dev_alloc_skb(sizeof(struct fip_vlan));
if (!skb)
return;
@@ -1313,10 +1316,11 @@ void fnic_handle_fip_timer(struct fnic *fnic)
spin_lock_irqsave(&fnic->vlans_lock, flags);
if (list_empty(&fnic->vlans)) {
- /* no vlans available, try again */
- FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
- "Start VLAN Discovery\n");
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
+ /* no vlans available, try again */
+ if (printk_ratelimit())
+ FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
+ "Start VLAN Discovery\n");
fnic_event_enq(fnic, FNIC_EVT_START_VLAN_DISC);
return;
}
@@ -1332,10 +1336,11 @@ void fnic_handle_fip_timer(struct fnic *fnic)
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
break;
case FIP_VLAN_FAILED:
- /* if all vlans are in failed state, restart vlan disc */
- FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
- "Start VLAN Discovery\n");
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
+ /* if all vlans are in failed state, restart vlan disc */
+ if (printk_ratelimit())
+ FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
+ "Start VLAN Discovery\n");
fnic_event_enq(fnic, FNIC_EVT_START_VLAN_DISC);
break;
case FIP_VLAN_SENT: