Skip to content

Commit

Permalink
net: iflib: sync isc_capenable to if_capenable
Browse files Browse the repository at this point in the history
On SIOCSIFCAP, some bits in ifp->if_capenable may be toggled.
When this happens, apply the same change to isc_capenable, which
is the iflib private copy of if_capenable (for a subset of the
IFCAP_* bits). In this way the iflib drivers can check the bits
using isc_capenable rather than if_capenable. This is convenient
because the latter access requires an additional indirection
through the ifp, and it is also less likely to be in cache.

PR:		260068
Reviewed by:	kbowling, gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33156

(cherry picked from commit 4561c4f)
  • Loading branch information
Vincenzo Maffione authored and Vincenzo Maffione committed Jan 6, 2022
1 parent 2c7441c commit 6000a41
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sys/net/iflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -4423,6 +4423,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
iflib_stop(ctx);
STATE_LOCK(ctx);
if_togglecapenable(ifp, setmask);
ctx->ifc_softc_ctx.isc_capenable ^= setmask;
STATE_UNLOCK(ctx);
if (bits & IFF_DRV_RUNNING && setmask & ~IFCAP_WOL)
iflib_init_locked(ctx);
Expand Down

0 comments on commit 6000a41

Please sign in to comment.