diff options
author | Mark Johnston <markj@FreeBSD.org> | 2021-11-16 18:31:04 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2021-11-16 18:31:04 +0000 |
commit | fcaa890c4469118255d463495b4044eef484fa3e (patch) | |
tree | 2af18c574f81fe100e0d0d0c978b287c3afbcf95 /sys/rpc | |
parent | 42188bb5c118f456af0606a2ce6ae26378716415 (diff) | |
download | src-fcaa890c4469118255d463495b4044eef484fa3e.tar.gz src-fcaa890c4469118255d463495b4044eef484fa3e.zip |
mbuf: Only allow extpg mbufs if the system has a direct map
Some upcoming changes will modify software checksum routines like
in_cksum() to operate using m_apply(), which uses the direct map to
access packet data for unmapped mbufs. This approach of course does not
work on platforms without a direct map, so we have to disallow the use
of unmapped mbufs on such platforms.
I believe this is the right tradeoff: we only configure KTLS on amd64
and arm64 today (and one KTLS consumer, NFS TLS, requires a direct map
already), and the use of unmapped mbufs with plain sendfile is a recent
optimization. If need be, m_apply() could be modified to create
CPU-private mappings of extpg mbuf pages as a fallback.
So, change mb_use_ext_pgs to be hard-wired to zero on systems without a
direct map. Note that PMAP_HAS_DMAP is not a compile-time constant on
some systems, so the default value of mb_use_ext_pgs has to be
determined during boot.
Reviewed by: jhb
Discussed with: gallatin
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32940
Diffstat (limited to 'sys/rpc')
-rw-r--r-- | sys/rpc/rpcsec_tls/rpctls_impl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/rpc/rpcsec_tls/rpctls_impl.c b/sys/rpc/rpcsec_tls/rpctls_impl.c index 110ba107540a..c495213b08e2 100644 --- a/sys/rpc/rpcsec_tls/rpctls_impl.c +++ b/sys/rpc/rpcsec_tls/rpctls_impl.c @@ -711,7 +711,7 @@ rpctls_getinfo(u_int *maxlenp, bool rpctlscd_run, bool rpctlssd_run) int error; size_t siz; - if (PMAP_HAS_DMAP == 0 || !mb_use_ext_pgs) + if (!mb_use_ext_pgs) return (false); siz = sizeof(enable); error = kernel_sysctlbyname(curthread, "kern.ipc.tls.enable", |