diff options
author | Mark Johnston <markj@FreeBSD.org> | 2024-10-14 13:30:09 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2024-10-14 13:33:33 +0000 |
commit | 1bae9dc584272dd75dc4e04cb5d73be0e9fb562a (patch) | |
tree | 6298940f344c15c76709fbb598d40b97c336b99b /share | |
parent | 4e15366c6a6907bcd0e2c28885ba5878ed4280d2 (diff) | |
download | src-1bae9dc584272dd75dc4e04cb5d73be0e9fb562a.tar.gz src-1bae9dc584272dd75dc4e04cb5d73be0e9fb562a.zip |
netmap: Make memory pools NUMA-aware
Each netmap adapter associated with a physical adapter is attached to a
netmap memory pool. contigmalloc() is used to allocate physically
contiguous memory for the pool, but ideally we would ensure that all
such memory is allocated from the NUMA domain local to the adapter.
Augment netmap's memory pools with a NUMA domain ID, similar to how
IOMMU groups are handled in the Linux port. That is, when attaching to
a physical adapter, ensure that the associated memory pools are local to
the adapter's associated memory domain, creating new pools as needed.
Some types of ifnets do not have any defined NUMA affinity; in this case
the domain ID in question is the sentinel value -1.
Add a sysctl, dev.netmap.port_numa_affinity, which can be used to enable
the new behaviour. Keep it disabled by now to avoid surprises in case
netmap applications are relying on zero-copy optimizations to forward
packets between ports belonging to different NUMA domains.
Reviewed by: vmaffione
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D46666
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man4/netmap.4 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/share/man/man4/netmap.4 b/share/man/man4/netmap.4 index fd713f3c384b..e258b60e11f6 100644 --- a/share/man/man4/netmap.4 +++ b/share/man/man4/netmap.4 @@ -25,7 +25,7 @@ .\" This document is derived in part from the enet man page (enet.4) .\" distributed with 4.3BSD Unix. .\" -.Dd March 6, 2022 +.Dd October 10, 2024 .Dt NETMAP 4 .Os .Sh NAME @@ -938,6 +938,16 @@ switches that can be created. This tunable can be specified at loader time. .It Va dev.netmap.ptnet_vnet_hdr: 1 Allow ptnet devices to use virtio-net headers +.It Va dev.netmap.port_numa_affinity: 0 +On +.Xr numa 4 +systems, allocate memory for netmap ports from the local NUMA domain when +possible. +This can improve performance by reducing the number of remote memory accesses. +However, when forwarding packets between ports attached to different NUMA +domains, this will prevent zero-copy forwarding optimizations and thus may hurt +performance. +Note that this setting must be specified as a loader tunable at boot time. .El .Sh SYSTEM CALLS .Nm |