From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796210313; b=PCTCgGWGehj1ZPenqcDxQauv9hRlIO3stWlY2WWGmZdKPtyl0M6Nc3/PcJGvILMNiaP/ KpuSeb6Jy/D7C4GalZgb/BXvSNw24DePOh7WCt1p8Jvprul6sgP2OKtBDQGmyjDAWzVt8 +Ud76fSK/lfKzm7bMxQ/tijR10Oht7Up2EaUlfyvntZWd4V5pt1wxDQFn+PQRXr+NTbjy YggSA6zCkT0MFpAawRjBLGx/pNeLZo0laLukXco1KwXBycvgM0tIdJIkBHYUGDRKK2qFt ZiLzzfKZjZK8294KzvwV2UNDxyBv2K/6s+Q+cCKMcjfXLlR8zirUqFKjwWYLNK9XYmg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796210313; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=vsvDrA8sJApo2sSufzTl00h6go4VnWSZcQJobQLd5gY=; b=GfHZ/ftKY8AFWGvg39ycIoL8z4MGgicYgzxUmmGVJGgdtetIzcizsADTwE20iugZPMpC xb9SMeie72WL247IaO0qy3i9Lw8lhBc0LoBajJhsIBfKi7LYOizyRJd6nSLij8m/wCHjy RSlGEJMBoSitXNvhwF2zxJgEN2pZHpFOMzysCtKGZ2GvWJq5od95bDKXT7KxqnDG9hj2u g20Czr8W5++bn9bHxgo07JDn4tVc/dgVrxGCAB+uX6rGuZN9lIdolD1iOyWJikpuJNvJR J2Ko6V7LhcKpSY469fYUJlCgNsI4wVYmbFttaM0mkGzLBU5L/t8DHheejX8WsIAQCpQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FUEClLAo; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E61B606A32F; Wed, 2 Dec 2026 11:18:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FUEClLAo Received: by smtp.kernel.org (Postfix) with ESMTPSA id 628091F00931; Wed, 2 Dec 2026 11:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796210313; bh=vsvDrA8sJApo2sSufzTl00h6go4VnWSZcQJobQLd5gY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=FUEClLAo9YINgLk+AOGvQEkL0UgukVBBsowPfq3thGpOaYgvaAql+NtuX/5iNdDeQ Hi/SFG3k/JEBJvZFWdmC0xmm7oq9EA2iLGkwNS9Uo+NKp7U1fYfwaOoukpnJeaydV+ QTr1p2TNc1cgFgtY7i6uySpFZSB8F50zeAjWJ/N/ei1bZwR4xlQqS3mdDz3tIfQ+ur Uzax+3NV6tmb7X6ZNsvr9fgzMvhZCA2oiF5N2hkJS5jX2fGWjyeTO8Lx7yKExGwSdk 8kPpOAdQEmXt8Q8DhTbeexdRTdNgq4mZI2eZ4Adf6ssJ5XHdmqLv3PKwrS3e4SE3WV BRcjpEVyyyR9A== Date: Wed, 2 Dec 2026 13:18:28 +0200 From: Leon Romanovsky To: Tim Menninger Cc: Jason Gunthorpe , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, David Ahern , Ido Schimmel , Shiva Lingappa , Rohit Patil Subject: Re: [PATCH] RDMA/core: Use the CM source port in IP route lookups Message-ID: <20261202111828.GL31440@unreal> References: <20261130193648.3170657-1-tmenninger@everpuredata.com> X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261130193648.3170657-1-tmenninger@everpuredata.com> On Mon, Nov 30, 2026 at 07:36:48PM +0000, Tim Menninger wrote: > From: Shiva Lingappa > > addr4_resolve() and addr6_resolve() leave the flow's source port zero. > With wildcard source addresses and identical routing constraints, > connections to the same destination therefore select the same ECMP > nexthop, even when fib_multipath_hash_policy includes L4 ports, leaving > the other paths idle. > > Populate fl4_sport/fl6_sport from the source sockaddr, which already > contains the CM-assigned port. This provides per-connection entropy > with hash policy 1, or policy 3 with the source-port field selected. > The normal RoCE CM route setup retains the selected interface and > destination MAC. > > This is the CM port-space port, not the RoCEv2 UDP source port, so it > does not reproduce downstream switch hashing. It also changes matching > of source-port FIB rules without an ipproto restriction, independently > of the hash policy. Policies excluding the source port retain the same > multipath hash. > > Tested over IPv4 with an NFSv4.1 flexfiles client (nconnect=16), one > data server, two-way ECMP over two 400G ConnectX-7 ports, hash policy 1 > and default FIB rules. All 16 connections used one device without the > change. With the change, connections used both devices on every tested > mount. elbencho 1 MiB direct-read throughput increased from 46596 to > 92726 MiB/s. > > IPv6 address resolution was checked by resolving 64 rdma_cm IDs to one > destination over a two-way IPv6 ECMP route with hash policy 1. Device > selection changed from 64/0 IDs before this change to 31/33 after. > > Reported-by: Rohit Patil > Signed-off-by: Shiva Lingappa > Co-developed-by: Tim Menninger > Signed-off-by: Tim Menninger > --- > NOTE: Rohit's report was internal, so no public report URL is available. > > drivers/infiniband/core/addr.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c > index bdaa3eb83bcc..6b80cc2c84c8 100644 > --- a/drivers/infiniband/core/addr.c > +++ b/drivers/infiniband/core/addr.c > @@ -382,6 +382,7 @@ static int addr4_resolve(struct sockaddr *src_sock, > memset(&fl4, 0, sizeof(fl4)); > fl4.daddr = dst_ip; > fl4.saddr = src_ip; > + fl4.fl4_sport = src_in->sin_port; > fl4.flowi4_oif = addr->bound_dev_if; > rt = ip_route_output_key(addr->net, &fl4); > ret = PTR_ERR_OR_ZERO(rt); > @@ -411,6 +412,7 @@ static int addr6_resolve(struct sockaddr *src_sock, > memset(&fl6, 0, sizeof fl6); > fl6.daddr = dst_in->sin6_addr; > fl6.saddr = src_in->sin6_addr; > + fl6.fl6_sport = src_in->sin6_port; > fl6.flowi6_oif = addr->bound_dev_if; > > dst = ip6_dst_lookup_flow(addr->net, NULL, &fl6, NULL); I asked AI to see if it breaks something and it claims that the commit broke IPv6 RoCE address resolution on ECMP nexthop groups by selecting an outgoing interface while using another interface’s source address. Chelsio is also broken with this change. Thanks > -- > 2.53.0 > >