Skip to content

Commit ae7f8da

Browse files
committed
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 23ac902, which for unclear reason moved setting the get counter routine after ether_ifattach(). Reviewed by: kbowling, kgalazka, #iflib Fixes: 23ac902 Update iflib to support more NIC designs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50712
1 parent bb5135d commit ae7f8da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sys/net/iflib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5360,7 +5360,6 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
53605360

53615361
DEBUGNET_SET(ctx->ifc_ifp, iflib);
53625362

5363-
if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter);
53645363
iflib_add_device_sysctl_post(ctx);
53655364
iflib_add_pfil(ctx);
53665365
ctx->ifc_flags |= IFC_INIT_DONE;
@@ -5714,6 +5713,7 @@ iflib_register(if_ctx_t ctx)
57145713
if_settransmitfn(ifp, iflib_if_transmit);
57155714
#endif
57165715
if_setqflushfn(ifp, iflib_if_qflush);
5716+
if_setgetcounterfn(ifp, iflib_if_get_counter);
57175717
if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
57185718
ctx->ifc_vlan_attach_event =
57195719
EVENTHANDLER_REGISTER(vlan_config, iflib_vlan_register, ctx,

0 commit comments

Comments
 (0)