提交 6094c85a 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/mlx4: Fix reading SL field out of cqe->sl_vid
  RDMA/addr: Fix build breakage when IPv6 is disabled
...@@ -37,6 +37,7 @@ config INFINIBAND_USER_MEM ...@@ -37,6 +37,7 @@ config INFINIBAND_USER_MEM
config INFINIBAND_ADDR_TRANS config INFINIBAND_ADDR_TRANS
bool bool
depends on INET depends on INET
depends on !(INFINIBAND = y && IPV6 = m)
default y default y
source "drivers/infiniband/hw/mthca/Kconfig" source "drivers/infiniband/hw/mthca/Kconfig"
......
...@@ -128,6 +128,8 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) ...@@ -128,6 +128,8 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
ret = rdma_copy_addr(dev_addr, dev, NULL); ret = rdma_copy_addr(dev_addr, dev, NULL);
dev_put(dev); dev_put(dev);
break; break;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case AF_INET6: case AF_INET6:
for_each_netdev(&init_net, dev) { for_each_netdev(&init_net, dev) {
if (ipv6_chk_addr(&init_net, if (ipv6_chk_addr(&init_net,
...@@ -138,8 +140,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr) ...@@ -138,8 +140,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
} }
} }
break; break;
default: #endif
break;
} }
return ret; return ret;
} }
...@@ -179,10 +180,11 @@ static void addr_send_arp(struct sockaddr *dst_in) ...@@ -179,10 +180,11 @@ static void addr_send_arp(struct sockaddr *dst_in)
{ {
struct rtable *rt; struct rtable *rt;
struct flowi fl; struct flowi fl;
struct dst_entry *dst;
memset(&fl, 0, sizeof fl); memset(&fl, 0, sizeof fl);
if (dst_in->sa_family == AF_INET) {
switch (dst_in->sa_family) {
case AF_INET:
fl.nl_u.ip4_u.daddr = fl.nl_u.ip4_u.daddr =
((struct sockaddr_in *) dst_in)->sin_addr.s_addr; ((struct sockaddr_in *) dst_in)->sin_addr.s_addr;
...@@ -191,8 +193,13 @@ static void addr_send_arp(struct sockaddr *dst_in) ...@@ -191,8 +193,13 @@ static void addr_send_arp(struct sockaddr *dst_in)
neigh_event_send(rt->u.dst.neighbour, NULL); neigh_event_send(rt->u.dst.neighbour, NULL);
ip_rt_put(rt); ip_rt_put(rt);
break;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case AF_INET6:
{
struct dst_entry *dst;
} else {
fl.nl_u.ip6_u.daddr = fl.nl_u.ip6_u.daddr =
((struct sockaddr_in6 *) dst_in)->sin6_addr; ((struct sockaddr_in6 *) dst_in)->sin6_addr;
...@@ -202,6 +209,9 @@ static void addr_send_arp(struct sockaddr *dst_in) ...@@ -202,6 +209,9 @@ static void addr_send_arp(struct sockaddr *dst_in)
neigh_event_send(dst->neighbour, NULL); neigh_event_send(dst->neighbour, NULL);
dst_release(dst); dst_release(dst);
break;
}
#endif
} }
} }
...@@ -254,6 +264,7 @@ static int addr4_resolve_remote(struct sockaddr_in *src_in, ...@@ -254,6 +264,7 @@ static int addr4_resolve_remote(struct sockaddr_in *src_in,
return ret; return ret;
} }
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static int addr6_resolve_remote(struct sockaddr_in6 *src_in, static int addr6_resolve_remote(struct sockaddr_in6 *src_in,
struct sockaddr_in6 *dst_in, struct sockaddr_in6 *dst_in,
struct rdma_dev_addr *addr) struct rdma_dev_addr *addr)
...@@ -282,6 +293,14 @@ static int addr6_resolve_remote(struct sockaddr_in6 *src_in, ...@@ -282,6 +293,14 @@ static int addr6_resolve_remote(struct sockaddr_in6 *src_in,
dst_release(dst); dst_release(dst);
return ret; return ret;
} }
#else
static int addr6_resolve_remote(struct sockaddr_in6 *src_in,
struct sockaddr_in6 *dst_in,
struct rdma_dev_addr *addr)
{
return -EADDRNOTAVAIL;
}
#endif
static int addr_resolve_remote(struct sockaddr *src_in, static int addr_resolve_remote(struct sockaddr *src_in,
struct sockaddr *dst_in, struct sockaddr *dst_in,
...@@ -340,7 +359,9 @@ static int addr_resolve_local(struct sockaddr *src_in, ...@@ -340,7 +359,9 @@ static int addr_resolve_local(struct sockaddr *src_in,
struct net_device *dev; struct net_device *dev;
int ret; int ret;
if (dst_in->sa_family == AF_INET) { switch (dst_in->sa_family) {
case AF_INET:
{
__be32 src_ip = ((struct sockaddr_in *) src_in)->sin_addr.s_addr; __be32 src_ip = ((struct sockaddr_in *) src_in)->sin_addr.s_addr;
__be32 dst_ip = ((struct sockaddr_in *) dst_in)->sin_addr.s_addr; __be32 dst_ip = ((struct sockaddr_in *) dst_in)->sin_addr.s_addr;
...@@ -362,7 +383,12 @@ static int addr_resolve_local(struct sockaddr *src_in, ...@@ -362,7 +383,12 @@ static int addr_resolve_local(struct sockaddr *src_in,
memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN); memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN);
} }
dev_put(dev); dev_put(dev);
} else { break;
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case AF_INET6:
{
struct in6_addr *a; struct in6_addr *a;
for_each_netdev(&init_net, dev) for_each_netdev(&init_net, dev)
...@@ -390,6 +416,13 @@ static int addr_resolve_local(struct sockaddr *src_in, ...@@ -390,6 +416,13 @@ static int addr_resolve_local(struct sockaddr *src_in,
if (!ret) if (!ret)
memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN); memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN);
} }
break;
}
#endif
default:
ret = -EADDRNOTAVAIL;
break;
} }
return ret; return ret;
......
...@@ -699,7 +699,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq, ...@@ -699,7 +699,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
} }
wc->slid = be16_to_cpu(cqe->rlid); wc->slid = be16_to_cpu(cqe->rlid);
wc->sl = be16_to_cpu(cqe->sl_vid >> 12); wc->sl = be16_to_cpu(cqe->sl_vid) >> 12;
g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn);
wc->src_qp = g_mlpath_rqpn & 0xffffff; wc->src_qp = g_mlpath_rqpn & 0xffffff;
wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f; wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册