diff mbox series

mpt3sas: Remove scsi_dma_map errors messages

Message ID 20220303140203.12642-1-sreekanth.reddy@broadcom.com
State New
Headers show
Series mpt3sas: Remove scsi_dma_map errors messages | expand

Commit Message

Sreekanth Reddy March 3, 2022, 2:02 p.m. UTC
When scsi_dma_map() fails by returning a sges_left value less than
zero, the amount of logging can be extremely high.  In a recent
end-user environment, 1200 messages per second were being sent to
the log buffer.  This eventually overwhelmed the system and it
stalled. Also these error messages are not needed and hence
removing them.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

Comments

Martin K. Petersen March 9, 2022, 3:35 a.m. UTC | #1
Sreekanth,

> When scsi_dma_map() fails by returning a sges_left value less than
> zero, the amount of logging can be extremely high.  In a recent
> end-user environment, 1200 messages per second were being sent to the
> log buffer.  This eventually overwhelmed the system and it
> stalled. Also these error messages are not needed and hence removing
> them.

Applied to 5.18/scsi-staging, thanks!
Martin K. Petersen March 15, 2022, 5:02 a.m. UTC | #2
On Thu, 3 Mar 2022 19:32:03 +0530, Sreekanth Reddy wrote:

> When scsi_dma_map() fails by returning a sges_left value less than
> zero, the amount of logging can be extremely high.  In a recent
> end-user environment, 1200 messages per second were being sent to
> the log buffer.  This eventually overwhelmed the system and it
> stalled. Also these error messages are not needed and hence
> removing them.
> 
> [...]

Applied to 5.18/scsi-queue, thanks!

[1/1] mpt3sas: Remove scsi_dma_map errors messages
      https://git.kernel.org/mkp/scsi/c/0c25422d34b4
Donald Buczek Jan. 19, 2023, 5:36 p.m. UTC | #3
Hi, 

please excuse a probably naive question:

Why can't this result in errors being silently ignored? Most callers of `_base_build_sg` via `ioc->build_sg()` seem to ignore the return value.

I assume, this is not a problem, but a short confirmation would be very much appreciated.

Thanks

  Donald


On 3/3/22 3:02 PM, Sreekanth Reddy wrote:
> When scsi_dma_map() fails by returning a sges_left value less than
> zero, the amount of logging can be extremely high.  In a recent
> end-user environment, 1200 messages per second were being sent to
> the log buffer.  This eventually overwhelmed the system and it
> stalled. Also these error messages are not needed and hence
> removing them.
> 
> Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
> ---
>  drivers/scsi/mpt3sas/mpt3sas_base.c | 18 +++---------------
>  1 file changed, 3 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
> index 511726f92d9a..ebb61b47dc2f 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
> @@ -2593,12 +2593,8 @@ _base_check_pcie_native_sgl(struct MPT3SAS_ADAPTER *ioc,
>  
>  	/* Get the SG list pointer and info. */
>  	sges_left = scsi_dma_map(scmd);
> -	if (sges_left < 0) {
> -		sdev_printk(KERN_ERR, scmd->device,
> -			"scsi_dma_map failed: request for %d bytes!\n",
> -			scsi_bufflen(scmd));
> +	if (sges_left < 0)
>  		return 1;
> -	}
>  
>  	/* Check if we need to build a native SG list. */
>  	if (!base_is_prp_possible(ioc, pcie_device,
> @@ -2705,12 +2701,8 @@ _base_build_sg_scmd(struct MPT3SAS_ADAPTER *ioc,
>  
>  	sg_scmd = scsi_sglist(scmd);
>  	sges_left = scsi_dma_map(scmd);
> -	if (sges_left < 0) {
> -		sdev_printk(KERN_ERR, scmd->device,
> -		 "scsi_dma_map failed: request for %d bytes!\n",
> -		 scsi_bufflen(scmd));
> +	if (sges_left < 0)
>  		return -ENOMEM;
> -	}
>  
>  	sg_local = &mpi_request->SGL;
>  	sges_in_segment = ioc->max_sges_in_main_message;
> @@ -2853,12 +2845,8 @@ _base_build_sg_scmd_ieee(struct MPT3SAS_ADAPTER *ioc,
>  
>  	sg_scmd = scsi_sglist(scmd);
>  	sges_left = scsi_dma_map(scmd);
> -	if (sges_left < 0) {
> -		sdev_printk(KERN_ERR, scmd->device,
> -			"scsi_dma_map failed: request for %d bytes!\n",
> -			scsi_bufflen(scmd));
> +	if (sges_left < 0)
>  		return -ENOMEM;
> -	}
>  
>  	sg_local = &mpi_request->SGL;
>  	sges_in_segment = (ioc->request_sz -
>
diff mbox series

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 511726f92d9a..ebb61b47dc2f 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -2593,12 +2593,8 @@  _base_check_pcie_native_sgl(struct MPT3SAS_ADAPTER *ioc,
 
 	/* Get the SG list pointer and info. */
 	sges_left = scsi_dma_map(scmd);
-	if (sges_left < 0) {
-		sdev_printk(KERN_ERR, scmd->device,
-			"scsi_dma_map failed: request for %d bytes!\n",
-			scsi_bufflen(scmd));
+	if (sges_left < 0)
 		return 1;
-	}
 
 	/* Check if we need to build a native SG list. */
 	if (!base_is_prp_possible(ioc, pcie_device,
@@ -2705,12 +2701,8 @@  _base_build_sg_scmd(struct MPT3SAS_ADAPTER *ioc,
 
 	sg_scmd = scsi_sglist(scmd);
 	sges_left = scsi_dma_map(scmd);
-	if (sges_left < 0) {
-		sdev_printk(KERN_ERR, scmd->device,
-		 "scsi_dma_map failed: request for %d bytes!\n",
-		 scsi_bufflen(scmd));
+	if (sges_left < 0)
 		return -ENOMEM;
-	}
 
 	sg_local = &mpi_request->SGL;
 	sges_in_segment = ioc->max_sges_in_main_message;
@@ -2853,12 +2845,8 @@  _base_build_sg_scmd_ieee(struct MPT3SAS_ADAPTER *ioc,
 
 	sg_scmd = scsi_sglist(scmd);
 	sges_left = scsi_dma_map(scmd);
-	if (sges_left < 0) {
-		sdev_printk(KERN_ERR, scmd->device,
-			"scsi_dma_map failed: request for %d bytes!\n",
-			scsi_bufflen(scmd));
+	if (sges_left < 0)
 		return -ENOMEM;
-	}
 
 	sg_local = &mpi_request->SGL;
 	sges_in_segment = (ioc->request_sz -