Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/iflib.c
Show First 20 Lines • Show All 4,997 Lines • ▼ Show 20 Lines | if (err != 0) { | ||||
device_printf(ctx->ifc_dev, "_iflib_irq_alloc failed %d\n", err); | device_printf(ctx->ifc_dev, "_iflib_irq_alloc failed %d\n", err); | ||||
return (err); | return (err); | ||||
} | } | ||||
if (type == IFLIB_INTR_ADMIN) | if (type == IFLIB_INTR_ADMIN) | ||||
return (0); | return (0); | ||||
if (tqrid != -1) { | if (tqrid != -1) { | ||||
cpuid = find_nth(ctx, &cpus, qid); | cpuid = find_nth(ctx, &cpus, qid); | ||||
taskqgroup_attach_cpu(tqg, gtask, q, cpuid, irq->ii_rid, name); | taskqgroup_attach_cpu(tqg, gtask, q, cpuid, rman_get_start(irq->ii_res), name); | ||||
} else { | } else { | ||||
taskqgroup_attach(tqg, gtask, q, tqrid, name); | taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
iflib_softirq_alloc_generic(if_ctx_t ctx, int rid, iflib_intr_type_t type, void *arg, int qid, char *name) | iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, void *arg, int qid, char *name) | ||||
{ | { | ||||
struct grouptask *gtask; | struct grouptask *gtask; | ||||
struct taskqgroup *tqg; | struct taskqgroup *tqg; | ||||
gtask_fn_t *fn; | gtask_fn_t *fn; | ||||
void *q; | void *q; | ||||
int irq_num = -1; | |||||
switch (type) { | switch (type) { | ||||
case IFLIB_INTR_TX: | case IFLIB_INTR_TX: | ||||
q = &ctx->ifc_txqs[qid]; | q = &ctx->ifc_txqs[qid]; | ||||
gtask = &ctx->ifc_txqs[qid].ift_task; | gtask = &ctx->ifc_txqs[qid].ift_task; | ||||
tqg = qgroup_if_io_tqg; | tqg = qgroup_if_io_tqg; | ||||
fn = _task_fn_tx; | fn = _task_fn_tx; | ||||
if (irq != NULL) | |||||
irq_num = rman_get_start(irq->ii_res); | |||||
break; | break; | ||||
case IFLIB_INTR_RX: | case IFLIB_INTR_RX: | ||||
q = &ctx->ifc_rxqs[qid]; | q = &ctx->ifc_rxqs[qid]; | ||||
gtask = &ctx->ifc_rxqs[qid].ifr_task; | gtask = &ctx->ifc_rxqs[qid].ifr_task; | ||||
tqg = qgroup_if_io_tqg; | tqg = qgroup_if_io_tqg; | ||||
fn = _task_fn_rx; | fn = _task_fn_rx; | ||||
if (irq != NULL) | |||||
irq_num = rman_get_start(irq->ii_res); | |||||
break; | break; | ||||
case IFLIB_INTR_IOV: | case IFLIB_INTR_IOV: | ||||
q = ctx; | q = ctx; | ||||
gtask = &ctx->ifc_vflr_task; | gtask = &ctx->ifc_vflr_task; | ||||
tqg = qgroup_if_config_tqg; | tqg = qgroup_if_config_tqg; | ||||
rid = -1; | |||||
fn = _task_fn_iov; | fn = _task_fn_iov; | ||||
break; | break; | ||||
default: | default: | ||||
panic("unknown net intr type"); | panic("unknown net intr type"); | ||||
} | } | ||||
GROUPTASK_INIT(gtask, 0, fn, q); | GROUPTASK_INIT(gtask, 0, fn, q); | ||||
taskqgroup_attach(tqg, gtask, q, rid, name); | taskqgroup_attach(tqg, gtask, q, irq_num, name); | ||||
} | } | ||||
void | void | ||||
iflib_irq_free(if_ctx_t ctx, if_irq_t irq) | iflib_irq_free(if_ctx_t ctx, if_irq_t irq) | ||||
{ | { | ||||
if (irq->ii_tag) | if (irq->ii_tag) | ||||
bus_teardown_intr(ctx->ifc_dev, irq->ii_res, irq->ii_tag); | bus_teardown_intr(ctx->ifc_dev, irq->ii_res, irq->ii_tag); | ||||
▲ Show 20 Lines • Show All 636 Lines • Show Last 20 Lines |