scsi: libfc: do not flood console with messages 'libfc: queue full ...'
When the FCoE sending side becomes congested libfc tries to reduce the queue depth on the host; however due to the built-in lag before attempting to ramp down the queue depth _again_ the message log is flooded with the following message: libfc: queue full, reducing can_queue to 512 With this patch the message is printed only once (ie when it's actually changed). Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
2d3e4866de
commit
c106125503
|
@ -407,11 +407,12 @@ static void fc_fcp_can_queue_ramp_up(struct fc_lport *lport)
|
||||||
* can_queue. Eventually we will hit the point where we run
|
* can_queue. Eventually we will hit the point where we run
|
||||||
* on all reserved structs.
|
* on all reserved structs.
|
||||||
*/
|
*/
|
||||||
static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
|
static bool fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
|
||||||
{
|
{
|
||||||
struct fc_fcp_internal *si = fc_get_scsi_internal(lport);
|
struct fc_fcp_internal *si = fc_get_scsi_internal(lport);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int can_queue;
|
int can_queue;
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
spin_lock_irqsave(lport->host->host_lock, flags);
|
spin_lock_irqsave(lport->host->host_lock, flags);
|
||||||
|
|
||||||
|
@ -427,9 +428,11 @@ static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
|
||||||
if (!can_queue)
|
if (!can_queue)
|
||||||
can_queue = 1;
|
can_queue = 1;
|
||||||
lport->host->can_queue = can_queue;
|
lport->host->can_queue = can_queue;
|
||||||
|
changed = true;
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
spin_unlock_irqrestore(lport->host->host_lock, flags);
|
spin_unlock_irqrestore(lport->host->host_lock, flags);
|
||||||
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1896,11 +1899,11 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
|
||||||
|
|
||||||
if (!fc_fcp_lport_queue_ready(lport)) {
|
if (!fc_fcp_lport_queue_ready(lport)) {
|
||||||
if (lport->qfull) {
|
if (lport->qfull) {
|
||||||
fc_fcp_can_queue_ramp_down(lport);
|
if (fc_fcp_can_queue_ramp_down(lport))
|
||||||
shost_printk(KERN_ERR, lport->host,
|
shost_printk(KERN_ERR, lport->host,
|
||||||
"libfc: queue full, "
|
"libfc: queue full, "
|
||||||
"reducing can_queue to %d.\n",
|
"reducing can_queue to %d.\n",
|
||||||
lport->host->can_queue);
|
lport->host->can_queue);
|
||||||
}
|
}
|
||||||
rc = SCSI_MLQUEUE_HOST_BUSY;
|
rc = SCSI_MLQUEUE_HOST_BUSY;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Reference in New Issue