diff mbox

[v2,15/17] qla2xxx: Accelerate SCSI BUSY status generation in target mode

Message ID 20170530175432.26984-16-himanshu.madhani@cavium.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Madhani, Himanshu May 30, 2017, 5:54 p.m. UTC
From: Quinn Tran <quinn.tran@cavium.com>

Accelerate generation of SCSI busy to let initiators slow
down when target is running low in resources.

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 13 +++++++++++--
 drivers/scsi/qla2xxx/qla_mbx.c  |  2 ++
 2 files changed, 13 insertions(+), 2 deletions(-)

Comments

Bart Van Assche May 31, 2017, 11:39 p.m. UTC | #1
On Tue, 2017-05-30 at 10:54 -0700, Himanshu Madhani wrote:
> +		/* FW perform Exchang validation */

Did you perhaps intend "exchange" instead of "Exchang"? Please fix this if you
repost this patch.

Thanks,

Bart.
Madhani, Himanshu June 1, 2017, 6:32 p.m. UTC | #2
> On May 31, 2017, at 4:39 PM, Bart Van Assche <bart.vanassche@sandisk.com> wrote:
> 
> On Tue, 2017-05-30 at 10:54 -0700, Himanshu Madhani wrote:
>> +		/* FW perform Exchang validation */
> 
> Did you perhaps intend "exchange" instead of "Exchang"? Please fix this if you
> repost this patch.
> 
> Thanks,
> 
> Bart.

Sure. Will fix this up when i repost this series.

Thanks,
- Himanshu
diff mbox

Patch

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 0ee9159457e4..3a51ddab36b8 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -7381,10 +7381,19 @@  qla81xx_update_fw_options(scsi_qla_host_t *vha)
 	}
 
 	if (qla_tgt_mode_enabled(vha) ||
-	    qla_dual_mode_enabled(vha))
+	    qla_dual_mode_enabled(vha)) {
+		/* FW auto send SCSI status during */
+		ha->fw_options[1] |= BIT_8;
+		ha->fw_options[10] |= (u16)SAM_STAT_BUSY << 8;
+
+		/* FW perform Exchang validation */
 		ha->fw_options[2] |= BIT_4;
-	else
+	} else {
+		ha->fw_options[1]  &= ~BIT_8;
+		ha->fw_options[10] &= 0x00ff;
+
 		ha->fw_options[2] &= ~BIT_4;
+	}
 
 	if (ql2xetsenable) {
 		/* Enable ETS Burst. */
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index bebac42d9e9e..f02a2baffb5b 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -1048,6 +1048,8 @@  qla2x00_set_fw_options(scsi_qla_host_t *vha, uint16_t *fwopts)
 	mcp->in_mb = MBX_0;
 	if (IS_FWI2_CAPABLE(vha->hw)) {
 		mcp->in_mb |= MBX_1;
+		mcp->mb[10] = fwopts[10];
+		mcp->out_mb |= MBX_10;
 	} else {
 		mcp->mb[10] = fwopts[10];
 		mcp->mb[11] = fwopts[11];