For HPC and ML workloads where dozens of nodes hammer the same NFS export, the TCP encapsulation that NFSv4 normally rides on shows up as the latency floor — each RPC eats a few tens of microseconds in the kernel networking stack. NFS over RDMA replaces that path with verbs against an InfiniBand or RoCE NIC, dropping per-RPC overhead to single-digit microseconds and freeing CPU. This article documents the kernel module load, server-side nconnect/proto=rdma configuration, and the way we validate the transport is actually being used — because misconfigured stacks silently fall back to TCP and you won’t notice until you compare benchmarks.
How to verify
# Confirm the host has a Mellanox/NVIDIA HCA visible
lspci | grep -i 'mellanox\|infiniband\|connectx'
ibstat
ibv_devinfo
# Confirm the RDMA stack is up
sudo systemctl status rdma-core
modinfo rpcrdma | head -5
modinfo svcrdma | head -5
# Server: confirm svcrdma is listening on port 20049
ss -tlnp | grep 20049
cat /proc/fs/nfsd/portlist
# Client: confirm the mount is using rdma transport
nfsstat -m
cat /proc/mounts | grep nfs
What’s happening
NFSv4 separates the protocol from the transport. By default the transport is TCP on port 2049, but the protocol can ride on RDMA via xprtrdma on the client and svcrdma on the server. RDMA — Remote Direct Memory Access — lets the NIC place data into the destination’s memory without involving its CPU, bypassing the kernel networking stack on both ends. For small NFS reads (sub-MTU, single-RPC-per-request) that’s where most of the latency comes from in a stock NFS deployment, so the gain is largest on metadata-heavy workloads — ls, stat, small reads — and somewhat smaller on large sequential I/O where the wire time dominates.
Two transport flavors are common. InfiniBand is a dedicated fabric with its own switches and a 100/200/400 Gb/s data rate; the link is lossless by design and the latency is the lowest you can buy. RoCE v2 (RDMA over Converged Ethernet) lets you run RDMA over Ethernet you already own, but requires PFC (Priority Flow Control) on every switch in the path to be effectively lossless — and that PFC configuration is a flag in your switch ROM, not a Linux config. We default to RoCE when the customer already has Mellanox/NVIDIA Ethernet NICs and we know the switch fabric supports PFC; we use InfiniBand when the workload is pure HPC and the cluster was built for it.
The protocol port is 20049, not 2049, and the listener is svcrdma not nfsd directly. The server-side flow is: load svcrdma, write rdma 20049 to /proc/fs/nfsd/portlist, and start exporting. The client-side flow is: load xprtrdma, mount with proto=rdma,port=20049. The export config in /etc/exports is unchanged from a TCP NFS deployment; what changes is the transport handshake.
The procedure
-
Install RDMA userspace tools and verify the HCA is up:
sudo apt update sudo apt install -y rdma-core ibverbs-utils infiniband-diags sudo systemctl enable --now rdma-core ibstat -
On the NFS server, load the RDMA server module and bind it:
sudo modprobe svcrdma echo "svcrdma" | sudo tee /etc/modules-load.d/nfs-rdma.conf sudo systemctl restart nfs-server echo "rdma 20049" | sudo tee /proc/fs/nfsd/portlist cat /proc/fs/nfsd/portlist -
Persist the port assignment across reboots by adding a systemd drop-in:
# /etc/systemd/system/nfs-server.service.d/rdma.conf [Service] ExecStartPost=/bin/sh -c 'echo "rdma 20049" > /proc/fs/nfsd/portlist'Then
sudo systemctl daemon-reload && sudo systemctl restart nfs-server. -
On the client, load the client RDMA module:
sudo modprobe xprtrdma echo "xprtrdma" | sudo tee /etc/modules-load.d/nfs-rdma.conf -
Mount with the RDMA transport:
sudo mount -t nfs4 \ -o vers=4.2,proto=rdma,port=20049,nconnect=4,_netdev \ storage-rdma.example.internal:/uploads /mnt/uploads -
Add to
/etc/fstab(note_netdevso the unit waits for networking):storage-rdma.example.internal:/uploads /mnt/uploads nfs4 vers=4.2,proto=rdma,port=20049,nconnect=4,_netdev,hard 0 0 -
Validate that traffic is actually flowing over RDMA, not silently on TCP:
nfsstat -m | grep -i proto # Look for: proto=rdma in the mount options listed cat /sys/kernel/debug/sunrpc/rpc_clnt/*/info 2>/dev/null # Run a small read and watch counters move dd if=/mnt/uploads/largefile of=/dev/null bs=1M count=1000 cat /sys/kernel/debug/sunrpc/rpc_xprt/*/stat 2>/dev/null
Common pitfalls
- If the client silently falls back to TCP — usually because
svcrdmaisn’t bound to port 20049 on the server —nfsstat -mwill sayproto=tcpand no error will appear indmesg. Always verify the transport after mounting, not just at boot. - RoCE without lossless Ethernet (PFC misconfigured on a switch) produces correct but slow operation — packet drops trigger RDMA retransmits with millisecond stalls. Symptoms look like “RDMA is no faster than TCP” until you check switch counters.
nconnect=4is what gives RDMA scaling beyond a single connection; without it, a single client funnel-points all traffic through one queue pair and you see less than half the achievable bandwidth.- Firewalls and conntrack — RDMA traffic is not visible to iptables/nftables in the usual sense, but port 20049 must be open and the host’s RDMA fabric must be reachable. Cross-VLAN RDMA usually doesn’t work.
- Some kernels (Ubuntu 24.04 initial GA) ship
svcrdmaas a separate package; checkapt search nfs-rdmaifmodprobe svcrdmafails.
In the engagements we run, NFS over RDMA shows up in two flavors: production ML pipelines where the dataset is too big to fit on local NVMe and the training loop reads the same files thousands of times, and HPC clusters where a head node hands out a shared scratch area to compute nodes. We deploy it as part of a clustered environment build-out, validate the transport is actually engaged with the commands above on every reboot, and keep an eye on RDMA error counters via Prometheus’ node_exporter node_infiniband_* series — RoCE switch misconfig will degrade silently otherwise.