aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 20:45:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 20:45:28 -0500
commit6094c85a935f7eadb4c607c6dc6d86c0a9f09a4b (patch)
tree64798f350779f041812cb0265993907f972b5efa /drivers/infiniband
parent590cf28580c999c8ba70dc39b40bab09d69e2630 (diff)
parentee48c3d7d3afab7b582051ee8f3f8979e6a87766 (diff)
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
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/Kconfig1
-rw-r--r--drivers/infiniband/core/addr.c47
-rw-r--r--drivers/infiniband/hw/mlx4/cq.c2
3 files changed, 42 insertions, 8 deletions
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig
index a5dc78ae62d4..dd0db67bf8d7 100644
--- a/drivers/infiniband/Kconfig
+++ b/drivers/infiniband/Kconfig
@@ -37,6 +37,7 @@ config INFINIBAND_USER_MEM
37config INFINIBAND_ADDR_TRANS 37config INFINIBAND_ADDR_TRANS
38 bool 38 bool
39 depends on INET 39 depends on INET
40 depends on !(INFINIBAND = y && IPV6 = m)
40 default y 41 default y
41 42
42source "drivers/infiniband/hw/mthca/Kconfig" 43source "drivers/infiniband/hw/mthca/Kconfig"
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index d98b05b28262..ce511d8748ce 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -128,6 +128,8 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
128 ret = rdma_copy_addr(dev_addr, dev, NULL); 128 ret = rdma_copy_addr(dev_addr, dev, NULL);
129 dev_put(dev); 129 dev_put(dev);
130 break; 130 break;
131
132#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
131 case AF_INET6: 133 case AF_INET6:
132 for_each_netdev(&init_net, dev) { 134 for_each_netdev(&init_net, dev) {
133 if (ipv6_chk_addr(&init_net, 135 if (ipv6_chk_addr(&init_net,
@@ -138,8 +140,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
138 } 140 }
139 } 141 }
140 break; 142 break;
141 default: 143#endif
142 break;
143 } 144 }
144 return ret; 145 return ret;
145} 146}
@@ -179,10 +180,11 @@ static void addr_send_arp(struct sockaddr *dst_in)
179{ 180{
180 struct rtable *rt; 181 struct rtable *rt;
181 struct flowi fl; 182 struct flowi fl;
182 struct dst_entry *dst;
183 183
184 memset(&fl, 0, sizeof fl); 184 memset(&fl, 0, sizeof fl);
185 if (dst_in->sa_family == AF_INET) { 185
186 switch (dst_in->sa_family) {
187 case AF_INET:
186 fl.nl_u.ip4_u.daddr = 188 fl.nl_u.ip4_u.daddr =
187 ((struct sockaddr_in *) dst_in)->sin_addr.s_addr; 189 ((struct sockaddr_in *) dst_in)->sin_addr.s_addr;
188 190
@@ -191,8 +193,13 @@ static void addr_send_arp(struct sockaddr *dst_in)
191 193
192 neigh_event_send(rt->u.dst.neighbour, NULL); 194 neigh_event_send(rt->u.dst.neighbour, NULL);
193 ip_rt_put(rt); 195 ip_rt_put(rt);
196 break;
197
198#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
199 case AF_INET6:
200 {
201 struct dst_entry *dst;
194 202
195 } else {
196 fl.nl_u.ip6_u.daddr = 203 fl.nl_u.ip6_u.daddr =
197 ((struct sockaddr_in6 *) dst_in)->sin6_addr; 204 ((struct sockaddr_in6 *) dst_in)->sin6_addr;
198 205
@@ -202,6 +209,9 @@ static void addr_send_arp(struct sockaddr *dst_in)
202 209
203 neigh_event_send(dst->neighbour, NULL); 210 neigh_event_send(dst->neighbour, NULL);
204 dst_release(dst); 211 dst_release(dst);
212 break;
213 }
214#endif
205 } 215 }
206} 216}
207 217
@@ -254,6 +264,7 @@ out:
254 return ret; 264 return ret;
255} 265}
256 266
267#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
257static int addr6_resolve_remote(struct sockaddr_in6 *src_in, 268static int addr6_resolve_remote(struct sockaddr_in6 *src_in,
258 struct sockaddr_in6 *dst_in, 269 struct sockaddr_in6 *dst_in,
259 struct rdma_dev_addr *addr) 270 struct rdma_dev_addr *addr)
@@ -282,6 +293,14 @@ static int addr6_resolve_remote(struct sockaddr_in6 *src_in,
282 dst_release(dst); 293 dst_release(dst);
283 return ret; 294 return ret;
284} 295}
296#else
297static int addr6_resolve_remote(struct sockaddr_in6 *src_in,
298 struct sockaddr_in6 *dst_in,
299 struct rdma_dev_addr *addr)
300{
301 return -EADDRNOTAVAIL;
302}
303#endif
285 304
286static int addr_resolve_remote(struct sockaddr *src_in, 305static int addr_resolve_remote(struct sockaddr *src_in,
287 struct sockaddr *dst_in, 306 struct sockaddr *dst_in,
@@ -340,7 +359,9 @@ static int addr_resolve_local(struct sockaddr *src_in,
340 struct net_device *dev; 359 struct net_device *dev;
341 int ret; 360 int ret;
342 361
343 if (dst_in->sa_family == AF_INET) { 362 switch (dst_in->sa_family) {
363 case AF_INET:
364 {
344 __be32 src_ip = ((struct sockaddr_in *) src_in)->sin_addr.s_addr; 365 __be32 src_ip = ((struct sockaddr_in *) src_in)->sin_addr.s_addr;
345 __be32 dst_ip = ((struct sockaddr_in *) dst_in)->sin_addr.s_addr; 366 __be32 dst_ip = ((struct sockaddr_in *) dst_in)->sin_addr.s_addr;
346 367
@@ -362,7 +383,12 @@ static int addr_resolve_local(struct sockaddr *src_in,
362 memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN); 383 memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN);
363 } 384 }
364 dev_put(dev); 385 dev_put(dev);
365 } else { 386 break;
387 }
388
389#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
390 case AF_INET6:
391 {
366 struct in6_addr *a; 392 struct in6_addr *a;
367 393
368 for_each_netdev(&init_net, dev) 394 for_each_netdev(&init_net, dev)
@@ -390,6 +416,13 @@ static int addr_resolve_local(struct sockaddr *src_in,
390 if (!ret) 416 if (!ret)
391 memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN); 417 memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN);
392 } 418 }
419 break;
420 }
421#endif
422
423 default:
424 ret = -EADDRNOTAVAIL;
425 break;
393 } 426 }
394 427
395 return ret; 428 return ret;
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 8415ecce5c4c..a3c5af1d7ec0 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -699,7 +699,7 @@ repoll:
699 } 699 }
700 700
701 wc->slid = be16_to_cpu(cqe->rlid); 701 wc->slid = be16_to_cpu(cqe->rlid);
702 wc->sl = be16_to_cpu(cqe->sl_vid >> 12); 702 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12;
703 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); 703 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn);
704 wc->src_qp = g_mlpath_rqpn & 0xffffff; 704 wc->src_qp = g_mlpath_rqpn & 0xffffff;
705 wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f; 705 wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f;