mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-29 07:34:06 +08:00
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>
This commit is contained in:
parent
cca678dfba
commit
b43abcbbd5
@ -342,8 +342,11 @@ static void fnic_fcoe_send_vlan_req(struct fnic *fnic)
|
|||||||
|
|
||||||
fnic_fcoe_reset_vlans(fnic);
|
fnic_fcoe_reset_vlans(fnic);
|
||||||
fnic->set_vlan(fnic, 0);
|
fnic->set_vlan(fnic, 0);
|
||||||
|
|
||||||
|
if (printk_ratelimit())
|
||||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host,
|
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host,
|
||||||
"Sending VLAN request...\n");
|
"Sending VLAN request...\n");
|
||||||
|
|
||||||
skb = dev_alloc_skb(sizeof(struct fip_vlan));
|
skb = dev_alloc_skb(sizeof(struct fip_vlan));
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return;
|
return;
|
||||||
@ -1313,10 +1316,11 @@ void fnic_handle_fip_timer(struct fnic *fnic)
|
|||||||
|
|
||||||
spin_lock_irqsave(&fnic->vlans_lock, flags);
|
spin_lock_irqsave(&fnic->vlans_lock, flags);
|
||||||
if (list_empty(&fnic->vlans)) {
|
if (list_empty(&fnic->vlans)) {
|
||||||
|
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
||||||
/* no vlans available, try again */
|
/* no vlans available, try again */
|
||||||
|
if (printk_ratelimit())
|
||||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
|
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
|
||||||
"Start VLAN Discovery\n");
|
"Start VLAN Discovery\n");
|
||||||
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
|
||||||
fnic_event_enq(fnic, FNIC_EVT_START_VLAN_DISC);
|
fnic_event_enq(fnic, FNIC_EVT_START_VLAN_DISC);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1332,10 +1336,11 @@ void fnic_handle_fip_timer(struct fnic *fnic)
|
|||||||
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
||||||
break;
|
break;
|
||||||
case FIP_VLAN_FAILED:
|
case FIP_VLAN_FAILED:
|
||||||
|
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())
|
||||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
|
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
|
||||||
"Start VLAN Discovery\n");
|
"Start VLAN Discovery\n");
|
||||||
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
|
||||||
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
Block a user