git: 04741ceafa2c - stable/14 - iflib: Set the get counter routine prior to attaching the interface
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 27 Sep 2025 15:13:57 UTC
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=04741ceafa2c14b6352626e66b99d023a65be006 commit 04741ceafa2c14b6352626e66b99d023a65be006 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2025-08-30 15:23:51 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2025-09-27 15:11:36 +0000 iflib: Set the get counter routine prior to attaching the interface This ensures other threads, e.g. ioctl threads, see the correct counter routine once after the interface has been attached. This change partially reverts commit 23ac9029f96b, which for unclear reason moved setting the get counter routine after ether_ifattach(). Reviewed by: kbowling, kgalazka, #iflib Fixes: 23ac9029f96b Update iflib to support more NIC designs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50712 (cherry picked from commit ae7f8da8bf6ed0c4f0e9f0e95ae2b08abce54378) --- sys/net/iflib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 1113a5e8e9f4..65d383e2d51e 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5431,7 +5431,6 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct DEBUGNET_SET(ctx->ifc_ifp, iflib); - if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter); iflib_add_device_sysctl_post(ctx); iflib_add_pfil(ctx); ctx->ifc_flags |= IFC_INIT_DONE; @@ -5785,6 +5784,7 @@ iflib_register(if_ctx_t ctx) if_settransmitfn(ifp, iflib_if_transmit); #endif if_setqflushfn(ifp, iflib_if_qflush); + if_setgetcounterfn(ifp, iflib_if_get_counter); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); ctx->ifc_vlan_attach_event = EVENTHANDLER_REGISTER(vlan_config, iflib_vlan_register, ctx,