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

Function iflib_irq_alloc_generic

freebsd/net/iflib.c:6086–6172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6084}
6085
6086int
6087iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid,
6088 iflib_intr_type_t type, driver_filter_t *filter,
6089 void *filter_arg, int qid, const char *name)
6090{
6091 device_t dev;
6092 struct grouptask *gtask;
6093 struct taskqgroup *tqg;
6094 iflib_filter_info_t info;
6095 gtask_fn_t *fn;
6096 int tqrid, err;
6097 driver_filter_t *intr_fast;
6098 void *q;
6099
6100 info = &ctx->ifc_filter_info;
6101 tqrid = rid;
6102
6103 switch (type) {
6104 /* XXX merge tx/rx for netmap? */
6105 case IFLIB_INTR_TX:
6106 q = &ctx->ifc_txqs[qid];
6107 info = &ctx->ifc_txqs[qid].ift_filter_info;
6108 gtask = &ctx->ifc_txqs[qid].ift_task;
6109 tqg = qgroup_if_io_tqg;
6110 fn = _task_fn_tx;
6111 intr_fast = iflib_fast_intr;
6112 GROUPTASK_INIT(gtask, 0, fn, q);
6113 ctx->ifc_flags |= IFC_NETMAP_TX_IRQ;
6114 break;
6115 case IFLIB_INTR_RX:
6116 q = &ctx->ifc_rxqs[qid];
6117 info = &ctx->ifc_rxqs[qid].ifr_filter_info;
6118 gtask = &ctx->ifc_rxqs[qid].ifr_task;
6119 tqg = qgroup_if_io_tqg;
6120 fn = _task_fn_rx;
6121 intr_fast = iflib_fast_intr;
6122 NET_GROUPTASK_INIT(gtask, 0, fn, q);
6123 break;
6124 case IFLIB_INTR_RXTX:
6125 q = &ctx->ifc_rxqs[qid];
6126 info = &ctx->ifc_rxqs[qid].ifr_filter_info;
6127 gtask = &ctx->ifc_rxqs[qid].ifr_task;
6128 tqg = qgroup_if_io_tqg;
6129 fn = _task_fn_rx;
6130 intr_fast = iflib_fast_intr_rxtx;
6131 NET_GROUPTASK_INIT(gtask, 0, fn, q);
6132 break;
6133 case IFLIB_INTR_ADMIN:
6134 q = ctx;
6135 tqrid = -1;
6136 info = &ctx->ifc_filter_info;
6137 gtask = &ctx->ifc_admin_task;
6138 tqg = qgroup_if_config_tqg;
6139 fn = _task_fn_admin;
6140 intr_fast = iflib_fast_intr_ctx;
6141 break;
6142 default:
6143 device_printf(ctx->ifc_dev, "%s: unknown net intr type\n",

Callers

nothing calls this directly

Calls 4

device_printfFunction · 0.85
_iflib_irq_allocFunction · 0.85
iflib_irq_set_affinityFunction · 0.85
taskqgroup_attachFunction · 0.85

Tested by

no test coverage detected