diff mbox series

lpfc: Return DID_TRANSPORT_DISRUPTED instead of DID_REQUEUE

Message ID 20220824060033.138661-1-hare@suse.de (mailing list archive)
State Accepted
Headers show
Series lpfc: Return DID_TRANSPORT_DISRUPTED instead of DID_REQUEUE | expand

Commit Message

Hannes Reinecke Aug. 24, 2022, 6 a.m. UTC
When the driver hits on an internal error condition returning
DID_REQUEUE will cause I/O to be retried on the same ITL nexus.
This will inhibit multipathing, resulting in endless retries
even if the error could have been resolved by using a different
ITL nexus.
So return DID_TRANSPORT_DISRUPTED to allow for multipath to engage
and route I/O to another ITL nexus.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/lpfc/lpfc_scsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

James Smart Aug. 24, 2022, 2:17 p.m. UTC | #1
On 8/23/2022 11:00 PM, Hannes Reinecke wrote:
> When the driver hits on an internal error condition returning
> DID_REQUEUE will cause I/O to be retried on the same ITL nexus.
> This will inhibit multipathing, resulting in endless retries
> even if the error could have been resolved by using a different
> ITL nexus.
> So return DID_TRANSPORT_DISRUPTED to allow for multipath to engage
> and route I/O to another ITL nexus.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>   drivers/scsi/lpfc/lpfc_scsi.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
> index 084c0f9fdc3a..938a5e435943 100644
> --- a/drivers/scsi/lpfc/lpfc_scsi.c
> +++ b/drivers/scsi/lpfc/lpfc_scsi.c
> @@ -4272,7 +4272,7 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
>   		    lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
>   		    lpfc_cmd->result == IOERR_RPI_SUSPENDED ||
>   		    lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) {
> -			cmd->result = DID_REQUEUE << 16;
> +			cmd->result = DID_TRANSPORT_DISRUPTED << 16;
>   			break;
>   		}
>   		if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED ||
> @@ -4562,7 +4562,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
>   			    lpfc_cmd->result == IOERR_NO_RESOURCES ||
>   			    lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
>   			    lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) {
> -				cmd->result = DID_REQUEUE << 16;
> +				cmd->result = DID_TRANSPORT_DISRUPTED << 16;
>   				break;
>   			}
>   			if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED ||


We need to be careful about the conditions. But I think you handled it well.

Thanks

Reviewed-by: James Smart <jsmart2021@gmail.com>

-- james
Martin K. Petersen Sept. 1, 2022, 5:12 a.m. UTC | #2
On Wed, 24 Aug 2022 08:00:33 +0200, Hannes Reinecke wrote:

> When the driver hits on an internal error condition returning
> DID_REQUEUE will cause I/O to be retried on the same ITL nexus.
> This will inhibit multipathing, resulting in endless retries
> even if the error could have been resolved by using a different
> ITL nexus.
> So return DID_TRANSPORT_DISRUPTED to allow for multipath to engage
> and route I/O to another ITL nexus.
> 
> [...]

Applied to 6.0/scsi-fixes, thanks!

[1/1] lpfc: Return DID_TRANSPORT_DISRUPTED instead of DID_REQUEUE
      https://git.kernel.org/mkp/scsi/c/c0a50cd389c3
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 084c0f9fdc3a..938a5e435943 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -4272,7 +4272,7 @@  lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
 		    lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
 		    lpfc_cmd->result == IOERR_RPI_SUSPENDED ||
 		    lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) {
-			cmd->result = DID_REQUEUE << 16;
+			cmd->result = DID_TRANSPORT_DISRUPTED << 16;
 			break;
 		}
 		if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED ||
@@ -4562,7 +4562,7 @@  lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
 			    lpfc_cmd->result == IOERR_NO_RESOURCES ||
 			    lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
 			    lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) {
-				cmd->result = DID_REQUEUE << 16;
+				cmd->result = DID_TRANSPORT_DISRUPTED << 16;
 				break;
 			}
 			if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED ||