]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Revert "scsi: megaraid_sas: Enable or Disable Fast path based on the PCI Threshold...
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Fri, 10 Feb 2017 08:59:01 +0000 (00:59 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 13 Feb 2017 12:26:21 +0000 (07:26 -0500)
This reverts commit "3e5eadb1a881" ("scsi: megaraid_sas: Enable or
Disable Fast path based on the PCI Threshold Bandwidth")

This patch was aimed to increase performance of R1 Write operation for
large IO size.  Since this method used timer approach, it turn on/off
fast path did not work as expected.  Patch 0013 describes new algorithm
and performance number.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/megaraid/megaraid_sas_fp.c
drivers/scsi/megaraid/megaraid_sas_fusion.c
drivers/scsi/megaraid/megaraid_sas_fusion.h

index ba9fbb71eb3541042d7f672fbff83163e45a8b00..f5c47424f4f2fbd6644e6cda66d045f422584cde 100644 (file)
@@ -1477,8 +1477,6 @@ enum FW_BOOT_CONTEXT {
 #define MFI_1068_FW_HANDSHAKE_OFFSET           0x64
 #define MFI_1068_FW_READY                      0xDDDD0000
 
-#define MEGASAS_RAID1_FAST_PATH_STATUS_CHECK_INTERVAL HZ
-
 #define MR_MAX_REPLY_QUEUES_OFFSET              0X0000001F
 #define MR_MAX_REPLY_QUEUES_EXT_OFFSET          0X003FC000
 #define MR_MAX_REPLY_QUEUES_EXT_OFFSET_SHIFT    14
@@ -2154,10 +2152,6 @@ struct megasas_instance {
        atomic_t ldio_outstanding;
        atomic_t fw_reset_no_pci_access;
 
-       atomic64_t bytes_wrote; /* used for raid1 fast path enable or disable */
-       atomic_t r1_write_fp_capable;
-
-
        struct megasas_instance_template *instancet;
        struct tasklet_struct isr_tasklet;
        struct work_struct work_init;
@@ -2199,7 +2193,6 @@ struct megasas_instance {
        long reset_flags;
        struct mutex reset_mutex;
        struct timer_list sriov_heartbeat_timer;
-       struct timer_list r1_fp_hold_timer;
        char skip_heartbeat_timer_del;
        u8 requestorId;
        char PlasmaFW111;
@@ -2216,7 +2209,6 @@ struct megasas_instance {
        bool is_ventura;
        bool msix_combined;
        u16 max_raid_mapsize;
-       u64 pci_threshold_bandwidth; /* used to control the fp writes */
 };
 struct MR_LD_VF_MAP {
        u32 size;
index 70891a76ca8614c376ac3fb9f68ba9977c2d0bca..3ed876a8e8fbee9b8b7a9c5b019f9cf2587ff1d4 100644 (file)
@@ -1940,9 +1940,6 @@ void megaraid_sas_kill_hba(struct megasas_instance *instance)
        }
        /* Complete outstanding ioctls when adapter is killed */
        megasas_complete_outstanding_ioctls(instance);
-       if (instance->is_ventura)
-               del_timer_sync(&instance->r1_fp_hold_timer);
-
 }
 
  /**
@@ -2441,24 +2438,6 @@ void megasas_sriov_heartbeat_handler(unsigned long instance_addr)
        }
 }
 
-/*Handler for disabling/enabling raid 1 fast paths*/
-void megasas_change_r1_fp_status(unsigned long instance_addr)
-{
-       struct megasas_instance *instance =
-                       (struct megasas_instance *)instance_addr;
-       if (atomic64_read(&instance->bytes_wrote) >=
-                                       instance->pci_threshold_bandwidth) {
-
-               atomic64_set(&instance->bytes_wrote, 0);
-               atomic_set(&instance->r1_write_fp_capable, 0);
-       } else {
-               atomic64_set(&instance->bytes_wrote, 0);
-               atomic_set(&instance->r1_write_fp_capable, 1);
-       }
-       mod_timer(&instance->r1_fp_hold_timer,
-        jiffies + MEGASAS_RAID1_FAST_PATH_STATUS_CHECK_INTERVAL);
-}
-
 /**
  * megasas_wait_for_outstanding -      Wait for all outstanding cmds
  * @instance:                          Adapter soft state
@@ -5386,17 +5365,6 @@ static int megasas_init_fw(struct megasas_instance *instance)
                        instance->skip_heartbeat_timer_del = 1;
        }
 
-       if (instance->is_ventura) {
-               atomic64_set(&instance->bytes_wrote, 0);
-               atomic_set(&instance->r1_write_fp_capable, 1);
-               megasas_start_timer(instance,
-                           &instance->r1_fp_hold_timer,
-                           megasas_change_r1_fp_status,
-                           MEGASAS_RAID1_FAST_PATH_STATUS_CHECK_INTERVAL);
-                               dev_info(&instance->pdev->dev, "starting the raid 1 fp timer with interval %d\n",
-                               MEGASAS_RAID1_FAST_PATH_STATUS_CHECK_INTERVAL);
-       }
-
        return 0;
 
 fail_get_ld_pd_list:
@@ -6187,9 +6155,6 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t state)
        if (instance->requestorId && !instance->skip_heartbeat_timer_del)
                del_timer_sync(&instance->sriov_heartbeat_timer);
 
-       if (instance->is_ventura)
-               del_timer_sync(&instance->r1_fp_hold_timer);
-
        megasas_flush_cache(instance);
        megasas_shutdown_controller(instance, MR_DCMD_HIBERNATE_SHUTDOWN);
 
@@ -6316,16 +6281,6 @@ megasas_resume(struct pci_dev *pdev)
        megasas_setup_jbod_map(instance);
        instance->unload = 0;
 
-       if (instance->is_ventura) {
-               atomic64_set(&instance->bytes_wrote, 0);
-               atomic_set(&instance->r1_write_fp_capable, 1);
-               megasas_start_timer(instance,
-                           &instance->r1_fp_hold_timer,
-                           megasas_change_r1_fp_status,
-                           MEGASAS_RAID1_FAST_PATH_STATUS_CHECK_INTERVAL);
-       }
-
-
        /*
         * Initiate AEN (Asynchronous Event Notification)
         */
@@ -6414,9 +6369,6 @@ static void megasas_detach_one(struct pci_dev *pdev)
        if (instance->requestorId && !instance->skip_heartbeat_timer_del)
                del_timer_sync(&instance->sriov_heartbeat_timer);
 
-       if (instance->is_ventura)
-               del_timer_sync(&instance->r1_fp_hold_timer);
-
        if (instance->fw_crash_state != UNAVAILABLE)
                megasas_free_host_crash_buffer(instance);
        scsi_remove_host(instance->host);
index 322a72b593e36a8cac8781dfa38871db21454c05..f1384b01b3d37708765183c911a5ac38d74c6249 100644 (file)
@@ -197,9 +197,6 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
 
        if (instance->max_raid_mapsize) {
                fw_map_dyn = fusion->ld_map[(instance->map_id & 1)];
-               if (fw_map_dyn->pci_threshold_bandwidth)
-                       instance->pci_threshold_bandwidth =
-                       le64_to_cpu(fw_map_dyn->pci_threshold_bandwidth);
 #if VD_EXT_DEBUG
                dev_dbg(&instance->pdev->dev, "raidMapSize 0x%x fw_map_dyn->descTableOffset 0x%x\n",
                        le32_to_cpu(fw_map_dyn->raid_map_size),
@@ -207,8 +204,6 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
                dev_dbg(&instance->pdev->dev, "descTableSize 0x%x descTableNumElements 0x%x\n",
                        le32_to_cpu(fw_map_dyn->desc_table_size),
                        le32_to_cpu(fw_map_dyn->desc_table_num_elements));
-               dev_dbg(&instance->pdev->dev, "PCIThreasholdBandwidth %llu\n",
-                       instance->pci_threshold_bandwidth);
                dev_dbg(&instance->pdev->dev, "drv map %p ldCount %d\n",
                        drv_map, fw_map_dyn->ld_count);
 #endif
@@ -439,8 +434,6 @@ void MR_PopulateDrvRaidMap(struct megasas_instance *instance)
                        sizeof(struct MR_DEV_HANDLE_INFO) *
                        MAX_RAIDMAP_PHYSICAL_DEVICES);
        }
-       if (instance->is_ventura && !instance->pci_threshold_bandwidth)
-               instance->pci_threshold_bandwidth = ULLONG_MAX;
 }
 
 /*
index 9a9c84fb91b1790a202bdfe3a0b25e111370cb63..54728b3deabf0e131cdc1e1045a5cc3ed0a5f34f 100644 (file)
@@ -95,7 +95,6 @@ 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);
 
 
 
@@ -2634,9 +2633,8 @@ 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_read(&instance->r1_write_fp_capable)))) {
+               atomic_inc_return(&instance->fw_outstanding) >
+                       (instance->host->can_queue)) {
                megasas_fpio_to_ldio(instance, cmd, cmd->scmd);
                atomic_dec(&instance->fw_outstanding);
        } else if (cmd->is_raid_1_fp_write) {
@@ -2645,19 +2643,17 @@ 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) {
-               atomic64_add(scsi_bufflen(scmd), &instance->bytes_wrote);
+       if (r1_cmd)
                megasas_fire_cmd_fusion(instance, r1_cmd->request_desc,
-                       instance->is_ventura);
-       }
+                               instance->is_ventura);
+
 
        return 0;
 }
index 3addd0cb2e9979453d2a23628813e1852e1ebdb7..82a4ff720eabe20c5341173bb8453d6b112ae9a0 100644 (file)
@@ -977,7 +977,7 @@ struct MR_FW_RAID_MAP_DYNAMIC {
        u32 desc_table_size;  /* Total Size of desc table */
        /* Total Number of elements in the desc table */
        u32 desc_table_num_elements;
-       u64     pci_threshold_bandwidth;
+       u64     reserved1;
        u32     reserved2[3];   /*future use */
        /* timeout value used by driver in FP IOs */
        u8 fp_pd_io_timeout_sec;