From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 864AF18CC1F; Mon, 28 Oct 2024 06:28:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730096902; cv=none; b=Lw6Z8DGvS8+euxuICn/iDEoQ0J7pnpF0r/vXktXMd1PonF1lT5kKMCT5/k5GDaJIo8Ajceqq0fJeGv68w7u88w9OIKgjGGmr2TyDYuqfDYxaBxinfXjbpjxQ+4KO7oGtHdMAk3WKxehDDEkehY/xb+0Y+iklFSM3wIP4uWj8yUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730096902; c=relaxed/simple; bh=chKyJQdVYTveFt1IPC6BlCbnlUohzFsjYPh1iOtDbyU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GpcysnHxckAVrfFgmufOitdFd2X1oUApiHQpGp3OVOyS8PsNfXi90LfYSsgP/xSAhFblRI9GT7EcKO1zKNPXMhAz1XtC2aL4/VYXGxNdQh2OoGSUar9QdSzEO9erZwpf8D+kX8MmPagb6aOVFEmB7Baez30d8h6q5S0MJa88W9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ej0DWlR1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ej0DWlR1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25317C4CEC3; Mon, 28 Oct 2024 06:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730096902; bh=chKyJQdVYTveFt1IPC6BlCbnlUohzFsjYPh1iOtDbyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ej0DWlR10rhbXr3uwMFZeh74Xr8E878m4EiAoEvMiRoMCK/DRQ3qk2+w5apKgKvg4 nAEPbEAx59nIVIxNHMOGzWZ1CdY9Wnxpuallu2jL0z2OIJwD2IvI6X8Z1esJsZCJ8k Gm1OYQlaJlq7vdd+4hzII6cQwGo4b8OQnUvBwcYA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Anumula Murali Mohan Reddy , Potnuri Bharat Teja , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.15 08/80] RDMA/cxgb4: Fix RDMA_CM_EVENT_UNREACHABLE error for iWARP Date: Mon, 28 Oct 2024 07:24:48 +0100 Message-ID: <20241028062252.854497027@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241028062252.611837461@linuxfoundation.org> References: <20241028062252.611837461@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anumula Murali Mohan Reddy [ Upstream commit c659b405b82ead335bee6eb33f9691bf718e21e8 ] ip_dev_find() always returns real net_device address, whether traffic is running on a vlan or real device, if traffic is over vlan, filling endpoint struture with real ndev and an attempt to send a connect request will results in RDMA_CM_EVENT_UNREACHABLE error. This patch fixes the issue by using vlan_dev_real_dev(). Fixes: 830662f6f032 ("RDMA/cxgb4: Add support for active and passive open connection with IPv6 address") Link: https://patch.msgid.link/r/20241007132311.70593-1-anumula@chelsio.com Signed-off-by: Anumula Murali Mohan Reddy Signed-off-by: Potnuri Bharat Teja Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/cxgb4/cm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index e6343c89c892e..3efd06d5f7e70 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c @@ -2086,7 +2086,7 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, err = -ENOMEM; if (n->dev->flags & IFF_LOOPBACK) { if (iptype == 4) - pdev = ip_dev_find(&init_net, *(__be32 *)peer_ip); + pdev = __ip_dev_find(&init_net, *(__be32 *)peer_ip, false); else if (IS_ENABLED(CONFIG_IPV6)) for_each_netdev(&init_net, pdev) { if (ipv6_chk_addr(&init_net, @@ -2101,12 +2101,12 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, err = -ENODEV; goto out; } + if (is_vlan_dev(pdev)) + pdev = vlan_dev_real_dev(pdev); ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t, n, pdev, rt_tos2priority(tos)); - if (!ep->l2t) { - dev_put(pdev); + if (!ep->l2t) goto out; - } ep->mtu = pdev->mtu; ep->tx_chan = cxgb4_port_chan(pdev); ep->smac_idx = ((struct port_info *)netdev_priv(pdev))->smt_idx; @@ -2119,7 +2119,6 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, ep->rss_qid = cdev->rdev.lldi.rxq_ids[ cxgb4_port_idx(pdev) * step]; set_tcp_window(ep, (struct port_info *)netdev_priv(pdev)); - dev_put(pdev); } else { pdev = get_real_dev(n->dev); ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t, -- 2.43.0