]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: client: make use of rdma_restrict_node_type()
authorStefan Metzmacher <metze@samba.org>
Wed, 21 Jan 2026 20:07:12 +0000 (21:07 +0100)
committerSteve French <stfrench@microsoft.com>
Sun, 8 Feb 2026 23:12:58 +0000 (17:12 -0600)
commit07e0b72eb05319761266719ffc78ba1d58749964
treef0ef3a79fb14ed6afe6a89fd19df4d2a6009e596
parenta760e80e90f5decb5045fd925bd842697c757e3c
smb: client: make use of rdma_restrict_node_type()

For smbdirect it required to use different ports depending
on the RDMA protocol. E.g. for iWarp 5445 is needed
(as tcp port 445 already used by the raw tcp transport for SMB),
while InfiniBand, RoCEv1 and RoCEv2 use port 445, as they
use an independent port range (even for RoCEv2, which uses udp
port 4791 itself).

And cifs.ko uses 5445 with a fallback to 445, which
means depending on the available interfaces, it tries
5445 in the RoCE range or may tries iWarp with 445
as a fallback. This leads to strange error messages
and strange network captures.

To avoid these problems they will be able to
use rdma_restrict_node_type(RDMA_NODE_RNIC) before
trying port 5445 and rdma_restrict_node_type(RDMA_NODE_IB_CA)
before trying port 445. It means we'll get early
-ENODEV early from rdma_resolve_addr() without any
network traffic and timeouts.

Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-rdma@vger.kernel.org
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smbdirect.c