Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: lpfc: Change return code on I/Os received during link bounce

During heavy I/O testing with issue_lip to bounce the link, occasionally
I/O is terminated with status 3 result 9, which means the RPI is suspended.
The I/O is completed and this type of error will result in immediate retry
by the SCSI layer. The retry count expires and the I/O fails and returns
error to the application.

To avoid these quick retry/retries exhausted scenarios change the return
code given to the midlayer to DID_REQUEUE rather than DID_ERROR. This gets
them retried, and eventually succeed when the link recovers.

Link: https://lore.kernel.org/r/20211204002644.116455-3-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

James Smart and committed by
Martin K. Petersen
2e81b1a3 f0d39196

+6 -4
+1 -1
drivers/scsi/lpfc/lpfc_hw.h
··· 3746 3746 #define IOERR_ILLEGAL_COMMAND 0x06 3747 3747 #define IOERR_XCHG_DROPPED 0x07 3748 3748 #define IOERR_ILLEGAL_FIELD 0x08 3749 - #define IOERR_BAD_CONTINUE 0x09 3749 + #define IOERR_RPI_SUSPENDED 0x09 3750 3750 #define IOERR_TOO_MANY_BUFFERS 0x0A 3751 3751 #define IOERR_RCV_BUFFER_WAITING 0x0B 3752 3752 #define IOERR_NO_CONNECTION 0x0C
+5 -3
drivers/scsi/lpfc/lpfc_scsi.c
··· 4393 4393 if (lpfc_cmd->result == IOERR_INVALID_RPI || 4394 4394 lpfc_cmd->result == IOERR_NO_RESOURCES || 4395 4395 lpfc_cmd->result == IOERR_ABORT_REQUESTED || 4396 + lpfc_cmd->result == IOERR_RPI_SUSPENDED || 4396 4397 lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) { 4397 4398 cmd->result = DID_REQUEUE << 16; 4398 4399 break; ··· 4449 4448 4450 4449 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, 4451 4450 "9039 Iodone <%d/%llu> cmd x%px, error " 4452 - "x%x SNS x%x x%x Data: x%x x%x\n", 4451 + "x%x SNS x%x x%x LBA x%llx Data: x%x x%x\n", 4453 4452 cmd->device->id, cmd->device->lun, cmd, 4454 - cmd->result, *lp, *(lp + 3), cmd->retries, 4455 - scsi_get_resid(cmd)); 4453 + cmd->result, *lp, *(lp + 3), 4454 + (u64)scsi_get_lba(cmd), 4455 + cmd->retries, scsi_get_resid(cmd)); 4456 4456 } 4457 4457 4458 4458 lpfc_update_stats(vport, lpfc_cmd);