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=1796244570; b=VpwcMxf3lCVpeDKWpn67EVYilEFoA7Ghfkclf6qXZuQK9Q5JpS8bzodzfhnyafvk9vIT G+mEq2s/Cpf0Kl4Mo2XEqJNR9XtCgXafdd75W1qzeDTetwuilLdK2T8qp8ShAkDj4Npw7 aYvbyiuMfMfbrS4UZJ6wpS7u83BB30ssBiywCHSLSWx5nMXw6xOST+6QWcJfhNCKrl62T CGjbh2eJusKdMn+Uci7CvQj1ALeIdLQeLz0uU6u3zcutAoTsYBArIsL2l2ymsATjKtpSv 6yWbXB5LK1PSC3zsi+wz7KNmEf1t1jK82bukA8kTi0P0S/P3kCa/6OE2H5d/AFMDU/w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796244570; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=2rNhGwyhrEO3oSAxUkC9r1bSd6oVxU+ZwaoT/FzET/0=; b=zdntx+zm6JNaCizoBx+9OYASudI8G7gcAqfNgQaSS+5QOdXcHOeQpmEqedPZh0TYRVNt gtYCWZMHHGzJ0WZgOdCtbMpWWftw3yTXYu8u5hYDg6QyBypR49w4ISk4D6srr+f6wGsu5 pZcVlLMPt92xRKQj8PNYiZxgPKtnQkMzm1RwK+Kzr6VIVHRU2dMjHp39KOgdScpmb0XeQ Pk6SoMPsxuobXsVgA+m+Evi47TG5Kof4gSo7z/t6DSScLPC4pX8J23sByAcfrtcA3K7wj LdNUQrgysZzaZyWElSTwA8FuTzhFx0OfYYdc91pcMbCiJgLQKlmH3Y0EclPiohDlXcg== 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=m59B0ef7; 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 8210A606A322; Wed, 2 Dec 2026 20:49:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8210A606A322 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, unprotected) header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=m59B0ef7 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=2rNhGwyhrEO3oSAxUkC9r1bSd6oVxU+ZwaoT/FzET/0=; b=m59B0ef7m2Uq4uPGQWuuxxAzRz kmujL9Q8LkiRci8oX5W9In4oBjLeHjI5JnPgdVdFSwhrwpcDkBLD6GMrWxlO5+6Y6J+J0PW3RHQEG 2H6IkqJY6QHGOJCykwpchLtTjUMN/FQFBr4GHQeMKdLG7069nLFg2LjMShgmG0m6oIz02eq5ssnzX QolVkEYd2WBBhu+PQvzQhy8FIzXViCT4xq63OiJB/JMzMUI4ruGh8HeJAmL0RheAw0fONWOnRl/Ok Xdlm/V4EfSgotYbtUOTdbkJIkE9t5ABuUSTzYcXjU773lvDGg2ctkrPRgvTL5AGL3Nw3o56EM17BX 1+P3Ve47Inli32DUgihtbpL/5GqMU6X1EqI6LU0fR2FSJ5gGpQn40MENLKCdluYy0DseoEWl7tdxY Jxe/+9fkhrB/N1mGkuQtNDflpdUccwt8VlE6PId6heumYdnIAt3HgtiBkUPgR85BZWNq+OVQ8GRo3 eVENQZl5H/tFsX09DXRIhHV0; 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 1xYrGS-00000000nm8-05wm; Wed, 02 Dec 2026 20:49:20 +0000 From: Stefan Metzmacher To: Paulo Alcantara , Namjae Jeon Cc: metze@samba.org, Jason Gunthorpe , Leon Romanovsky , Tom Talpey , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v2 0/2] smb: smbdirect: don't use the iWarp port mapper Date: Wed, 2 Dec 2026 21:49:10 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 X-Mailing-List: stable@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 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. Changes in v2 (thanks to the review by Sashiko): - Patch 1: no Fixes tag anymore, only Cc: stable, as it only adds a new function and the problem also exists before dce268ffcddc. It now says that it's a prerequisite for the smbdirect patch. - Patch 2: a note for stable, it needs patch 1, and before v7.1 a backport has to call rdma_set_iwpm(false) in the client and in ksmbd, where they create their rdma_cm_ids. - Rebased on the current cifs-next, no code changes. v1: https://lore.kernel.org/linux-cifs/cover.1796142211.git.metze@samba.org/ Base: paulo-linux/cifs-next (5449fa133d3a), 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