Skip to content

Commit c659b40

Browse files
RDMA/cxgb4: Fix RDMA_CM_EVENT_UNREACHABLE error for iWARP
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]>
1 parent 4e1e3dd commit c659b40

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
@@ -2086,7 +2086,7 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip,
20862086
err = -ENOMEM;
20872087
if (n->dev->flags & IFF_LOOPBACK) {
20882088
if (iptype == 4)
2089-
pdev = ip_dev_find(&init_net, *(__be32 *)peer_ip);
2089+
pdev = __ip_dev_find(&init_net, *(__be32 *)peer_ip, false);
20902090
else if (IS_ENABLED(CONFIG_IPV6))
20912091
for_each_netdev(&init_net, pdev) {
20922092
if (ipv6_chk_addr(&init_net,
@@ -2101,12 +2101,12 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip,
21012101
err = -ENODEV;
21022102
goto out;
21032103
}
2104+
if (is_vlan_dev(pdev))
2105+
pdev = vlan_dev_real_dev(pdev);
21042106
ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,
21052107
n, pdev, rt_tos2priority(tos));
2106-
if (!ep->l2t) {
2107-
dev_put(pdev);
2108+
if (!ep->l2t)
21082109
goto out;
2109-
}
21102110
ep->mtu = pdev->mtu;
21112111
ep->tx_chan = cxgb4_port_chan(pdev);
21122112
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,
21192119
ep->rss_qid = cdev->rdev.lldi.rxq_ids[
21202120
cxgb4_port_idx(pdev) * step];
21212121
set_tcp_window(ep, (struct port_info *)netdev_priv(pdev));
2122-
dev_put(pdev);
21232122
} else {
21242123
pdev = get_real_dev(n->dev);
21252124
ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,

0 commit comments

Comments
 (0)