From: Stefan Metzmacher <metze@samba.org>
To: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org
Cc: metze@samba.org, stable@vger.kernel.org,
Namjae Jeon <linkinjeon@kernel.org>,
Paulo Alcantara <pc@manguebit.org>, Tom Talpey <tom@talpey.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] smb: smbdirect: don't use the iWarp port mapper
Date: Tue, 1 Dec 2026 17:27:12 +0100 [thread overview]
Message-ID: <5f51312eb4dd9a7d3a3ea7d8aa7d77217cd767b4.1796142211.git.metze@samba.org> (raw)
In-Reply-To: <cover.1796142211.git.metze@samba.org>
smbdirect uses the well known port 5445 for iWarp. If iwpmd is
running, the listener is mapped to another port and a client asks
the remote iwpmd for the mapped port of the remote listener, which
only works if the state of both sides matches. E.g. a listener
created before iwpmd was started is not mapped, but the remote
iwpmd still hands out a mapped port, so the connection goes to a
port nobody listens on.
Use rdma_set_iwpm(false), so iWarp devices always listen on and
connect to the requested ports.
Fixes: dce268ffcddc ("smb: smbdirect: introduce smbdirect_socket_init_{new,accepting}() and helpers")
Cc: stable@vger.kernel.org
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: Paulo Alcantara <pc@manguebit.org>
Cc: Tom Talpey <tom@talpey.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Cc: linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
---
fs/smb/smbdirect/socket.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/fs/smb/smbdirect/socket.c b/fs/smb/smbdirect/socket.c
index 13cf50b96bc9..837883192857 100644
--- a/fs/smb/smbdirect/socket.c
+++ b/fs/smb/smbdirect/socket.c
@@ -76,6 +76,18 @@ int smbdirect_socket_init_new(struct net *net, struct smbdirect_socket *sc)
return ret;
}
+ /*
+ * Never use the iWarp port mapper (iwpmd), so an iWarp device
+ * listens on and connects to the ports we ask for, e.g. 5445.
+ */
+ ret = rdma_set_iwpm(id, false);
+ if (ret) {
+ rdma_destroy_id(id);
+ pr_err("%s: rdma_set_iwpm() failed %1pe\n",
+ __func__, SMBDIRECT_DEBUG_ERR_PTR(ret));
+ return ret;
+ }
+
sc->rdma.cm_id = id;
INIT_WORK(&sc->disconnect_work, smbdirect_socket_cleanup_work);
--
2.43.0
prev parent reply other threads:[~2026-12-01 16:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 16:27 [PATCH 0/2] " Stefan Metzmacher
2026-12-01 16:27 ` [PATCH 1/2] RDMA/cma: introduce rdma_set_iwpm() Stefan Metzmacher
2026-12-01 16:27 ` Stefan Metzmacher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f51312eb4dd9a7d3a3ea7d8aa7d77217cd767b4.1796142211.git.metze@samba.org \
--to=metze@samba.org \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=pc@manguebit.org \
--cc=samba-technical@lists.samba.org \
--cc=stable@vger.kernel.org \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®