diff options
author | James Smart <james.smart@emulex.com> | 2012-08-03 12:36:42 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-14 09:43:46 -0400 |
commit | 49aa143da98cac07f56096de0d099cb00ccd1582 (patch) | |
tree | def5e5c8db4554a6f6e7064366a21e4013d30ef0 /drivers/scsi/lpfc | |
parent | 4305f183c03fbcf7fd4102de4422862fc76567d2 (diff) |
[SCSI] lpfc 8.3.33: Make I/O to hw queue distribution algorithm a module parameter
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 12 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 6 |
4 files changed, 22 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index d9f21fbc409..26bcbfb2a18 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h | |||
@@ -684,6 +684,7 @@ struct lpfc_hba { | |||
684 | #define LPFC_FCF_FOV 1 /* Fast fcf failover */ | 684 | #define LPFC_FCF_FOV 1 /* Fast fcf failover */ |
685 | #define LPFC_FCF_PRIORITY 2 /* Priority fcf failover */ | 685 | #define LPFC_FCF_PRIORITY 2 /* Priority fcf failover */ |
686 | uint32_t cfg_fcf_failover_policy; | 686 | uint32_t cfg_fcf_failover_policy; |
687 | uint32_t cfg_fcp_io_sched; | ||
687 | uint32_t cfg_cr_delay; | 688 | uint32_t cfg_cr_delay; |
688 | uint32_t cfg_cr_count; | 689 | uint32_t cfg_cr_count; |
689 | uint32_t cfg_multi_ring_support; | 690 | uint32_t cfg_multi_ring_support; |
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index f7c5531d984..2ab2b9f2bff 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -3778,6 +3778,16 @@ static DEVICE_ATTR(lpfc_max_scsicmpl_time, S_IRUGO | S_IWUSR, | |||
3778 | LPFC_ATTR_R(ack0, 0, 0, 1, "Enable ACK0 support"); | 3778 | LPFC_ATTR_R(ack0, 0, 0, 1, "Enable ACK0 support"); |
3779 | 3779 | ||
3780 | /* | 3780 | /* |
3781 | # lpfc_fcp_io_sched: Determine scheduling algrithmn for issuing FCP cmds | ||
3782 | # range is [0,1]. Default value is 0. | ||
3783 | # For [0], FCP commands are issued to Work Queues ina round robin fashion. | ||
3784 | # For [1], FCP commands are issued to a Work Queue associated with the | ||
3785 | # current CPU. | ||
3786 | */ | ||
3787 | LPFC_ATTR_RW(fcp_io_sched, 0, 0, 1, "Determine scheduling algrithmn for " | ||
3788 | "issuing commands [0] - Round Robin, [1] - Current CPU"); | ||
3789 | |||
3790 | /* | ||
3781 | # lpfc_cr_delay & lpfc_cr_count: Default values for I/O colaesing | 3791 | # lpfc_cr_delay & lpfc_cr_count: Default values for I/O colaesing |
3782 | # cr_delay (msec) or cr_count outstanding commands. cr_delay can take | 3792 | # cr_delay (msec) or cr_count outstanding commands. cr_delay can take |
3783 | # value [0,63]. cr_count can take value [1,255]. Default value of cr_delay | 3793 | # value [0,63]. cr_count can take value [1,255]. Default value of cr_delay |
@@ -4001,6 +4011,7 @@ struct device_attribute *lpfc_hba_attrs[] = { | |||
4001 | &dev_attr_lpfc_topology, | 4011 | &dev_attr_lpfc_topology, |
4002 | &dev_attr_lpfc_scan_down, | 4012 | &dev_attr_lpfc_scan_down, |
4003 | &dev_attr_lpfc_link_speed, | 4013 | &dev_attr_lpfc_link_speed, |
4014 | &dev_attr_lpfc_fcp_io_sched, | ||
4004 | &dev_attr_lpfc_cr_delay, | 4015 | &dev_attr_lpfc_cr_delay, |
4005 | &dev_attr_lpfc_cr_count, | 4016 | &dev_attr_lpfc_cr_count, |
4006 | &dev_attr_lpfc_multi_ring_support, | 4017 | &dev_attr_lpfc_multi_ring_support, |
@@ -4990,6 +5001,7 @@ struct fc_function_template lpfc_vport_transport_functions = { | |||
4990 | void | 5001 | void |
4991 | lpfc_get_cfgparam(struct lpfc_hba *phba) | 5002 | lpfc_get_cfgparam(struct lpfc_hba *phba) |
4992 | { | 5003 | { |
5004 | lpfc_fcp_io_sched_init(phba, lpfc_fcp_io_sched); | ||
4993 | lpfc_cr_delay_init(phba, lpfc_cr_delay); | 5005 | lpfc_cr_delay_init(phba, lpfc_cr_delay); |
4994 | lpfc_cr_count_init(phba, lpfc_cr_count); | 5006 | lpfc_cr_count_init(phba, lpfc_cr_count); |
4995 | lpfc_multi_ring_support_init(phba, lpfc_multi_ring_support); | 5007 | lpfc_multi_ring_support_init(phba, lpfc_multi_ring_support); |
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 821262d2cf7..45fbfb623ad 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -187,6 +187,10 @@ struct lpfc_sli_intf { | |||
187 | /* Active interrupt test count */ | 187 | /* Active interrupt test count */ |
188 | #define LPFC_ACT_INTR_CNT 4 | 188 | #define LPFC_ACT_INTR_CNT 4 |
189 | 189 | ||
190 | /* Algrithmns for scheduling FCP commands to WQs */ | ||
191 | #define LPFC_FCP_SCHED_ROUND_ROBIN 0 | ||
192 | #define LPFC_FCP_SCHED_BY_CPU 1 | ||
193 | |||
190 | /* Delay Multiplier constant */ | 194 | /* Delay Multiplier constant */ |
191 | #define LPFC_DMULT_CONST 651042 | 195 | #define LPFC_DMULT_CONST 651042 |
192 | 196 | ||
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 0d5dab3da96..d8dbe403c37 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -7816,7 +7816,11 @@ lpfc_sli4_scmd_to_wqidx_distr(struct lpfc_hba *phba) | |||
7816 | { | 7816 | { |
7817 | int i; | 7817 | int i; |
7818 | 7818 | ||
7819 | i = atomic_add_return(1, &phba->fcp_qidx); | 7819 | if (phba->cfg_fcp_io_sched == LPFC_FCP_SCHED_BY_CPU) |
7820 | i = smp_processor_id(); | ||
7821 | else | ||
7822 | i = atomic_add_return(1, &phba->fcp_qidx); | ||
7823 | |||
7820 | i = (i % phba->cfg_fcp_io_channel); | 7824 | i = (i % phba->cfg_fcp_io_channel); |
7821 | return i; | 7825 | return i; |
7822 | } | 7826 | } |