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

Function iflib_legacy_setup

freebsd/net/iflib.c:6231–6273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6229}
6230
6231static int
6232iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filter, void *filter_arg, int *rid, const char *name)
6233{
6234 iflib_txq_t txq = ctx->ifc_txqs;
6235 iflib_rxq_t rxq = ctx->ifc_rxqs;
6236 if_irq_t irq = &ctx->ifc_legacy_irq;
6237 iflib_filter_info_t info;
6238 device_t dev;
6239 struct grouptask *gtask;
6240 struct resource *res;
6241 struct taskqgroup *tqg;
6242 void *q;
6243 int err, tqrid;
6244 bool rx_only;
6245
6246 q = &ctx->ifc_rxqs[0];
6247 info = &rxq[0].ifr_filter_info;
6248 gtask = &rxq[0].ifr_task;
6249 tqg = qgroup_if_io_tqg;
6250 tqrid = *rid;
6251 rx_only = (ctx->ifc_sctx->isc_flags & IFLIB_SINGLE_IRQ_RX_ONLY) != 0;
6252
6253 ctx->ifc_flags |= IFC_LEGACY;
6254 info->ifi_filter = filter;
6255 info->ifi_filter_arg = filter_arg;
6256 info->ifi_task = gtask;
6257 info->ifi_ctx = rx_only ? ctx : q;
6258
6259 dev = ctx->ifc_dev;
6260 /* We allocate a single interrupt resource */
6261 err = _iflib_irq_alloc(ctx, irq, tqrid, rx_only ? iflib_fast_intr_ctx :
6262 iflib_fast_intr_rxtx, NULL, info, name);
6263 if (err != 0)
6264 return (err);
6265 NET_GROUPTASK_INIT(gtask, 0, _task_fn_rx, q);
6266 res = irq->ii_res;
6267 taskqgroup_attach(tqg, gtask, q, dev, res, name);
6268
6269 GROUPTASK_INIT(&txq->ift_task, 0, _task_fn_tx, txq);
6270 taskqgroup_attach(qgroup_if_io_tqg, &txq->ift_task, txq, dev, res,
6271 "tx");
6272 return (0);
6273}
6274
6275void
6276iflib_led_create(if_ctx_t ctx)

Callers 1

iflib_device_registerFunction · 0.85

Calls 2

_iflib_irq_allocFunction · 0.85
taskqgroup_attachFunction · 0.85

Tested by

no test coverage detected