Date: Wed, 2 Oct 2024 19:53:21 GMT From: Kevin Bowling <kbowling@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: d3c81ec4e90d - stable/14 - iflib: Simplify iflib_legacy_setup Message-ID: <202410021953.492JrLDI060661@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=d3c81ec4e90dfea3d2ecb2dc759f4f104bed0ce1 commit d3c81ec4e90dfea3d2ecb2dc759f4f104bed0ce1 Author: Krzysztof Galazka <krzysztof.galazka@intel.com> AuthorDate: 2024-09-25 20:28:52 +0000 Commit: Kevin Bowling <kbowling@FreeBSD.org> CommitDate: 2024-10-02 19:52:39 +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 Differential Revision: https://reviews.freebsd.org/D46061 (cherry picked from commit 36a001923836e280e750b76947b8705fcc47b0b7) --- 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 8cb0d0610a21..fa6227f3f80a 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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202410021953.492JrLDI060661>