|
Daniel Wagner |
e0d408 |
From: James Smart <jsmart2021@gmail.com>
|
|
Daniel Wagner |
e0d408 |
Date: Fri, 3 Dec 2021 16:26:37 -0800
|
|
Daniel Wagner |
e0d408 |
Subject: scsi: lpfc: Change return code on I/Os received during link bounce
|
|
Daniel Wagner |
e0d408 |
Patch-mainline: Queued in subsystem maintainer repository
|
|
Daniel Wagner |
e0d408 |
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
|
|
Daniel Wagner |
e0d408 |
Git-commit: 2e81b1a374da5d6024208c16c4a5224a70cafa64
|
|
Daniel Wagner |
e0d408 |
References: bsc1192145
|
|
Daniel Wagner |
e0d408 |
|
|
Daniel Wagner |
e0d408 |
During heavy I/O testing with issue_lip to bounce the link, occasionally
|
|
Daniel Wagner |
e0d408 |
I/O is terminated with status 3 result 9, which means the RPI is suspended.
|
|
Daniel Wagner |
e0d408 |
The I/O is completed and this type of error will result in immediate retry
|
|
Daniel Wagner |
e0d408 |
by the SCSI layer. The retry count expires and the I/O fails and returns
|
|
Daniel Wagner |
e0d408 |
error to the application.
|
|
Daniel Wagner |
e0d408 |
|
|
Daniel Wagner |
e0d408 |
To avoid these quick retry/retries exhausted scenarios change the return
|
|
Daniel Wagner |
e0d408 |
code given to the midlayer to DID_REQUEUE rather than DID_ERROR. This gets
|
|
Daniel Wagner |
e0d408 |
them retried, and eventually succeed when the link recovers.
|
|
Daniel Wagner |
e0d408 |
|
|
Daniel Wagner |
e0d408 |
Link: https://lore.kernel.org/r/20211204002644.116455-3-jsmart2021@gmail.com
|
|
Daniel Wagner |
e0d408 |
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
|
|
Daniel Wagner |
e0d408 |
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
|
|
Daniel Wagner |
e0d408 |
Signed-off-by: James Smart <jsmart2021@gmail.com>
|
|
Daniel Wagner |
e0d408 |
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
|
|
Daniel Wagner |
e0d408 |
Acked-by: Daniel Wagner <dwagner@suse.de>
|
|
Daniel Wagner |
e0d408 |
---
|
|
Daniel Wagner |
e0d408 |
drivers/scsi/lpfc/lpfc_hw.h | 2 +-
|
|
Daniel Wagner |
e0d408 |
drivers/scsi/lpfc/lpfc_scsi.c | 8 +++++---
|
|
Daniel Wagner |
e0d408 |
2 files changed, 6 insertions(+), 4 deletions(-)
|
|
Daniel Wagner |
e0d408 |
|
|
Daniel Wagner |
e0d408 |
--- a/drivers/scsi/lpfc/lpfc_hw.h
|
|
Daniel Wagner |
e0d408 |
+++ b/drivers/scsi/lpfc/lpfc_hw.h
|
|
Daniel Wagner |
e0d408 |
@@ -3630,7 +3630,7 @@ typedef struct {
|
|
Daniel Wagner |
e0d408 |
#define IOERR_ILLEGAL_COMMAND 0x06
|
|
Daniel Wagner |
e0d408 |
#define IOERR_XCHG_DROPPED 0x07
|
|
Daniel Wagner |
e0d408 |
#define IOERR_ILLEGAL_FIELD 0x08
|
|
Daniel Wagner |
e0d408 |
-#define IOERR_BAD_CONTINUE 0x09
|
|
Daniel Wagner |
e0d408 |
+#define IOERR_RPI_SUSPENDED 0x09
|
|
Daniel Wagner |
e0d408 |
#define IOERR_TOO_MANY_BUFFERS 0x0A
|
|
Daniel Wagner |
e0d408 |
#define IOERR_RCV_BUFFER_WAITING 0x0B
|
|
Daniel Wagner |
e0d408 |
#define IOERR_NO_CONNECTION 0x0C
|
|
Daniel Wagner |
e0d408 |
--- a/drivers/scsi/lpfc/lpfc_scsi.c
|
|
Daniel Wagner |
e0d408 |
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
|
|
Daniel Wagner |
e0d408 |
@@ -4402,6 +4402,7 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba
|
|
Daniel Wagner |
e0d408 |
if (lpfc_cmd->result == IOERR_INVALID_RPI ||
|
|
Daniel Wagner |
e0d408 |
lpfc_cmd->result == IOERR_NO_RESOURCES ||
|
|
Daniel Wagner |
e0d408 |
lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
|
|
Daniel Wagner |
e0d408 |
+ lpfc_cmd->result == IOERR_RPI_SUSPENDED ||
|
|
Daniel Wagner |
e0d408 |
lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) {
|
|
Daniel Wagner |
e0d408 |
cmd->result = DID_REQUEUE << 16;
|
|
Daniel Wagner |
e0d408 |
break;
|
|
Daniel Wagner |
e0d408 |
@@ -4457,10 +4458,11 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba
|
|
Daniel Wagner |
e0d408 |
|
|
Daniel Wagner |
e0d408 |
lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
|
|
Daniel Wagner |
e0d408 |
"9039 Iodone <%d/%llu> cmd x%px, error "
|
|
Daniel Wagner |
e0d408 |
- "x%x SNS x%x x%x Data: x%x x%x\n",
|
|
Daniel Wagner |
e0d408 |
+ "x%x SNS x%x x%x LBA x%llx Data: x%x x%x\n",
|
|
Daniel Wagner |
e0d408 |
cmd->device->id, cmd->device->lun, cmd,
|
|
Daniel Wagner |
e0d408 |
- cmd->result, *lp, *(lp + 3), cmd->retries,
|
|
Daniel Wagner |
e0d408 |
- scsi_get_resid(cmd));
|
|
Daniel Wagner |
e0d408 |
+ cmd->result, *lp, *(lp + 3),
|
|
Daniel Wagner |
e0d408 |
+ (u64)scsi_get_lba(cmd),
|
|
Daniel Wagner |
e0d408 |
+ cmd->retries, scsi_get_resid(cmd));
|
|
Daniel Wagner |
e0d408 |
}
|
|
Daniel Wagner |
e0d408 |
|
|
Daniel Wagner |
e0d408 |
lpfc_update_stats(vport, lpfc_cmd);
|