Skip to contentSkip to conversation

qla2xxx -- FCP_RSP IU check during command completion.

PATCH In review Andrew Vasquez 1 participant 2 messages Feb 10, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qla2xxx -- FCP_RSP IU check during command completion.

James,

While processing command completions in qla2x00_status_entry() interrogate the FCP_RSP IU in case of any FCP protocol errors (FCP-3, 9.4.11) during command execution. If there were any failures, schedule a retry of the command via DID_BUS_BUSY.

Please apply.

Regards,
Andrew Vasquez

drivers/scsi/qla2xxx/qla_isr.c +18 -0
@@ -828,6 +828,7 @@
 	uint8_t		lscsi_status;
 	uint32_t	resid;
 	uint8_t		sense_sz = 0;
+	uint16_t	rsp_info_len;
 
 	/* Fast path completion. */
 	if (le16_to_cpu(pkt->comp_status) == CS_COMPLETE &&
@@ -919,6 +920,23 @@
 		}
 	}
 
+	/* Check for any FCP transport errors. */
+	if (scsi_status & SS_RESPONSE_INFO_LEN_VALID) {
+		rsp_info_len = le16_to_cpu(pkt->rsp_info_len);
+		if (rsp_info_len > 3 && pkt->rsp_info[3]) {
+			DEBUG2(printk("scsi(%ld:%d:%d:%d) FCP I/O protocol "
+			    "failure (%x/%02x%02x%02x%02x%02x%02x%02x%02x)..."
+			    "retrying command\n", ha->host_no, b, t, l,
+			    rsp_info_len, pkt->rsp_info[0], pkt->rsp_info[1],
+			    pkt->rsp_info[2], pkt->rsp_info[3],
+			    pkt->rsp_info[4], pkt->rsp_info[5],
+			    pkt->rsp_info[6], pkt->rsp_info[7]));
+
+			cp->result = DID_BUS_BUSY << 16;
+			return;
+		}
+	}
+
 	/*
 	 * Based on Host and scsi status generate status code for Linux
 	 */
#1 lore raw
Quoted 9 lines · Andrew Vasquez

James,

While processing command completions in qla2x00_status_entry() interrogate the FCP_RSP IU in case of any FCP protocol errors (FCP-3, 9.4.11) during command execution. If there were any failures, schedule a retry of the command via DID_BUS_BUSY.

Please apply.

Damn, this patch is incomplete. Corrected patch attached. Thanks to RA for pointing this out.

Regards,
Andrew Vasquez

drivers/scsi/qla2xxx/qla_isr.c +19 -0
@@ -828,6 +828,7 @@
 	uint8_t		lscsi_status;
 	uint32_t	resid;
 	uint8_t		sense_sz = 0;
+	uint16_t	rsp_info_len;
 
 	/* Fast path completion. */
 	if (le16_to_cpu(pkt->comp_status) == CS_COMPLETE &&
@@ -919,6 +920,24 @@
 		}
 	}
 
+	/* Check for any FCP transport errors. */
+	if (scsi_status & SS_RESPONSE_INFO_LEN_VALID) {
+		rsp_info_len = le16_to_cpu(pkt->rsp_info_len);
+		if (rsp_info_len > 3 && pkt->rsp_info[3]) {
+			DEBUG2(printk("scsi(%ld:%d:%d:%d) FCP I/O protocol "
+			    "failure (%x/%02x%02x%02x%02x%02x%02x%02x%02x)..."
+			    "retrying command\n", ha->host_no, b, t, l,
+			    rsp_info_len, pkt->rsp_info[0], pkt->rsp_info[1],
+			    pkt->rsp_info[2], pkt->rsp_info[3],
+			    pkt->rsp_info[4], pkt->rsp_info[5],
+			    pkt->rsp_info[6], pkt->rsp_info[7]));
+
+			cp->result = DID_BUS_BUSY << 16;
+			add_to_done_queue(ha, sp);
+			return;
+		}
+	}
+
 	/*
 	 * Based on Host and scsi status generate status code for Linux
 	 */