[PATCH 0/2] smb: smbdirect: don't use the iWarp port mapper
From: Stefan Metzmacher
Date: Tue Dec 01 2026 - 11:27:47 EST
Hi Paulo, hi Namjae, hi Jason, hi Leon,
- "RDMA/cma: introduce rdma_set_iwpm()" lets the upper layer decide
whether the iWarp port mapper is used for an rdma_cm_id. If iwpmd
is running, every listening and connecting iWarp cm_id gets its
port mapped, and a connect asks the remote iwpmd for the mapped
port of the remote listener. For kernel users with a well known
port, like smbdirect with port 5445, that's more harmful than
helpful: if the iwpmd state on both sides doesn't match the actual
listeners, e.g. a listener created before iwpmd was started, the
connection goes to a mapped port nobody listens on, while it works
fine without iwpmd.
- smbdirect uses rdma_set_iwpm(false), so iWarp devices always listen
on and connect to the requested port 5445.
Jason, Leon: the first patch is needed by the smbdirect change, so I'd
like to take it through the smb tree with your Ack, if that's fine
with you, like "RDMA/core: introduce rdma_restrict_node_type()" for
v7.0.
These patches were developed with the help of Claude (Anthropic),
which was used for code analysis, writing parts of the code and the
commit messages. I reviewed all changes and take full responsibility
for them.
Testing: two hosts with Intel E810 (irdma) in iWARP mode and iwpmd
running on both. Without the patches iwpmd mapped the port of ksmbd's
listener on 5445 and the connect of the client. With the patches
neither side gets an iwpmd mapping and the mount connects to 5445,
also with an unpatched client against a patched server. smbdirect
over iWARP (cxgb4, irdma, siw) has also been running with these
patches in our test setup since October, there without iwpmd.
Base: paulo-linux/cifs-next (f5ed6b20ad03), the patches also apply
cleanly to linux-rdma/for-next (a8671ee9bde1).
Stefan Metzmacher (2):
RDMA/cma: introduce rdma_set_iwpm()
smb: smbdirect: don't use the iWarp port mapper
drivers/infiniband/core/cma.c | 22 ++++++++++++++++++++++
drivers/infiniband/core/cma_priv.h | 1 +
drivers/infiniband/core/iwcm.c | 7 +++++++
fs/smb/smbdirect/socket.c | 12 ++++++++++++
include/rdma/iw_cm.h | 1 +
include/rdma/rdma_cm.h | 17 +++++++++++++++++
6 files changed, 60 insertions(+)
--
2.43.0