summaryrefslogtreecommitdiff
path: root/drivers/scsi/megaraid/megaraid_sas_fusion.c
diff options
context:
space:
mode:
authorSasikumar Chandrasekaran <sasikumar.pc@broadcom.com>2017-01-11 02:20:50 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2017-01-11 07:15:46 +0300
commit3e5eadb1a881bea2e3fa41f5ae7cdbfa36222d37 (patch)
treebf5737d62c16736446e2a3df31d19e132f2f265f /drivers/scsi/megaraid/megaraid_sas_fusion.c
parent9581ebebbe351d99579e8701e238c2771ccdae93 (diff)
downloadlinux-3e5eadb1a881bea2e3fa41f5ae7cdbfa36222d37.tar.xz
scsi: megaraid_sas: Enable or Disable Fast path based on the PCI Threshold Bandwidth
Large SEQ IO workload should sent as non fast path commands Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas_fusion.c')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index ac424ba59ceb..4d655e456709 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -95,6 +95,7 @@ extern unsigned int resetwaittime;
extern unsigned int dual_qdepth_disable;
static void megasas_free_rdpq_fusion(struct megasas_instance *instance);
static void megasas_free_reply_fusion(struct megasas_instance *instance);
+void megasas_change_r1_fp_status(unsigned long instance_addr);
@@ -2628,8 +2629,9 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance,
* to get new command
*/
if (cmd->is_raid_1_fp_write &&
- atomic_inc_return(&instance->fw_outstanding) >
- (instance->host->can_queue)) {
+ (atomic_inc_return(&instance->fw_outstanding) >
+ (instance->host->can_queue) ||
+ (!atomic_read(&instance->r1_write_fp_capable)))) {
megasas_fpio_to_ldio(instance, cmd, cmd->scmd);
atomic_dec(&instance->fw_outstanding);
} else if (cmd->is_raid_1_fp_write) {
@@ -2638,17 +2640,19 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance,
megasas_prepare_secondRaid1_IO(instance, cmd, r1_cmd);
}
-
/*
* Issue the command to the FW
*/
+ if (scmd->sc_data_direction == PCI_DMA_TODEVICE && instance->is_ventura)
+ atomic64_add(scsi_bufflen(scmd), &instance->bytes_wrote);
megasas_fire_cmd_fusion(instance, req_desc, instance->is_ventura);
- if (r1_cmd)
+ if (r1_cmd) {
+ atomic64_add(scsi_bufflen(scmd), &instance->bytes_wrote);
megasas_fire_cmd_fusion(instance, r1_cmd->request_desc,
- instance->is_ventura);
-
+ instance->is_ventura);
+ }
return 0;
}