Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/mps/mps_sas.c
Show First 20 Lines • Show All 2,402 Lines • ▼ Show 20 Lines | mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm) | ||||
case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: | case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: | ||||
/* resid is ignored for this condition */ | /* resid is ignored for this condition */ | ||||
csio->resid = 0; | csio->resid = 0; | ||||
mpssas_set_ccbstatus(ccb, CAM_DATA_RUN_ERR); | mpssas_set_ccbstatus(ccb, CAM_DATA_RUN_ERR); | ||||
break; | break; | ||||
case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: | case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: | ||||
case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: | case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: | ||||
/* | /* | ||||
* Since these are generally external (i.e. hopefully | * These can sometimes be transient transport-related | ||||
* transient transport-related) errors, retry these without | * errors, and sometimes persistent drive-related errors. | ||||
* decrementing the retry count. | * We used to retry these without decrementing the retry | ||||
* count by returning CAM_REQUEUE_REQ. Unfortunately, if | |||||
* we hit a persistent drive problem that returns one of | |||||
* these error codes, we would retry indefinitely. So, | |||||
* return CAM_REQ_CMP_ERROR so that we decrement the retry | |||||
* count and avoid infinite retries. We're taking the | |||||
* potential risk of flagging false failures in the event | |||||
* of a topology-related error (e.g. a SAS expander problem | |||||
* causes a command addressed to a drive to fail), but | |||||
* avoiding getting into an infinite retry loop. | |||||
*/ | */ | ||||
mpssas_set_ccbstatus(ccb, CAM_REQUEUE_REQ); | mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); | ||||
mpssas_log_command(cm, MPS_INFO, | mpssas_log_command(cm, MPS_INFO, | ||||
"terminated ioc %x scsi %x state %x xfer %u\n", | "terminated ioc %x scsi %x state %x xfer %u\n", | ||||
le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState, | le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState, | ||||
le32toh(rep->TransferCount)); | le32toh(rep->TransferCount)); | ||||
break; | break; | ||||
case MPI2_IOCSTATUS_INVALID_FUNCTION: | case MPI2_IOCSTATUS_INVALID_FUNCTION: | ||||
case MPI2_IOCSTATUS_INTERNAL_ERROR: | case MPI2_IOCSTATUS_INTERNAL_ERROR: | ||||
case MPI2_IOCSTATUS_INVALID_VPID: | case MPI2_IOCSTATUS_INVALID_VPID: | ||||
▲ Show 20 Lines • Show All 1,266 Lines • Show Last 20 Lines |