2 * IBM eServer eHCA Infiniband device driver for Linux on POWER
4 * Functions for EQs, NEQs and interrupts
6 * Authors: Heiko J Schick <schickhj@de.ibm.com>
7 * Khadija Souissi <souissi@de.ibm.com>
9 * Copyright (c) 2005 IBM Corporation
11 * All rights reserved.
13 * This source code is distributed under a dual license of GPL v2.0 and OpenIB
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions are met:
21 * Redistributions of source code must retain the above copyright notice, this
22 * list of conditions and the following disclaimer.
24 * Redistributions in binary form must reproduce the above copyright notice,
25 * this list of conditions and the following disclaimer in the documentation
26 * and/or other materials
27 * provided with the distribution.
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
33 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
36 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
37 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE.
42 #include "ehca_classes.h"
44 #include "ehca_iverbs.h"
45 #include "ehca_tools.h"
48 #include "ipz_pt_fn.h"
50 #define EQE_COMPLETION_EVENT EHCA_BMASK_IBM(1,1)
51 #define EQE_CQ_QP_NUMBER EHCA_BMASK_IBM(8,31)
52 #define EQE_EE_IDENTIFIER EHCA_BMASK_IBM(2,7)
53 #define EQE_CQ_NUMBER EHCA_BMASK_IBM(8,31)
54 #define EQE_QP_NUMBER EHCA_BMASK_IBM(8,31)
55 #define EQE_QP_TOKEN EHCA_BMASK_IBM(32,63)
56 #define EQE_CQ_TOKEN EHCA_BMASK_IBM(32,63)
58 #define NEQE_COMPLETION_EVENT EHCA_BMASK_IBM(1,1)
59 #define NEQE_EVENT_CODE EHCA_BMASK_IBM(2,7)
60 #define NEQE_PORT_NUMBER EHCA_BMASK_IBM(8,15)
61 #define NEQE_PORT_AVAILABILITY EHCA_BMASK_IBM(16,16)
63 #define ERROR_DATA_LENGTH EHCA_BMASK_IBM(52,63)
64 #define ERROR_DATA_TYPE EHCA_BMASK_IBM(0,7)
66 static void queue_comp_task(struct ehca_cq *__cq);
68 static struct ehca_comp_pool* pool;
69 static struct notifier_block comp_pool_callback_nb;
71 static inline void comp_event_callback(struct ehca_cq *cq)
73 if (!cq->ib_cq.comp_handler)
76 spin_lock(&cq->cb_lock);
77 cq->ib_cq.comp_handler(&cq->ib_cq, cq->ib_cq.cq_context);
78 spin_unlock(&cq->cb_lock);
83 static void print_error_data(struct ehca_shca * shca, void* data,
84 u64* rblock, int length)
86 u64 type = EHCA_BMASK_GET(ERROR_DATA_TYPE, rblock[2]);
87 u64 resource = rblock[1];
90 case 0x1: /* Queue Pair */
92 struct ehca_qp *qp = (struct ehca_qp*)data;
94 /* only print error data if AER is set */
98 ehca_err(&shca->ib_device,
99 "QP 0x%x (resource=%lx) has errors.",
100 qp->ib_qp.qp_num, resource);
103 case 0x4: /* Completion Queue */
105 struct ehca_cq *cq = (struct ehca_cq*)data;
107 ehca_err(&shca->ib_device,
108 "CQ 0x%x (resource=%lx) has errors.",
109 cq->cq_number, resource);
113 ehca_err(&shca->ib_device,
114 "Unknown errror type: %lx on %s.",
115 type, shca->ib_device.name);
119 ehca_err(&shca->ib_device, "Error data is available: %lx.", resource);
120 ehca_err(&shca->ib_device, "EHCA ----- error data begin "
121 "---------------------------------------------------");
122 ehca_dmp(rblock, length, "resource=%lx", resource);
123 ehca_err(&shca->ib_device, "EHCA ----- error data end "
124 "----------------------------------------------------");
129 int ehca_error_data(struct ehca_shca *shca, void *data,
135 unsigned long block_count;
137 rblock = ehca_alloc_fw_ctrlblock(GFP_ATOMIC);
139 ehca_err(&shca->ib_device, "Cannot allocate rblock memory.");
144 /* rblock must be 4K aligned and should be 4K large */
145 ret = hipz_h_error_data(shca->ipz_hca_handle,
150 if (ret == H_R_STATE)
151 ehca_err(&shca->ib_device,
152 "No error data is available: %lx.", resource);
153 else if (ret == H_SUCCESS) {
156 length = EHCA_BMASK_GET(ERROR_DATA_LENGTH, rblock[0]);
158 if (length > EHCA_PAGESIZE)
159 length = EHCA_PAGESIZE;
161 print_error_data(shca, data, rblock, length);
163 ehca_err(&shca->ib_device,
164 "Error data could not be fetched: %lx", resource);
166 ehca_free_fw_ctrlblock(rblock);
173 static void qp_event_callback(struct ehca_shca *shca,
175 enum ib_event_type event_type)
177 struct ib_event event;
180 u32 token = EHCA_BMASK_GET(EQE_QP_TOKEN, eqe);
182 spin_lock_irqsave(&ehca_qp_idr_lock, flags);
183 qp = idr_find(&ehca_qp_idr, token);
184 spin_unlock_irqrestore(&ehca_qp_idr_lock, flags);
190 ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
192 if (!qp->ib_qp.event_handler)
195 event.device = &shca->ib_device;
196 event.event = event_type;
197 event.element.qp = &qp->ib_qp;
199 qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context);
204 static void cq_event_callback(struct ehca_shca *shca,
209 u32 token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe);
211 spin_lock_irqsave(&ehca_cq_idr_lock, flags);
212 cq = idr_find(&ehca_cq_idr, token);
213 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
218 ehca_error_data(shca, cq, cq->ipz_cq_handle.handle);
223 static void parse_identifier(struct ehca_shca *shca, u64 eqe)
225 u8 identifier = EHCA_BMASK_GET(EQE_EE_IDENTIFIER, eqe);
227 switch (identifier) {
228 case 0x02: /* path migrated */
229 qp_event_callback(shca, eqe, IB_EVENT_PATH_MIG);
231 case 0x03: /* communication established */
232 qp_event_callback(shca, eqe, IB_EVENT_COMM_EST);
234 case 0x04: /* send queue drained */
235 qp_event_callback(shca, eqe, IB_EVENT_SQ_DRAINED);
237 case 0x05: /* QP error */
238 case 0x06: /* QP error */
239 qp_event_callback(shca, eqe, IB_EVENT_QP_FATAL);
241 case 0x07: /* CQ error */
242 case 0x08: /* CQ error */
243 cq_event_callback(shca, eqe);
245 case 0x09: /* MRMWPTE error */
246 ehca_err(&shca->ib_device, "MRMWPTE error.");
248 case 0x0A: /* port event */
249 ehca_err(&shca->ib_device, "Port event.");
251 case 0x0B: /* MR access error */
252 ehca_err(&shca->ib_device, "MR access error.");
254 case 0x0C: /* EQ error */
255 ehca_err(&shca->ib_device, "EQ error.");
257 case 0x0D: /* P/Q_Key mismatch */
258 ehca_err(&shca->ib_device, "P/Q_Key mismatch.");
260 case 0x10: /* sampling complete */
261 ehca_err(&shca->ib_device, "Sampling complete.");
263 case 0x11: /* unaffiliated access error */
264 ehca_err(&shca->ib_device, "Unaffiliated access error.");
266 case 0x12: /* path migrating error */
267 ehca_err(&shca->ib_device, "Path migration error.");
269 case 0x13: /* interface trace stopped */
270 ehca_err(&shca->ib_device, "Interface trace stopped.");
272 case 0x14: /* first error capture info available */
274 ehca_err(&shca->ib_device, "Unknown identifier: %x on %s.",
275 identifier, shca->ib_device.name);
282 static void parse_ec(struct ehca_shca *shca, u64 eqe)
284 struct ib_event event;
285 u8 ec = EHCA_BMASK_GET(NEQE_EVENT_CODE, eqe);
286 u8 port = EHCA_BMASK_GET(NEQE_PORT_NUMBER, eqe);
289 case 0x30: /* port availability change */
290 if (EHCA_BMASK_GET(NEQE_PORT_AVAILABILITY, eqe)) {
291 ehca_info(&shca->ib_device,
292 "port %x is active.", port);
293 event.device = &shca->ib_device;
294 event.event = IB_EVENT_PORT_ACTIVE;
295 event.element.port_num = port;
296 shca->sport[port - 1].port_state = IB_PORT_ACTIVE;
297 ib_dispatch_event(&event);
299 ehca_info(&shca->ib_device,
300 "port %x is inactive.", port);
301 event.device = &shca->ib_device;
302 event.event = IB_EVENT_PORT_ERR;
303 event.element.port_num = port;
304 shca->sport[port - 1].port_state = IB_PORT_DOWN;
305 ib_dispatch_event(&event);
309 /* port configuration change
310 * disruptive change is caused by
311 * LID, PKEY or SM change
313 ehca_warn(&shca->ib_device,
314 "disruptive port %x configuration change", port);
316 ehca_info(&shca->ib_device,
317 "port %x is inactive.", port);
318 event.device = &shca->ib_device;
319 event.event = IB_EVENT_PORT_ERR;
320 event.element.port_num = port;
321 shca->sport[port - 1].port_state = IB_PORT_DOWN;
322 ib_dispatch_event(&event);
324 ehca_info(&shca->ib_device,
325 "port %x is active.", port);
326 event.device = &shca->ib_device;
327 event.event = IB_EVENT_PORT_ACTIVE;
328 event.element.port_num = port;
329 shca->sport[port - 1].port_state = IB_PORT_ACTIVE;
330 ib_dispatch_event(&event);
332 case 0x32: /* adapter malfunction */
333 ehca_err(&shca->ib_device, "Adapter malfunction.");
335 case 0x33: /* trace stopped */
336 ehca_err(&shca->ib_device, "Traced stopped.");
339 ehca_err(&shca->ib_device, "Unknown event code: %x on %s.",
340 ec, shca->ib_device.name);
347 static inline void reset_eq_pending(struct ehca_cq *cq)
350 struct h_galpa gal = cq->galpas.kernel;
352 hipz_galpa_store_cq(gal, cqx_ep, 0x0);
353 CQx_EP = hipz_galpa_load(gal, CQTEMM_OFFSET(cqx_ep));
358 irqreturn_t ehca_interrupt_neq(int irq, void *dev_id)
360 struct ehca_shca *shca = (struct ehca_shca*)dev_id;
362 tasklet_hi_schedule(&shca->neq.interrupt_task);
367 void ehca_tasklet_neq(unsigned long data)
369 struct ehca_shca *shca = (struct ehca_shca*)data;
370 struct ehca_eqe *eqe;
373 eqe = (struct ehca_eqe *)ehca_poll_eq(shca, &shca->neq);
376 if (!EHCA_BMASK_GET(NEQE_COMPLETION_EVENT, eqe->entry))
377 parse_ec(shca, eqe->entry);
379 eqe = (struct ehca_eqe *)ehca_poll_eq(shca, &shca->neq);
382 ret = hipz_h_reset_event(shca->ipz_hca_handle,
383 shca->neq.ipz_eq_handle, 0xFFFFFFFFFFFFFFFFL);
385 if (ret != H_SUCCESS)
386 ehca_err(&shca->ib_device, "Can't clear notification events.");
391 irqreturn_t ehca_interrupt_eq(int irq, void *dev_id)
393 struct ehca_shca *shca = (struct ehca_shca*)dev_id;
395 tasklet_hi_schedule(&shca->eq.interrupt_task);
401 static inline void process_eqe(struct ehca_shca *shca, struct ehca_eqe *eqe)
407 eqe_value = eqe->entry;
408 ehca_dbg(&shca->ib_device, "eqe_value=%lx", eqe_value);
409 if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT, eqe_value)) {
410 ehca_dbg(&shca->ib_device, "... completion event");
411 token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value);
412 spin_lock_irqsave(&ehca_cq_idr_lock, flags);
413 cq = idr_find(&ehca_cq_idr, token);
415 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
416 ehca_err(&shca->ib_device,
417 "Invalid eqe for non-existing cq token=%x",
421 reset_eq_pending(cq);
422 if (ehca_scaling_code) {
424 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
426 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
427 comp_event_callback(cq);
430 ehca_dbg(&shca->ib_device,
431 "Got non completion event");
432 parse_identifier(shca, eqe_value);
436 void ehca_process_eq(struct ehca_shca *shca, int is_irq)
438 struct ehca_eq *eq = &shca->eq;
439 struct ehca_eqe_cache_entry *eqe_cache = eq->eqe_cache;
445 spin_lock_irqsave(&eq->irq_spinlock, flags);
447 const int max_query_cnt = 100;
451 int_state = hipz_h_query_int_state(
452 shca->ipz_hca_handle, eq->ist);
455 } while (int_state && query_cnt < max_query_cnt);
456 if (unlikely((query_cnt == max_query_cnt)))
457 ehca_dbg(&shca->ib_device, "int_state=%x query_cnt=%x",
458 int_state, query_cnt);
461 /* read out all eqes */
465 eqe_cache[eqe_cnt].eqe =
466 (struct ehca_eqe *)ehca_poll_eq(shca, eq);
467 if (!eqe_cache[eqe_cnt].eqe)
469 eqe_value = eqe_cache[eqe_cnt].eqe->entry;
470 if (EHCA_BMASK_GET(EQE_COMPLETION_EVENT, eqe_value)) {
471 token = EHCA_BMASK_GET(EQE_CQ_TOKEN, eqe_value);
472 spin_lock(&ehca_cq_idr_lock);
473 eqe_cache[eqe_cnt].cq = idr_find(&ehca_cq_idr, token);
474 if (!eqe_cache[eqe_cnt].cq) {
475 spin_unlock(&ehca_cq_idr_lock);
476 ehca_err(&shca->ib_device,
477 "Invalid eqe for non-existing cq "
481 spin_unlock(&ehca_cq_idr_lock);
483 eqe_cache[eqe_cnt].cq = NULL;
485 } while (eqe_cnt < EHCA_EQE_CACHE_SIZE);
488 ehca_dbg(&shca->ib_device,
489 "No eqe found for irq event");
490 goto unlock_irq_spinlock;
492 ehca_dbg(&shca->ib_device, "deadman found %x eqe", eqe_cnt);
493 if (unlikely(eqe_cnt == EHCA_EQE_CACHE_SIZE))
494 ehca_dbg(&shca->ib_device, "too many eqes for one irq event");
495 /* enable irq for new packets */
496 for (i = 0; i < eqe_cnt; i++) {
497 if (eq->eqe_cache[i].cq)
498 reset_eq_pending(eq->eqe_cache[i].cq);
501 spin_lock(&eq->spinlock);
502 eq_empty = (!ipz_eqit_eq_peek_valid(&shca->eq.ipz_queue));
503 spin_unlock(&eq->spinlock);
504 /* call completion handler for cached eqes */
505 for (i = 0; i < eqe_cnt; i++)
506 if (eq->eqe_cache[i].cq) {
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);
512 comp_event_callback(eq->eqe_cache[i].cq);
514 ehca_dbg(&shca->ib_device, "Got non completion event");
515 parse_identifier(shca, eq->eqe_cache[i].eqe->entry);
517 /* poll eq if not empty */
519 goto unlock_irq_spinlock;
521 struct ehca_eqe *eqe;
522 eqe = (struct ehca_eqe *)ehca_poll_eq(shca, &shca->eq);
525 process_eqe(shca, eqe);
530 spin_unlock_irqrestore(&eq->irq_spinlock, flags);
533 void ehca_tasklet_eq(unsigned long data)
535 ehca_process_eq((struct ehca_shca*)data, 1);
538 static inline int find_next_online_cpu(struct ehca_comp_pool* pool)
543 WARN_ON_ONCE(!in_interrupt());
544 if (ehca_debug_level)
545 ehca_dmp(&cpu_online_map, sizeof(cpumask_t), "");
547 spin_lock_irqsave(&pool->last_cpu_lock, flags);
548 cpu = next_cpu(pool->last_cpu, cpu_online_map);
550 cpu = first_cpu(cpu_online_map);
551 pool->last_cpu = cpu;
552 spin_unlock_irqrestore(&pool->last_cpu_lock, flags);
557 static void __queue_comp_task(struct ehca_cq *__cq,
558 struct ehca_cpu_comp_task *cct)
562 spin_lock_irqsave(&cct->task_lock, flags);
563 spin_lock(&__cq->task_lock);
565 if (__cq->nr_callbacks == 0) {
566 __cq->nr_callbacks++;
567 list_add_tail(&__cq->entry, &cct->cq_list);
569 wake_up(&cct->wait_queue);
572 __cq->nr_callbacks++;
574 spin_unlock(&__cq->task_lock);
575 spin_unlock_irqrestore(&cct->task_lock, flags);
578 static void queue_comp_task(struct ehca_cq *__cq)
582 struct ehca_cpu_comp_task *cct;
585 cpu_id = find_next_online_cpu(pool);
586 BUG_ON(!cpu_online(cpu_id));
588 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id);
591 if (cct->cq_jobs > 0) {
592 cpu_id = find_next_online_cpu(pool);
593 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id);
597 __queue_comp_task(__cq, cct);
600 static void run_comp_task(struct ehca_cpu_comp_task* cct)
605 spin_lock_irqsave(&cct->task_lock, flags);
607 while (!list_empty(&cct->cq_list)) {
608 cq = list_entry(cct->cq_list.next, struct ehca_cq, entry);
609 spin_unlock_irqrestore(&cct->task_lock, flags);
610 comp_event_callback(cq);
611 spin_lock_irqsave(&cct->task_lock, flags);
613 spin_lock(&cq->task_lock);
615 if (cq->nr_callbacks == 0) {
616 list_del_init(cct->cq_list.next);
619 spin_unlock(&cq->task_lock);
622 spin_unlock_irqrestore(&cct->task_lock, flags);
625 static int comp_task(void *__cct)
627 struct ehca_cpu_comp_task* cct = __cct;
629 DECLARE_WAITQUEUE(wait, current);
631 set_current_state(TASK_INTERRUPTIBLE);
632 while(!kthread_should_stop()) {
633 add_wait_queue(&cct->wait_queue, &wait);
635 spin_lock_irq(&cct->task_lock);
636 cql_empty = list_empty(&cct->cq_list);
637 spin_unlock_irq(&cct->task_lock);
641 __set_current_state(TASK_RUNNING);
643 remove_wait_queue(&cct->wait_queue, &wait);
645 spin_lock_irq(&cct->task_lock);
646 cql_empty = list_empty(&cct->cq_list);
647 spin_unlock_irq(&cct->task_lock);
649 run_comp_task(__cct);
651 set_current_state(TASK_INTERRUPTIBLE);
653 __set_current_state(TASK_RUNNING);
658 static struct task_struct *create_comp_task(struct ehca_comp_pool *pool,
661 struct ehca_cpu_comp_task *cct;
663 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
664 spin_lock_init(&cct->task_lock);
665 INIT_LIST_HEAD(&cct->cq_list);
666 init_waitqueue_head(&cct->wait_queue);
667 cct->task = kthread_create(comp_task, cct, "ehca_comp/%d", cpu);
672 static void destroy_comp_task(struct ehca_comp_pool *pool,
675 struct ehca_cpu_comp_task *cct;
676 struct task_struct *task;
677 unsigned long flags_cct;
679 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
681 spin_lock_irqsave(&cct->task_lock, flags_cct);
687 spin_unlock_irqrestore(&cct->task_lock, flags_cct);
693 static void take_over_work(struct ehca_comp_pool *pool,
696 struct ehca_cpu_comp_task *cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
699 unsigned long flags_cct;
701 spin_lock_irqsave(&cct->task_lock, flags_cct);
703 list_splice_init(&cct->cq_list, &list);
705 while(!list_empty(&list)) {
706 cq = list_entry(cct->cq_list.next, struct ehca_cq, entry);
708 list_del(&cq->entry);
709 __queue_comp_task(cq, per_cpu_ptr(pool->cpu_comp_tasks,
710 smp_processor_id()));
713 spin_unlock_irqrestore(&cct->task_lock, flags_cct);
717 static int comp_pool_callback(struct notifier_block *nfb,
718 unsigned long action,
721 unsigned int cpu = (unsigned long)hcpu;
722 struct ehca_cpu_comp_task *cct;
726 ehca_gen_dbg("CPU: %x (CPU_PREPARE)", cpu);
727 if(!create_comp_task(pool, cpu)) {
728 ehca_gen_err("Can't create comp_task for cpu: %x", cpu);
732 case CPU_UP_CANCELED:
733 ehca_gen_dbg("CPU: %x (CPU_CANCELED)", cpu);
734 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
735 kthread_bind(cct->task, any_online_cpu(cpu_online_map));
736 destroy_comp_task(pool, cpu);
739 ehca_gen_dbg("CPU: %x (CPU_ONLINE)", cpu);
740 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
741 kthread_bind(cct->task, cpu);
742 wake_up_process(cct->task);
744 case CPU_DOWN_PREPARE:
745 ehca_gen_dbg("CPU: %x (CPU_DOWN_PREPARE)", cpu);
747 case CPU_DOWN_FAILED:
748 ehca_gen_dbg("CPU: %x (CPU_DOWN_FAILED)", cpu);
751 ehca_gen_dbg("CPU: %x (CPU_DEAD)", cpu);
752 destroy_comp_task(pool, cpu);
753 take_over_work(pool, cpu);
760 int ehca_create_comp_pool(void)
763 struct task_struct *task;
765 if (!ehca_scaling_code)
768 pool = kzalloc(sizeof(struct ehca_comp_pool), GFP_KERNEL);
772 spin_lock_init(&pool->last_cpu_lock);
773 pool->last_cpu = any_online_cpu(cpu_online_map);
775 pool->cpu_comp_tasks = alloc_percpu(struct ehca_cpu_comp_task);
776 if (pool->cpu_comp_tasks == NULL) {
781 for_each_online_cpu(cpu) {
782 task = create_comp_task(pool, cpu);
784 kthread_bind(task, cpu);
785 wake_up_process(task);
789 comp_pool_callback_nb.notifier_call = comp_pool_callback;
790 comp_pool_callback_nb.priority =0;
791 register_cpu_notifier(&comp_pool_callback_nb);
793 printk(KERN_INFO "eHCA scaling code enabled\n");
798 void ehca_destroy_comp_pool(void)
802 if (!ehca_scaling_code)
805 unregister_cpu_notifier(&comp_pool_callback_nb);
807 for (i = 0; i < NR_CPUS; i++) {
809 destroy_comp_task(pool, i);
811 free_percpu(pool->cpu_comp_tasks);