| 6172 | } |
| 6173 | |
| 6174 | void |
| 6175 | iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, void *arg, int qid, const char *name) |
| 6176 | { |
| 6177 | struct grouptask *gtask; |
| 6178 | struct taskqgroup *tqg; |
| 6179 | gtask_fn_t *fn; |
| 6180 | void *q; |
| 6181 | int err; |
| 6182 | |
| 6183 | switch (type) { |
| 6184 | case IFLIB_INTR_TX: |
| 6185 | q = &ctx->ifc_txqs[qid]; |
| 6186 | gtask = &ctx->ifc_txqs[qid].ift_task; |
| 6187 | tqg = qgroup_if_io_tqg; |
| 6188 | fn = _task_fn_tx; |
| 6189 | GROUPTASK_INIT(gtask, 0, fn, q); |
| 6190 | break; |
| 6191 | case IFLIB_INTR_RX: |
| 6192 | q = &ctx->ifc_rxqs[qid]; |
| 6193 | gtask = &ctx->ifc_rxqs[qid].ifr_task; |
| 6194 | tqg = qgroup_if_io_tqg; |
| 6195 | fn = _task_fn_rx; |
| 6196 | NET_GROUPTASK_INIT(gtask, 0, fn, q); |
| 6197 | break; |
| 6198 | case IFLIB_INTR_IOV: |
| 6199 | q = ctx; |
| 6200 | gtask = &ctx->ifc_vflr_task; |
| 6201 | tqg = qgroup_if_config_tqg; |
| 6202 | fn = _task_fn_iov; |
| 6203 | GROUPTASK_INIT(gtask, 0, fn, q); |
| 6204 | break; |
| 6205 | default: |
| 6206 | panic("unknown net intr type"); |
| 6207 | } |
| 6208 | if (irq != NULL) { |
| 6209 | err = iflib_irq_set_affinity(ctx, irq, type, qid, gtask, tqg, |
| 6210 | q, name); |
| 6211 | if (err) |
| 6212 | taskqgroup_attach(tqg, gtask, q, ctx->ifc_dev, |
| 6213 | irq->ii_res, name); |
| 6214 | } else { |
| 6215 | taskqgroup_attach(tqg, gtask, q, NULL, NULL, name); |
| 6216 | } |
| 6217 | } |
| 6218 | |
| 6219 | void |
| 6220 | iflib_irq_free(if_ctx_t ctx, if_irq_t irq) |
nothing calls this directly
no test coverage detected