aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorHoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>2007-02-15 11:08:33 -0500
committerRoland Dreier <rolandd@cisco.com>2007-02-16 16:57:34 -0500
commit4fd3006032446be2b331dd482e34c6a9e644a5b8 (patch)
treef3266f1362a6a5a12e332eae4a23daf246822bd9 /drivers/infiniband
parent8b16cef3df871b005f3a97e273b5b135ebfb3769 (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/Kconfig8
-rw-r--r--drivers/infiniband/hw/ehca/ehca_classes.h1
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c47
-rw-r--r--drivers/infiniband/hw/ehca/ehca_main.c4
4 files changed, 26 insertions, 34 deletions
diff --git a/drivers/infiniband/hw/ehca/Kconfig b/drivers/infiniband/hw/ehca/Kconfig
index 727b10d89686..1a854598e0e6 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
10config 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 f08ad6f9c132..40404c9e2817 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;
277extern int ehca_static_rate; 277extern int ehca_static_rate;
278extern int ehca_port_act_time; 278extern int ehca_port_act_time;
279extern int ehca_use_hp_mr; 279extern int ehca_use_hp_mr;
280extern int ehca_scaling_code;
280 281
281struct ipzu_queue_resp { 282struct 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 9679b072ad01..3ec53c687d08 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
68static void queue_comp_task(struct ehca_cq *__cq); 66static void queue_comp_task(struct ehca_cq *__cq);
69 67
70static struct ehca_comp_pool* pool; 68static struct ehca_comp_pool* pool;
71static struct notifier_block comp_pool_callback_nb; 69static struct notifier_block comp_pool_callback_nb;
72 70
73#endif
74
75static inline void comp_event_callback(struct ehca_cq *cq) 71static 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
545static inline int find_next_online_cpu(struct ehca_comp_pool* pool) 538static 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
769int ehca_create_comp_pool(void) 760int 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
804void ehca_destroy_comp_pool(void) 798void 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 579053421472..c1835121a822 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;
62int ehca_port_act_time = 30; 62int ehca_port_act_time = 30;
63int ehca_poll_all_eqs = 1; 63int ehca_poll_all_eqs = 1;
64int ehca_static_rate = -1; 64int ehca_static_rate = -1;
65int ehca_scaling_code = 1;
65 66
66module_param_named(open_aqp1, ehca_open_aqp1, int, 0); 67module_param_named(open_aqp1, ehca_open_aqp1, int, 0);
67module_param_named(debug_level, ehca_debug_level, int, 0); 68module_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);
71module_param_named(port_act_time, ehca_port_act_time, int, 0); 72module_param_named(port_act_time, ehca_port_act_time, int, 0);
72module_param_named(poll_all_eqs, ehca_poll_all_eqs, int, 0); 73module_param_named(poll_all_eqs, ehca_poll_all_eqs, int, 0);
73module_param_named(static_rate, ehca_static_rate, int, 0); 74module_param_named(static_rate, ehca_static_rate, int, 0);
75module_param_named(scaling_code, ehca_scaling_code, int, 0);
74 76
75MODULE_PARM_DESC(open_aqp1, 77MODULE_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))");
92MODULE_PARM_DESC(static_rate, 94MODULE_PARM_DESC(static_rate,
93 "set permanent static rate (default: disabled)"); 95 "set permanent static rate (default: disabled)");
96MODULE_PARM_DESC(scaling_code,
97 "set scaling code (0: disabled, 1: enabled/default)");
94 98
95spinlock_t ehca_qp_idr_lock; 99spinlock_t ehca_qp_idr_lock;
96spinlock_t ehca_cq_idr_lock; 100spinlock_t ehca_cq_idr_lock;