MCPcopy Create free account
hub / github.com/F-Stack/f-stack / taskqgroup_attach

Function taskqgroup_attach

freebsd/kern/subr_gtaskqueue.c:668–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

666}
667
668void
669taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask,
670 void *uniq, device_t dev, struct resource *irq, const char *name)
671{
672 int cpu, qid, error;
673
674 KASSERT(qgroup->tqg_cnt > 0,
675 ("qgroup %s has no queues", qgroup->tqg_name));
676
677 gtask->gt_uniq = uniq;
678 snprintf(gtask->gt_name, GROUPTASK_NAMELEN, "%s", name ? name : "grouptask");
679 gtask->gt_dev = dev;
680 gtask->gt_irq = irq;
681 gtask->gt_cpu = -1;
682 mtx_lock(&qgroup->tqg_lock);
683 qid = taskqgroup_find(qgroup, uniq);
684 qgroup->tqg_queue[qid].tgc_cnt++;
685 LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
686 gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
687 if (dev != NULL && irq != NULL) {
688 cpu = qgroup->tqg_queue[qid].tgc_cpu;
689 gtask->gt_cpu = cpu;
690 mtx_unlock(&qgroup->tqg_lock);
691 error = bus_bind_intr(dev, irq, cpu);
692 if (error)
693 printf("%s: binding interrupt failed for %s: %d\n",
694 __func__, gtask->gt_name, error);
695 } else
696 mtx_unlock(&qgroup->tqg_lock);
697}
698
699int
700taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *gtask,

Callers 6

iflib_device_registerFunction · 0.85
iflib_pseudo_registerFunction · 0.85
iflib_irq_alloc_genericFunction · 0.85
iflib_legacy_setupFunction · 0.85
iflib_config_gtask_initFunction · 0.85

Calls 6

snprintfFunction · 0.85
taskqgroup_findFunction · 0.85
bus_bind_intrFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70
printfFunction · 0.70

Tested by

no test coverage detected