diff options
author | Steve Wise <swise@opengridcomputing.com> | 2014-05-16 13:42:46 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-05-19 21:00:32 -0400 |
commit | 11b8e22d4d0979d8201cbdf0b5fffdbe2d5bcedf (patch) | |
tree | fb3c6c6361115e839eae6ecc19e97c97e81b16e0 | |
parent | 65b302ad31b02b0790417f4e65833af494cb35ce (diff) |
RDMA/cxgb4: Fix vlan support
RDMA connections over a vlan interface don't work due to
import_ep() not using the correct egress device.
- use the real device in import_ep()
- use rdma_vlan_dev_real_dev() in get_real_dev().
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | drivers/infiniband/hw/cxgb4/cm.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 1f863a96a480..28114e6b02e9 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
@@ -47,6 +47,8 @@ | |||
47 | #include <net/ip6_route.h> | 47 | #include <net/ip6_route.h> |
48 | #include <net/addrconf.h> | 48 | #include <net/addrconf.h> |
49 | 49 | ||
50 | #include <rdma/ib_addr.h> | ||
51 | |||
50 | #include "iw_cxgb4.h" | 52 | #include "iw_cxgb4.h" |
51 | 53 | ||
52 | static char *states[] = { | 54 | static char *states[] = { |
@@ -341,10 +343,7 @@ static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp) | |||
341 | 343 | ||
342 | static struct net_device *get_real_dev(struct net_device *egress_dev) | 344 | static struct net_device *get_real_dev(struct net_device *egress_dev) |
343 | { | 345 | { |
344 | struct net_device *phys_dev = egress_dev; | 346 | return rdma_vlan_dev_real_dev(egress_dev) ? : egress_dev; |
345 | if (egress_dev->priv_flags & IFF_802_1Q_VLAN) | ||
346 | phys_dev = vlan_dev_real_dev(egress_dev); | ||
347 | return phys_dev; | ||
348 | } | 347 | } |
349 | 348 | ||
350 | static int our_interface(struct c4iw_dev *dev, struct net_device *egress_dev) | 349 | static int our_interface(struct c4iw_dev *dev, struct net_device *egress_dev) |
@@ -1746,16 +1745,16 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip, | |||
1746 | if (!ep->l2t) | 1745 | if (!ep->l2t) |
1747 | goto out; | 1746 | goto out; |
1748 | ep->mtu = dst_mtu(dst); | 1747 | ep->mtu = dst_mtu(dst); |
1749 | ep->tx_chan = cxgb4_port_chan(n->dev); | 1748 | ep->tx_chan = cxgb4_port_chan(pdev); |
1750 | ep->smac_idx = (cxgb4_port_viid(n->dev) & 0x7F) << 1; | 1749 | ep->smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1; |
1751 | step = cdev->rdev.lldi.ntxq / | 1750 | step = cdev->rdev.lldi.ntxq / |
1752 | cdev->rdev.lldi.nchan; | 1751 | cdev->rdev.lldi.nchan; |
1753 | ep->txq_idx = cxgb4_port_idx(n->dev) * step; | 1752 | ep->txq_idx = cxgb4_port_idx(pdev) * step; |
1754 | ep->ctrlq_idx = cxgb4_port_idx(n->dev); | 1753 | ep->ctrlq_idx = cxgb4_port_idx(pdev); |
1755 | step = cdev->rdev.lldi.nrxq / | 1754 | step = cdev->rdev.lldi.nrxq / |
1756 | cdev->rdev.lldi.nchan; | 1755 | cdev->rdev.lldi.nchan; |
1757 | ep->rss_qid = cdev->rdev.lldi.rxq_ids[ | 1756 | ep->rss_qid = cdev->rdev.lldi.rxq_ids[ |
1758 | cxgb4_port_idx(n->dev) * step]; | 1757 | cxgb4_port_idx(pdev) * step]; |
1759 | 1758 | ||
1760 | if (clear_mpa_v1) { | 1759 | if (clear_mpa_v1) { |
1761 | ep->retry_with_mpa_v1 = 0; | 1760 | ep->retry_with_mpa_v1 = 0; |