Commit c659b405 authored by Anumula Murali Mohan Reddy's avatar Anumula Murali Mohan Reddy Committed by Jason Gunthorpe

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: 830662f6 ("RDMA/cxgb4: Add support for active and passive open connection with IPv6 address")
Link: https://patch.msgid.link/r/20241007132311.70593-1-anumula@chelsio.comSigned-off-by: default avatarAnumula Murali Mohan Reddy <anumula@chelsio.com>
Signed-off-by: default avatarPotnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 4e1e3dd8
...@@ -2086,7 +2086,7 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, ...@@ -2086,7 +2086,7 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip,
err = -ENOMEM; err = -ENOMEM;
if (n->dev->flags & IFF_LOOPBACK) { if (n->dev->flags & IFF_LOOPBACK) {
if (iptype == 4) 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)) else if (IS_ENABLED(CONFIG_IPV6))
for_each_netdev(&init_net, pdev) { for_each_netdev(&init_net, pdev) {
if (ipv6_chk_addr(&init_net, if (ipv6_chk_addr(&init_net,
...@@ -2101,12 +2101,12 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, ...@@ -2101,12 +2101,12 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip,
err = -ENODEV; err = -ENODEV;
goto out; goto out;
} }
if (is_vlan_dev(pdev))
pdev = vlan_dev_real_dev(pdev);
ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t, ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,
n, pdev, rt_tos2priority(tos)); n, pdev, rt_tos2priority(tos));
if (!ep->l2t) { if (!ep->l2t)
dev_put(pdev);
goto out; goto out;
}
ep->mtu = pdev->mtu; ep->mtu = pdev->mtu;
ep->tx_chan = cxgb4_port_chan(pdev); ep->tx_chan = cxgb4_port_chan(pdev);
ep->smac_idx = ((struct port_info *)netdev_priv(pdev))->smt_idx; 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, ...@@ -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[ ep->rss_qid = cdev->rdev.lldi.rxq_ids[
cxgb4_port_idx(pdev) * step]; cxgb4_port_idx(pdev) * step];
set_tcp_window(ep, (struct port_info *)netdev_priv(pdev)); set_tcp_window(ep, (struct port_info *)netdev_priv(pdev));
dev_put(pdev);
} else { } else {
pdev = get_real_dev(n->dev); pdev = get_real_dev(n->dev);
ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t, ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment