From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=144.76.82.148 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796244576; b=fyaa3AcYS4pmdqFNF9MlE2q4w1MrpXJy+rV5iBOudBMVyG9xvFSW+IgaLxwyXiA9NYKt Hk/Cj1BPYuTGcFNDqbIp9S/hgkgInlhckY1wsTZUyY+Iro16b7ZMUN/QB89bkNPBhO7Wn SzK6PFTSNKzsi8i5qQ9a0A0ivHSReSkLavvv3fROraNaAwkB0zdUca0nOhjEK5OYBY1eO gXT69GidYuvZzi9JkhDuN/PEHhK4u7GToxWQEy55PlCmhVE3QMS6q8HzrdpK4IUQVoeac pQeFCfhOryPEVwkgGpkQgKukMyBirZ6uTskcPqBlFdoaU+Ue5OHySwoEvk86HobNXeg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796244576; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=27+b8y+em/OLkX//1K/0mPeRSubK3li+LpT7KJesLxo=; b=mLq7Dd3OKyIy6iUylY6SRzbcuD1DjC1rBAvwbHpBBPpNlwMZlfLsrGD1+v+94oWB/T6c OEe1vqbMfwYgfSAzehQ0Yn0hTHvR4me+wq3B74up0+X1B+yT/MLIrOk+f30uoEckS/RSv 5+2f3rE4Phd5zchPFghDiZx3ScZzgrcULLX66M4pQsDFhR8/bs53ky3h5RXaJOMXc1zlw 3dDEKnbcoQmwBBGbMfGQQaBp5exPhJ2QDdEF3S16f6hSgCw25+bo5V3iP3crfxDL628+u lTH52OC8BQKa4kTmNXrc3+J3EYFVL0EAgqOTQ02ePB2Vn2uv9T5Be+RMQ5jvQvm21PQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=samba.org; spf=pass smtp.mailfrom=samba.org; dkim=pass header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=ZnUsRZoJ; arc=none smtp.remote-ip=144.76.82.148 Received: from hr2.samba.org (hr2.samba.org [144.76.82.148]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41ACC606A33A; Wed, 2 Dec 2026 20:49:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 41ACC606A33A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=samba.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samba.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (3072-bit key) header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=ZnUsRZoJ DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Message-ID:Date:Cc:To:From; bh=27+b8y+em/OLkX//1K/0mPeRSubK3li+LpT7KJesLxo=; b=ZnUsRZoJ2fnhtu2GlD3I1LFyjq rtUE0+/iBbYQQ1iK2MvNw4WXEa5W69k/UltktkE+4RLGfJdls7LUBBhWpoyQscWMVL0z/Wx0obHd4 N4uMODwLSyTv8crTUbWAPq3TKRoep5uArEuLYMCAgAFOiCeCxVVoUyKYKOw6Bo3fZNu2YbOr8VQxd J/tfWjB8zwWjVnM+khOCXZmi6tHFr8W6rjHzHkzxoVj540er7Ljf+IP+Na3YttW86PZ/XIM1/nc3j X/tdWUttT7U4iAZ9pcMdW/N8auSVKgoeE99Pf6aj1gUVUid85BlPWGkHQe0aNgpOCdmq2eCN9g/80 xNMYBP3jbkMmQbKme6668TTd9yiwIdXGZ3PcoFPikuOmulSHL5vhFWskT/nTmUmKScTfLWl/nWIwx d/QY1mSqdRAvpQNV3WoKXF0fN7rcemfkn5kt8pPf/Ntj5LIFKM1J1+2q9NAR5/t2HFY6gHcTjPmuE womEFBc8wcuMGx/1tWnd4NkH; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__ECDSA_SECP256R1_SHA256__CHACHA20_POLY1305:256) (Exim) id 1xYrGe-00000000nnq-1Dbq; Wed, 02 Dec 2026 20:49:32 +0000 From: Stefan Metzmacher To: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Cc: metze@samba.org, stable@vger.kernel.org, Namjae Jeon , Paulo Alcantara , Tom Talpey , Jason Gunthorpe , Leon Romanovsky , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] smb: smbdirect: don't use the iWarp port mapper Date: Wed, 2 Dec 2026 21:49:12 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. For stable: this needs "RDMA/cma: introduce rdma_set_iwpm()" from the same series, so both have to be backported together. Before v7.1 the same problem exists in the client and in ksmbd, there a backport has to call rdma_set_iwpm(false) where they create their rdma_cm_ids. Fixes: dce268ffcddc ("smb: smbdirect: introduce smbdirect_socket_init_{new,accepting}() and helpers") Cc: stable@vger.kernel.org Cc: Namjae Jeon Cc: Paulo Alcantara Cc: Tom Talpey Cc: Jason Gunthorpe Cc: Leon Romanovsky 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 --- 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