aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2026-08-14 19:55:54 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2026-08-14 19:55:54 +0000
commit471e14267bea79e0f7d5768aa241471d34079e93 (patch)
treef6cab1eee3d67d1df1fda105c129dbff63039473 /libexec
parent73cceb046cd86187bc3e3bad07dd2422ee102552 (diff)
nfsd: Update the rc.d script for RDMA for the nfsd service
Commit 7144a1d58c5c added the hooks for the nfsrdma.ko module. Once loaded, this module adds RDMA support to the nfsd. This patch adds a few lines to /etc/rc.d/nfsd, so that nfs_server_rdma_enable="YES" in your /etc/rc.conf will load nfsrdma.ko, so that RDMA service is enabled. It also supports nfs_server_rdma_listen="port#" so that the default of 20490 can be overridden in /etc/rc.conf. At this available as time, the nfsrdma.ko module is an unofficial port, since it was developed by Vinicius Ferrao <ferrao@versatushpc.com.br> using generative AI. As soon as it is available, it will be announced on freebsd-current@freebsd.org. Suggested by: Vinicius Ferrao <versatushpc.com.br> MFC after: 1 month
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rc/rc.conf2
-rwxr-xr-xlibexec/rc/rc.d/nfsd7
2 files changed, 9 insertions, 0 deletions
diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf
index ab92a464b133..497bdb4f7ab5 100644
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -386,6 +386,8 @@ nfs_server_enable="NO" # This host is an NFS server (or NO).
nfs_server_flags="-u -t" # Flags to nfsd (if enabled).
nfs_server_managegids="NO" # The NFS server maps gids for AUTH_SYS (or NO).
nfs_server_maxio="131072" # Maximum I/O size for the nfsd.
+nfs_server_rdma_enable="NO" # Enable the use of the nfsrdma module for RDMA
+nfs_server_rdma_listen="20490" # Port# for the NFS server to listen on for RDMA
mountd_enable="NO" # Run mountd (or NO).
mountd_flags="-r -S" # Flags to mountd (if NFS server enabled).
weak_mountd_authentication="NO" # Allow non-root mount requests to be served.
diff --git a/libexec/rc/rc.d/nfsd b/libexec/rc/rc.d/nfsd
index 364c2a3b6bd3..89e5977687b3 100755
--- a/libexec/rc/rc.d/nfsd
+++ b/libexec/rc/rc.d/nfsd
@@ -63,6 +63,13 @@ nfsd_precmd()
if [ -n "${nfs_server_vhost}" ]; then
command_args="-V \"${nfs_server_vhost}\""
fi
+
+ if checkyesno nfs_server_rdma_enable; then
+ load_kld nfsrdma || err 1 "Cannot load nfsrdma"
+ if ! sysctl vfs.nfsd.rdma_listen=${nfs_server_rdma_listen} >/dev/null; then
+ warn "Failed to set RDMA listen port#"
+ fi
+ fi
}
run_rc_command "$1"