diff options
author | Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com> | 2007-02-15 11:08:33 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-02-16 16:57:34 -0500 |
commit | 4fd3006032446be2b331dd482e34c6a9e644a5b8 (patch) | |
tree | f3266f1362a6a5a12e332eae4a23daf246822bd9 /drivers/infiniband | |
parent | 8b16cef3df871b005f3a97e273b5b135ebfb3769 (diff) |
IB/ehca: Allow en/disabling scaling code via module parameter
Allow users to en/disable scaling code when loading ib_ehca module,
rather than requiring the module to be rebuilt to change the setting.
Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ehca/Kconfig | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_classes.h | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_irq.c | 47 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_main.c | 4 |
4 files changed, 26 insertions, 34 deletions
diff --git a/drivers/infiniband/hw/ehca/Kconfig b/drivers/infiniband/hw/ehca/Kconfig index 727b10d8968..1a854598e0e 100644 --- a/drivers/infiniband/hw/ehca/Kconfig +++ b/drivers/infiniband/hw/ehca/Kconfig | |||
@@ -7,11 +7,3 @@ config INFINIBAND_EHCA | |||
7 | To compile the driver as a module, choose M here. The module | 7 | To compile the driver as a module, choose M here. The module |
8 | will be called ib_ehca. | 8 | will be called ib_ehca. |
9 | 9 | ||
10 | config INFINIBAND_EHCA_SCALING | ||
11 | bool "Scaling support (EXPERIMENTAL)" | ||
12 | depends on IBMEBUS && INFINIBAND_EHCA && HOTPLUG_CPU && EXPERIMENTAL | ||
13 | default y | ||
14 | ---help--- | ||
15 | eHCA scaling support schedules the CQ callbacks to different CPUs. | ||
16 | |||
17 | To enable this feature choose Y here. | ||
diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h index f08ad6f9c13..40404c9e281 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/infiniband/hw/ehca/ehca_classes.h | |||
@@ -277,6 +277,7 @@ extern struct idr ehca_cq_idr; | |||
277 | extern int ehca_static_rate; | 277 | extern int ehca_static_rate; |
278 | extern int ehca_port_act_time; | 278 | extern int ehca_port_act_time; |
279 | extern int ehca_use_hp_mr; | 279 | extern int ehca_use_hp_mr; |
280 | extern int ehca_scaling_code; | ||
280 | 281 | ||
281 | struct ipzu_queue_resp { | 282 | struct ipzu_queue_resp { |
282 | u32 qe_size; /* queue entry size */ | 283 | u32 qe_size; /* queue entry size */ |
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c index 9679b072ad0..3ec53c687d0 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/infiniband/hw/ehca/ehca_irq.c | |||
@@ -63,15 +63,11 @@ | |||
63 | #define ERROR_DATA_LENGTH EHCA_BMASK_IBM(52,63) | 63 | #define ERROR_DATA_LENGTH EHCA_BMASK_IBM(52,63) |
64 | #define ERROR_DATA_TYPE EHCA_BMASK_IBM(0,7) | 64 | #define ERROR_DATA_TYPE EHCA_BMASK_IBM(0,7) |
65 | 65 | ||
66 | #ifdef CONFIG_INFINIBAND_EHCA_SCALING | ||
67 | |||
68 | static void queue_comp_task(struct ehca_cq *__cq); | 66 | static void queue_comp_task(struct ehca_cq *__cq); |
69 | 67 | ||
70 | static struct ehca_comp_pool* pool; | 68 | static struct ehca_comp_pool* pool; |
71 | static struct notifier_block comp_pool_callback_nb; | 69 | static struct notifier_block comp_pool_callback_nb; |
72 | 70 | ||
73 | #endif | ||
74 | |||
75 | static inline void comp_event_callback(struct ehca_cq *cq) | 71 | static inline void comp_event_callback(struct ehca_cq *cq) |
76 | { | 72 | { |
77 | if (!cq->ib_cq.comp_handler) | 73 | if (!cq->ib_cq.comp_handler) |
@@ -423,13 +419,13 @@ static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe) | |||
423 | return; | 419 | return; |
424 | } | 420 | } |
425 | reset_eq_pending(cq); | 421 | reset_eq_pending(cq); |
426 | #ifdef CONFIG_INFINIBAND_EHCA_SCALING | 422 | if (ehca_scaling_code) { |
427 | queue_comp_task(cq); | 423 | queue_comp_task(cq); |
428 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | 424 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); |
429 | #else | 425 | } else { |
430 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | 426 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); |
431 | comp_event_callback(cq); | 427 | comp_event_callback(cq); |
432 | #endif | 428 | } |
433 | } else { | 429 | } else { |
434 | ehca_dbg(&shca->ib_device, | 430 | ehca_dbg(&shca->ib_device, |
435 | "Got non completion event"); | 431 | "Got non completion event"); |
@@ -508,13 +504,12 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq) | |||
508 | /* call completion handler for cached eqes */ | 504 | /* call completion handler for cached eqes */ |
509 | for (i = 0; i < eqe_cnt; i++) | 505 | for (i = 0; i < eqe_cnt; i++) |
510 | if (eq->eqe_cache[i].cq) { | 506 | if (eq->eqe_cache[i].cq) { |
511 | #ifdef CONFIG_INFINIBAND_EHCA_SCALING | 507 | if (ehca_scaling_code) { |
512 | spin_lock(&ehca_cq_idr_lock); | 508 | spin_lock(&ehca_cq_idr_lock); |
513 | queue_comp_task(eq->eqe_cache[i].cq); | 509 | queue_comp_task(eq->eqe_cache[i].cq); |
514 | spin_unlock(&ehca_cq_idr_lock); | 510 | spin_unlock(&ehca_cq_idr_lock); |
515 | #else | 511 | } else |
516 | comp_event_callback(eq->eqe_cache[i].cq); | 512 | comp_event_callback(eq->eqe_cache[i].cq); |
517 | #endif | ||
518 | } else { | 513 | } else { |
519 | ehca_dbg(&shca->ib_device, "Got non completion event"); | 514 | ehca_dbg(&shca->ib_device, "Got non completion event"); |
520 | parse_identifier(shca, eq->eqe_cache[i].eqe->entry); | 515 | parse_identifier(shca, eq->eqe_cache[i].eqe->entry); |
@@ -540,8 +535,6 @@ void ehca_tasklet_eq(unsigned long data) | |||
540 | ehca_process_eq((struct ehca_shca*)data, 1); | 535 | ehca_process_eq((struct ehca_shca*)data, 1); |
541 | } | 536 | } |
542 | 537 | ||
543 | #ifdef CONFIG_INFINIBAND_EHCA_SCALING | ||
544 | |||
545 | static inline int find_next_online_cpu(struct ehca_comp_pool* pool) | 538 | static inline int find_next_online_cpu(struct ehca_comp_pool* pool) |
546 | { | 539 | { |
547 | int cpu; | 540 | int cpu; |
@@ -764,14 +757,14 @@ static int comp_pool_callback(struct notifier_block *nfb, | |||
764 | return NOTIFY_OK; | 757 | return NOTIFY_OK; |
765 | } | 758 | } |
766 | 759 | ||
767 | #endif | ||
768 | |||
769 | int ehca_create_comp_pool(void) | 760 | int ehca_create_comp_pool(void) |
770 | { | 761 | { |
771 | #ifdef CONFIG_INFINIBAND_EHCA_SCALING | ||
772 | int cpu; | 762 | int cpu; |
773 | struct task_struct *task; | 763 | struct task_struct *task; |
774 | 764 | ||
765 | if (!ehca_scaling_code) | ||
766 | return 0; | ||
767 | |||
775 | pool = kzalloc(sizeof(struct ehca_comp_pool), GFP_KERNEL); | 768 | pool = kzalloc(sizeof(struct ehca_comp_pool), GFP_KERNEL); |
776 | if (pool == NULL) | 769 | if (pool == NULL) |
777 | return -ENOMEM; | 770 | return -ENOMEM; |
@@ -796,16 +789,19 @@ int ehca_create_comp_pool(void) | |||
796 | comp_pool_callback_nb.notifier_call = comp_pool_callback; | 789 | comp_pool_callback_nb.notifier_call = comp_pool_callback; |
797 | comp_pool_callback_nb.priority =0; | 790 | comp_pool_callback_nb.priority =0; |
798 | register_cpu_notifier(&comp_pool_callback_nb); | 791 | register_cpu_notifier(&comp_pool_callback_nb); |
799 | #endif | 792 | |
793 | printk(KERN_INFO "eHCA scaling code enabled\n"); | ||
800 | 794 | ||
801 | return 0; | 795 | return 0; |
802 | } | 796 | } |
803 | 797 | ||
804 | void ehca_destroy_comp_pool(void) | 798 | void ehca_destroy_comp_pool(void) |
805 | { | 799 | { |
806 | #ifdef CONFIG_INFINIBAND_EHCA_SCALING | ||
807 | int i; | 800 | int i; |
808 | 801 | ||
802 | if (!ehca_scaling_code) | ||
803 | return; | ||
804 | |||
809 | unregister_cpu_notifier(&comp_pool_callback_nb); | 805 | unregister_cpu_notifier(&comp_pool_callback_nb); |
810 | 806 | ||
811 | for (i = 0; i < NR_CPUS; i++) { | 807 | for (i = 0; i < NR_CPUS; i++) { |
@@ -814,5 +810,4 @@ void ehca_destroy_comp_pool(void) | |||
814 | } | 810 | } |
815 | free_percpu(pool->cpu_comp_tasks); | 811 | free_percpu(pool->cpu_comp_tasks); |
816 | kfree(pool); | 812 | kfree(pool); |
817 | #endif | ||
818 | } | 813 | } |
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 57905342147..c1835121a82 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -62,6 +62,7 @@ int ehca_use_hp_mr = 0; | |||
62 | int ehca_port_act_time = 30; | 62 | int ehca_port_act_time = 30; |
63 | int ehca_poll_all_eqs = 1; | 63 | int ehca_poll_all_eqs = 1; |
64 | int ehca_static_rate = -1; | 64 | int ehca_static_rate = -1; |
65 | int ehca_scaling_code = 1; | ||
65 | 66 | ||
66 | module_param_named(open_aqp1, ehca_open_aqp1, int, 0); | 67 | module_param_named(open_aqp1, ehca_open_aqp1, int, 0); |
67 | module_param_named(debug_level, ehca_debug_level, int, 0); | 68 | module_param_named(debug_level, ehca_debug_level, int, 0); |
@@ -71,6 +72,7 @@ module_param_named(use_hp_mr, ehca_use_hp_mr, int, 0); | |||
71 | module_param_named(port_act_time, ehca_port_act_time, int, 0); | 72 | module_param_named(port_act_time, ehca_port_act_time, int, 0); |
72 | module_param_named(poll_all_eqs, ehca_poll_all_eqs, int, 0); | 73 | module_param_named(poll_all_eqs, ehca_poll_all_eqs, int, 0); |
73 | module_param_named(static_rate, ehca_static_rate, int, 0); | 74 | module_param_named(static_rate, ehca_static_rate, int, 0); |
75 | module_param_named(scaling_code, ehca_scaling_code, int, 0); | ||
74 | 76 | ||
75 | MODULE_PARM_DESC(open_aqp1, | 77 | MODULE_PARM_DESC(open_aqp1, |
76 | "AQP1 on startup (0: no (default), 1: yes)"); | 78 | "AQP1 on startup (0: no (default), 1: yes)"); |
@@ -91,6 +93,8 @@ MODULE_PARM_DESC(poll_all_eqs, | |||
91 | " (0: no, 1: yes (default))"); | 93 | " (0: no, 1: yes (default))"); |
92 | MODULE_PARM_DESC(static_rate, | 94 | MODULE_PARM_DESC(static_rate, |
93 | "set permanent static rate (default: disabled)"); | 95 | "set permanent static rate (default: disabled)"); |
96 | MODULE_PARM_DESC(scaling_code, | ||
97 | "set scaling code (0: disabled, 1: enabled/default)"); | ||
94 | 98 | ||
95 | spinlock_t ehca_qp_idr_lock; | 99 | spinlock_t ehca_qp_idr_lock; |
96 | spinlock_t ehca_cq_idr_lock; | 100 | spinlock_t ehca_cq_idr_lock; |