Date: Tue, 28 Dec 2021 10:55:41 GMT From: Vincenzo Maffione <vmaffione@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 4561c4f0ca59 - main - net: iflib: sync isc_capenable to if_capenable Message-ID: <202112281055.1BSAtf68094027@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=4561c4f0ca59da5b704238074bd488ff907b4b50 commit 4561c4f0ca59da5b704238074bd488ff907b4b50 Author: Vincenzo Maffione <vmaffione@FreeBSD.org> AuthorDate: 2021-12-28 10:47:13 +0000 Commit: Vincenzo Maffione <vmaffione@FreeBSD.org> CommitDate: 2021-12-28 10:55:21 +0000 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 --- sys/net/iflib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 1fdda2ef8462..599d9f93bcbc 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -4449,6 +4449,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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112281055.1BSAtf68094027>