aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincenzo Maffione <vmaffione@FreeBSD.org>2021-12-28 10:47:13 +0000
committerVincenzo Maffione <vmaffione@FreeBSD.org>2022-01-06 10:14:44 +0000
commit5df59718ed52e66963e81bb16e400a257745ae96 (patch)
tree55e1c5f93490e5fb38d065412a390f953d9c95e0
parentdfe7186f287fcdfa2dbd5b3b9eadcc0c3052148f (diff)
net: iflib: sync isc_capenable to if_capenable
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 4561c4f0ca59da5b704238074bd488ff907b4b50)
-rw-r--r--sys/net/iflib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 304518e2a24d..d2d073b82945 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -4443,6 +4443,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);