Skip to content

Commit 2120e63

Browse files
committed
RDMA/cxgb4: Fix RDMA_CM_EVENT_UNREACHABLE error for iWARP
jira LE-2741 Rebuild_History Non-Buildable kernel-4.18.0-553.42.1.el8_10 commit-author Anumula Murali Mohan Reddy <[email protected]> commit c659b40 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: 830662f ("RDMA/cxgb4: Add support for active and passive open connection with IPv6 address") Link: https://patch.msgid.link/r/[email protected] Signed-off-by: Anumula Murali Mohan Reddy <[email protected]> Signed-off-by: Potnuri Bharat Teja <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> (cherry picked from commit c659b40) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 1b426c6 commit 2120e63

File tree

1 file changed

+4
-5
lines changed
  • drivers/infiniband/hw/cxgb4

1 file changed

+4
-5
lines changed

drivers/infiniband/hw/cxgb4/cm.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip,
20782078
err = -ENOMEM;
20792079
if (n->dev->flags & IFF_LOOPBACK) {
20802080
if (iptype == 4)
2081-
pdev = ip_dev_find(&init_net, *(__be32 *)peer_ip);
2081+
pdev = __ip_dev_find(&init_net, *(__be32 *)peer_ip, false);
20822082
else if (IS_ENABLED(CONFIG_IPV6))
20832083
for_each_netdev(&init_net, pdev) {
20842084
if (ipv6_chk_addr(&init_net,
@@ -2093,12 +2093,12 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip,
20932093
err = -ENODEV;
20942094
goto out;
20952095
}
2096+
if (is_vlan_dev(pdev))
2097+
pdev = vlan_dev_real_dev(pdev);
20962098
ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,
20972099
n, pdev, rt_tos2priority(tos));
2098-
if (!ep->l2t) {
2099-
dev_put(pdev);
2100+
if (!ep->l2t)
21002101
goto out;
2101-
}
21022102
ep->mtu = pdev->mtu;
21032103
ep->tx_chan = cxgb4_port_chan(pdev);
21042104
ep->smac_idx = ((struct port_info *)netdev_priv(pdev))->smt_idx;
@@ -2111,7 +2111,6 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip,
21112111
ep->rss_qid = cdev->rdev.lldi.rxq_ids[
21122112
cxgb4_port_idx(pdev) * step];
21132113
set_tcp_window(ep, (struct port_info *)netdev_priv(pdev));
2114-
dev_put(pdev);
21152114
} else {
21162115
pdev = get_real_dev(n->dev);
21172116
ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,

0 commit comments

Comments
 (0)