diff options
author | Hannes Reinecke <hare@suse.de> | 2017-04-27 10:25:03 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-05-08 21:24:28 -0400 |
commit | c1061255031dea76ee9e082d081b88ac6d6c8265 (patch) | |
tree | 188ba40ab912146d50ee801bb645a23b410d3601 | |
parent | 2d3e4866dea96b0506395b47bfefb234f2088dac (diff) |
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>
-rw-r--r-- | drivers/scsi/libfc/fc_fcp.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index a808e8ef1d08..234352da5c3c 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
@@ -407,11 +407,12 @@ unlock: | |||
407 | * can_queue. Eventually we will hit the point where we run | 407 | * can_queue. Eventually we will hit the point where we run |
408 | * on all reserved structs. | 408 | * on all reserved structs. |
409 | */ | 409 | */ |
410 | static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport) | 410 | static bool fc_fcp_can_queue_ramp_down(struct fc_lport *lport) |
411 | { | 411 | { |
412 | struct fc_fcp_internal *si = fc_get_scsi_internal(lport); | 412 | struct fc_fcp_internal *si = fc_get_scsi_internal(lport); |
413 | unsigned long flags; | 413 | unsigned long flags; |
414 | int can_queue; | 414 | int can_queue; |
415 | bool changed = false; | ||
415 | 416 | ||
416 | spin_lock_irqsave(lport->host->host_lock, flags); | 417 | spin_lock_irqsave(lport->host->host_lock, flags); |
417 | 418 | ||
@@ -427,9 +428,11 @@ static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport) | |||
427 | if (!can_queue) | 428 | if (!can_queue) |
428 | can_queue = 1; | 429 | can_queue = 1; |
429 | lport->host->can_queue = can_queue; | 430 | lport->host->can_queue = can_queue; |
431 | changed = true; | ||
430 | 432 | ||
431 | unlock: | 433 | unlock: |
432 | spin_unlock_irqrestore(lport->host->host_lock, flags); | 434 | spin_unlock_irqrestore(lport->host->host_lock, flags); |
435 | return changed; | ||
433 | } | 436 | } |
434 | 437 | ||
435 | /* | 438 | /* |
@@ -1896,11 +1899,11 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd) | |||
1896 | 1899 | ||
1897 | if (!fc_fcp_lport_queue_ready(lport)) { | 1900 | if (!fc_fcp_lport_queue_ready(lport)) { |
1898 | if (lport->qfull) { | 1901 | if (lport->qfull) { |
1899 | fc_fcp_can_queue_ramp_down(lport); | 1902 | if (fc_fcp_can_queue_ramp_down(lport)) |
1900 | shost_printk(KERN_ERR, lport->host, | 1903 | shost_printk(KERN_ERR, lport->host, |
1901 | "libfc: queue full, " | 1904 | "libfc: queue full, " |
1902 | "reducing can_queue to %d.\n", | 1905 | "reducing can_queue to %d.\n", |
1903 | lport->host->can_queue); | 1906 | lport->host->can_queue); |
1904 | } | 1907 | } |
1905 | rc = SCSI_MLQUEUE_HOST_BUSY; | 1908 | rc = SCSI_MLQUEUE_HOST_BUSY; |
1906 | goto out; | 1909 | goto out; |