mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
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 commit23ac9029f9, which for unclear reason moved setting the get counter routine after ether_ifattach(). Reviewed by: kbowling, kgalazka, #iflib Fixes:23ac9029f9Update iflib to support more NIC designs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50712
This commit is contained in:
parent
bb5135d0f2
commit
ae7f8da8bf
1 changed files with 1 additions and 1 deletions
|
|
@ -5360,7 +5360,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;
|
||||
|
|
@ -5714,6 +5713,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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue