diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-08 17:05:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-08 17:05:48 -0500 |
commit | 48fa57ac2c30a8a0b770b7ad50b4b30c1d12f005 (patch) | |
tree | 5a0b1a32b2e1639fdd07e9f1b946d698c093c3da /drivers/infiniband/core | |
parent | 8e369672af8700299ab372bad9397f230b1d591a (diff) | |
parent | 1583676d9e3f97371eaa726c4e061f9b23f43c44 (diff) |
Merge tag 'infiniband-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
infiniband changes for 3.3 merge window
* tag 'infiniband-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
rdma/core: Fix sparse warnings
RDMA/cma: Fix endianness bugs
RDMA/nes: Fix terminate during AE
RDMA/nes: Make unnecessarily global nes_set_pau() static
RDMA/nes: Change MDIO bus clock to 2.5MHz
IB/cm: Fix layout of APR message
IB/mlx4: Fix SL to 802.1Q priority-bits mapping for IBoE
IB/qib: Default some module parameters optimally
IB/qib: Optimize locking for get_txreq()
IB/qib: Fix a possible data corruption when receiving packets
IB/qib: Eliminate 64-bit jiffies use
IB/qib: Fix style issues
IB/uverbs: Protect QP multicast list
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r-- | drivers/infiniband/core/cm_msgs.h | 1 | ||||
-rw-r--r-- | drivers/infiniband/core/cma.c | 6 | ||||
-rw-r--r-- | drivers/infiniband/core/ucm.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/core/uverbs_cmd.c | 27 |
4 files changed, 24 insertions, 13 deletions
diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h index 505db2a59e7..7da9b210234 100644 --- a/drivers/infiniband/core/cm_msgs.h +++ b/drivers/infiniband/core/cm_msgs.h | |||
@@ -799,6 +799,7 @@ struct cm_apr_msg { | |||
799 | 799 | ||
800 | u8 info_length; | 800 | u8 info_length; |
801 | u8 ap_status; | 801 | u8 ap_status; |
802 | __be16 rsvd; | ||
802 | u8 info[IB_CM_APR_INFO_LENGTH]; | 803 | u8 info[IB_CM_APR_INFO_LENGTH]; |
803 | 804 | ||
804 | u8 private_data[IB_CM_APR_PRIVATE_DATA_SIZE]; | 805 | u8 private_data[IB_CM_APR_PRIVATE_DATA_SIZE]; |
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 236a88c1ca8..e3e470fecaa 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -1110,7 +1110,7 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id, | |||
1110 | if (cma_any_addr((struct sockaddr *) &rt->addr.src_addr)) { | 1110 | if (cma_any_addr((struct sockaddr *) &rt->addr.src_addr)) { |
1111 | rt->addr.dev_addr.dev_type = ARPHRD_INFINIBAND; | 1111 | rt->addr.dev_addr.dev_type = ARPHRD_INFINIBAND; |
1112 | rdma_addr_set_sgid(&rt->addr.dev_addr, &rt->path_rec[0].sgid); | 1112 | rdma_addr_set_sgid(&rt->addr.dev_addr, &rt->path_rec[0].sgid); |
1113 | ib_addr_set_pkey(&rt->addr.dev_addr, rt->path_rec[0].pkey); | 1113 | ib_addr_set_pkey(&rt->addr.dev_addr, be16_to_cpu(rt->path_rec[0].pkey)); |
1114 | } else { | 1114 | } else { |
1115 | ret = rdma_translate_ip((struct sockaddr *) &rt->addr.src_addr, | 1115 | ret = rdma_translate_ip((struct sockaddr *) &rt->addr.src_addr, |
1116 | &rt->addr.dev_addr); | 1116 | &rt->addr.dev_addr); |
@@ -2926,7 +2926,7 @@ static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast) | |||
2926 | mutex_lock(&id_priv->qp_mutex); | 2926 | mutex_lock(&id_priv->qp_mutex); |
2927 | if (!status && id_priv->id.qp) | 2927 | if (!status && id_priv->id.qp) |
2928 | status = ib_attach_mcast(id_priv->id.qp, &multicast->rec.mgid, | 2928 | status = ib_attach_mcast(id_priv->id.qp, &multicast->rec.mgid, |
2929 | multicast->rec.mlid); | 2929 | be16_to_cpu(multicast->rec.mlid)); |
2930 | mutex_unlock(&id_priv->qp_mutex); | 2930 | mutex_unlock(&id_priv->qp_mutex); |
2931 | 2931 | ||
2932 | memset(&event, 0, sizeof event); | 2932 | memset(&event, 0, sizeof event); |
@@ -3187,7 +3187,7 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr) | |||
3187 | if (id->qp) | 3187 | if (id->qp) |
3188 | ib_detach_mcast(id->qp, | 3188 | ib_detach_mcast(id->qp, |
3189 | &mc->multicast.ib->rec.mgid, | 3189 | &mc->multicast.ib->rec.mgid, |
3190 | mc->multicast.ib->rec.mlid); | 3190 | be16_to_cpu(mc->multicast.ib->rec.mlid)); |
3191 | if (rdma_node_get_transport(id_priv->cma_dev->device->node_type) == RDMA_TRANSPORT_IB) { | 3191 | if (rdma_node_get_transport(id_priv->cma_dev->device->node_type) == RDMA_TRANSPORT_IB) { |
3192 | switch (rdma_port_get_link_layer(id->device, id->port_num)) { | 3192 | switch (rdma_port_get_link_layer(id->device, id->port_num)) { |
3193 | case IB_LINK_LAYER_INFINIBAND: | 3193 | case IB_LINK_LAYER_INFINIBAND: |
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c index b8a0b4a7811..06f08713f48 100644 --- a/drivers/infiniband/core/ucm.c +++ b/drivers/infiniband/core/ucm.c | |||
@@ -106,9 +106,6 @@ enum { | |||
106 | IB_UCM_MAX_DEVICES = 32 | 106 | IB_UCM_MAX_DEVICES = 32 |
107 | }; | 107 | }; |
108 | 108 | ||
109 | /* ib_cm and ib_user_cm modules share /sys/class/infiniband_cm */ | ||
110 | extern struct class cm_class; | ||
111 | |||
112 | #define IB_UCM_BASE_DEV MKDEV(IB_UCM_MAJOR, IB_UCM_BASE_MINOR) | 109 | #define IB_UCM_BASE_DEV MKDEV(IB_UCM_MAJOR, IB_UCM_BASE_MINOR) |
113 | 110 | ||
114 | static void ib_ucm_add_one(struct ib_device *device); | 111 | static void ib_ucm_add_one(struct ib_device *device); |
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 254f1649c73..b930da4c0c6 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c | |||
@@ -241,11 +241,24 @@ static struct ib_qp *idr_read_qp(int qp_handle, struct ib_ucontext *context) | |||
241 | return idr_read_obj(&ib_uverbs_qp_idr, qp_handle, context, 0); | 241 | return idr_read_obj(&ib_uverbs_qp_idr, qp_handle, context, 0); |
242 | } | 242 | } |
243 | 243 | ||
244 | static struct ib_qp *idr_write_qp(int qp_handle, struct ib_ucontext *context) | ||
245 | { | ||
246 | struct ib_uobject *uobj; | ||
247 | |||
248 | uobj = idr_write_uobj(&ib_uverbs_qp_idr, qp_handle, context); | ||
249 | return uobj ? uobj->object : NULL; | ||
250 | } | ||
251 | |||
244 | static void put_qp_read(struct ib_qp *qp) | 252 | static void put_qp_read(struct ib_qp *qp) |
245 | { | 253 | { |
246 | put_uobj_read(qp->uobject); | 254 | put_uobj_read(qp->uobject); |
247 | } | 255 | } |
248 | 256 | ||
257 | static void put_qp_write(struct ib_qp *qp) | ||
258 | { | ||
259 | put_uobj_write(qp->uobject); | ||
260 | } | ||
261 | |||
249 | static struct ib_srq *idr_read_srq(int srq_handle, struct ib_ucontext *context) | 262 | static struct ib_srq *idr_read_srq(int srq_handle, struct ib_ucontext *context) |
250 | { | 263 | { |
251 | return idr_read_obj(&ib_uverbs_srq_idr, srq_handle, context, 0); | 264 | return idr_read_obj(&ib_uverbs_srq_idr, srq_handle, context, 0); |
@@ -2375,7 +2388,7 @@ ssize_t ib_uverbs_attach_mcast(struct ib_uverbs_file *file, | |||
2375 | if (copy_from_user(&cmd, buf, sizeof cmd)) | 2388 | if (copy_from_user(&cmd, buf, sizeof cmd)) |
2376 | return -EFAULT; | 2389 | return -EFAULT; |
2377 | 2390 | ||
2378 | qp = idr_read_qp(cmd.qp_handle, file->ucontext); | 2391 | qp = idr_write_qp(cmd.qp_handle, file->ucontext); |
2379 | if (!qp) | 2392 | if (!qp) |
2380 | return -EINVAL; | 2393 | return -EINVAL; |
2381 | 2394 | ||
@@ -2404,7 +2417,7 @@ ssize_t ib_uverbs_attach_mcast(struct ib_uverbs_file *file, | |||
2404 | kfree(mcast); | 2417 | kfree(mcast); |
2405 | 2418 | ||
2406 | out_put: | 2419 | out_put: |
2407 | put_qp_read(qp); | 2420 | put_qp_write(qp); |
2408 | 2421 | ||
2409 | return ret ? ret : in_len; | 2422 | return ret ? ret : in_len; |
2410 | } | 2423 | } |
@@ -2422,7 +2435,7 @@ ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file, | |||
2422 | if (copy_from_user(&cmd, buf, sizeof cmd)) | 2435 | if (copy_from_user(&cmd, buf, sizeof cmd)) |
2423 | return -EFAULT; | 2436 | return -EFAULT; |
2424 | 2437 | ||
2425 | qp = idr_read_qp(cmd.qp_handle, file->ucontext); | 2438 | qp = idr_write_qp(cmd.qp_handle, file->ucontext); |
2426 | if (!qp) | 2439 | if (!qp) |
2427 | return -EINVAL; | 2440 | return -EINVAL; |
2428 | 2441 | ||
@@ -2441,14 +2454,14 @@ ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file, | |||
2441 | } | 2454 | } |
2442 | 2455 | ||
2443 | out_put: | 2456 | out_put: |
2444 | put_qp_read(qp); | 2457 | put_qp_write(qp); |
2445 | 2458 | ||
2446 | return ret ? ret : in_len; | 2459 | return ret ? ret : in_len; |
2447 | } | 2460 | } |
2448 | 2461 | ||
2449 | int __uverbs_create_xsrq(struct ib_uverbs_file *file, | 2462 | static int __uverbs_create_xsrq(struct ib_uverbs_file *file, |
2450 | struct ib_uverbs_create_xsrq *cmd, | 2463 | struct ib_uverbs_create_xsrq *cmd, |
2451 | struct ib_udata *udata) | 2464 | struct ib_udata *udata) |
2452 | { | 2465 | { |
2453 | struct ib_uverbs_create_srq_resp resp; | 2466 | struct ib_uverbs_create_srq_resp resp; |
2454 | struct ib_usrq_object *obj; | 2467 | struct ib_usrq_object *obj; |