git: 36a001923836 - main - iflib: Simplify iflib_legacy_setup
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Sep 2024 20:34:14 UTC
The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=36a001923836e280e750b76947b8705fcc47b0b7 commit 36a001923836e280e750b76947b8705fcc47b0b7 Author: Krzysztof Galazka <krzysztof.galazka@intel.com> AuthorDate: 2024-09-25 20:28:52 +0000 Commit: Kevin Bowling <kbowling@FreeBSD.org> CommitDate: 2024-09-25 20:33:34 +0000 iflib: Simplify iflib_legacy_setup Follow the pattern from iflib_irq_alloc_generic function and use iflib_fast_intr as a handler for RX only interrupts. Also remove some intermediate variables and use consistent way for referencing queue's structures. Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com> Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46061 --- sys/net/iflib.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 9df01edc14d6..a2e2c3efa1ad 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -6424,15 +6424,11 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filter, void *filter_arg, int * device_t dev; struct grouptask *gtask; struct resource *res; - struct taskqgroup *tqg; - void *q; int err, tqrid; bool rx_only; - q = &ctx->ifc_rxqs[0]; - info = &rxq[0].ifr_filter_info; - gtask = &rxq[0].ifr_task; - tqg = qgroup_if_io_tqg; + info = &rxq->ifr_filter_info; + gtask = &rxq->ifr_task; tqrid = *rid; rx_only = (ctx->ifc_sctx->isc_flags & IFLIB_SINGLE_IRQ_RX_ONLY) != 0; @@ -6440,17 +6436,17 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filter, void *filter_arg, int * info->ifi_filter = filter; info->ifi_filter_arg = filter_arg; info->ifi_task = gtask; - info->ifi_ctx = rx_only ? ctx : q; + info->ifi_ctx = rxq; dev = ctx->ifc_dev; /* We allocate a single interrupt resource */ - err = _iflib_irq_alloc(ctx, irq, tqrid, rx_only ? iflib_fast_intr_ctx : + err = _iflib_irq_alloc(ctx, irq, tqrid, rx_only ? iflib_fast_intr : iflib_fast_intr_rxtx, NULL, info, name); if (err != 0) return (err); - NET_GROUPTASK_INIT(gtask, 0, _task_fn_rx, q); + NET_GROUPTASK_INIT(gtask, 0, _task_fn_rx, rxq); res = irq->ii_res; - taskqgroup_attach(tqg, gtask, q, dev, res, name); + taskqgroup_attach(qgroup_if_io_tqg, gtask, rxq, dev, res, name); GROUPTASK_INIT(&txq->ift_task, 0, _task_fn_tx, txq); taskqgroup_attach(qgroup_if_io_tqg, &txq->ift_task, txq, dev, res,