63
63
#define ERROR_DATA_LENGTH EHCA_BMASK_IBM(52,63)
64
64
#define ERROR_DATA_TYPE EHCA_BMASK_IBM(0,7)
65
65
66
- #ifdef CONFIG_INFINIBAND_EHCA_SCALING
67
-
68
66
static void queue_comp_task (struct ehca_cq * __cq );
69
67
70
68
static struct ehca_comp_pool * pool ;
71
69
static struct notifier_block comp_pool_callback_nb ;
72
70
73
- #endif
74
-
75
71
static inline void comp_event_callback (struct ehca_cq * cq )
76
72
{
77
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
419
return ;
424
420
}
425
421
reset_eq_pending (cq );
426
- #ifdef CONFIG_INFINIBAND_EHCA_SCALING
427
- queue_comp_task (cq );
428
- spin_unlock_irqrestore (& ehca_cq_idr_lock , flags );
429
- # else
430
- spin_unlock_irqrestore (& ehca_cq_idr_lock , flags );
431
- comp_event_callback (cq );
432
- #endif
422
+ if ( ehca_scaling_code ) {
423
+ queue_comp_task (cq );
424
+ spin_unlock_irqrestore (& ehca_cq_idr_lock , flags );
425
+ } else {
426
+ spin_unlock_irqrestore (& ehca_cq_idr_lock , flags );
427
+ comp_event_callback (cq );
428
+ }
433
429
} else {
434
430
ehca_dbg (& shca -> ib_device ,
435
431
"Got non completion event" );
@@ -508,13 +504,12 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq)
508
504
/* call completion handler for cached eqes */
509
505
for (i = 0 ; i < eqe_cnt ; i ++ )
510
506
if (eq -> eqe_cache [i ].cq ) {
511
- #ifdef CONFIG_INFINIBAND_EHCA_SCALING
512
- spin_lock (& ehca_cq_idr_lock );
513
- queue_comp_task (eq -> eqe_cache [i ].cq );
514
- spin_unlock (& ehca_cq_idr_lock );
515
- #else
516
- comp_event_callback (eq -> eqe_cache [i ].cq );
517
- #endif
507
+ if (ehca_scaling_code ) {
508
+ spin_lock (& ehca_cq_idr_lock );
509
+ queue_comp_task (eq -> eqe_cache [i ].cq );
510
+ spin_unlock (& ehca_cq_idr_lock );
511
+ } else
512
+ comp_event_callback (eq -> eqe_cache [i ].cq );
518
513
} else {
519
514
ehca_dbg (& shca -> ib_device , "Got non completion event" );
520
515
parse_identifier (shca , eq -> eqe_cache [i ].eqe -> entry );
@@ -540,8 +535,6 @@ void ehca_tasklet_eq(unsigned long data)
540
535
ehca_process_eq ((struct ehca_shca * )data , 1 );
541
536
}
542
537
543
- #ifdef CONFIG_INFINIBAND_EHCA_SCALING
544
-
545
538
static inline int find_next_online_cpu (struct ehca_comp_pool * pool )
546
539
{
547
540
int cpu ;
@@ -764,14 +757,14 @@ static int comp_pool_callback(struct notifier_block *nfb,
764
757
return NOTIFY_OK ;
765
758
}
766
759
767
- #endif
768
-
769
760
int ehca_create_comp_pool (void )
770
761
{
771
- #ifdef CONFIG_INFINIBAND_EHCA_SCALING
772
762
int cpu ;
773
763
struct task_struct * task ;
774
764
765
+ if (!ehca_scaling_code )
766
+ return 0 ;
767
+
775
768
pool = kzalloc (sizeof (struct ehca_comp_pool ), GFP_KERNEL );
776
769
if (pool == NULL )
777
770
return - ENOMEM ;
@@ -796,16 +789,19 @@ int ehca_create_comp_pool(void)
796
789
comp_pool_callback_nb .notifier_call = comp_pool_callback ;
797
790
comp_pool_callback_nb .priority = 0 ;
798
791
register_cpu_notifier (& comp_pool_callback_nb );
799
- #endif
792
+
793
+ printk (KERN_INFO "eHCA scaling code enabled\n" );
800
794
801
795
return 0 ;
802
796
}
803
797
804
798
void ehca_destroy_comp_pool (void )
805
799
{
806
- #ifdef CONFIG_INFINIBAND_EHCA_SCALING
807
800
int i ;
808
801
802
+ if (!ehca_scaling_code )
803
+ return ;
804
+
809
805
unregister_cpu_notifier (& comp_pool_callback_nb );
810
806
811
807
for (i = 0 ; i < NR_CPUS ; i ++ ) {
@@ -814,5 +810,4 @@ void ehca_destroy_comp_pool(void)
814
810
}
815
811
free_percpu (pool -> cpu_comp_tasks );
816
812
kfree (pool );
817
- #endif
818
813
}
0 commit comments