aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_main.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2005-10-14 18:26:04 -0400
committerRoland Dreier <rolandd@cisco.com>2005-10-17 18:20:31 -0400
commit67cdb40ca444c09853ab4d8a41cf547ac26a4de4 (patch)
treefc0ecdf4e2c39db11849c79c594711c9e8e76a13 /drivers/infiniband/core/uverbs_main.c
parent91ecd4ae178bed83da4f6a94ced7992e4d7711eb (diff)
[IB] uverbs: Implement more commands
Add kernel support for userspace calling poll CQ, request CQ notification, post send, post receive, post SRQ receive, create AH and destroy AH commands. These commands allow us to support userspace verbs for devices that can't perform these operations directly from userspace (eg the PathScale HCA). Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_main.c')
-rw-r--r--drivers/infiniband/core/uverbs_main.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 6a5e5084db7..ef2312a9ea7 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -3,6 +3,7 @@
3 * Copyright (c) 2005 Cisco Systems. All rights reserved. 3 * Copyright (c) 2005 Cisco Systems. All rights reserved.
4 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 4 * Copyright (c) 2005 Mellanox Technologies. All rights reserved.
5 * Copyright (c) 2005 Voltaire, Inc. All rights reserved. 5 * Copyright (c) 2005 Voltaire, Inc. All rights reserved.
6 * Copyright (c) 2005 PathScale, Inc. All rights reserved.
6 * 7 *
7 * This software is available to you under a choice of one of two 8 * This software is available to you under a choice of one of two
8 * licenses. You may choose to be licensed under the terms of the GNU 9 * licenses. You may choose to be licensed under the terms of the GNU
@@ -86,10 +87,17 @@ static ssize_t (*uverbs_cmd_table[])(struct ib_uverbs_file *file,
86 [IB_USER_VERBS_CMD_DEREG_MR] = ib_uverbs_dereg_mr, 87 [IB_USER_VERBS_CMD_DEREG_MR] = ib_uverbs_dereg_mr,
87 [IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL] = ib_uverbs_create_comp_channel, 88 [IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL] = ib_uverbs_create_comp_channel,
88 [IB_USER_VERBS_CMD_CREATE_CQ] = ib_uverbs_create_cq, 89 [IB_USER_VERBS_CMD_CREATE_CQ] = ib_uverbs_create_cq,
90 [IB_USER_VERBS_CMD_POLL_CQ] = ib_uverbs_poll_cq,
91 [IB_USER_VERBS_CMD_REQ_NOTIFY_CQ] = ib_uverbs_req_notify_cq,
89 [IB_USER_VERBS_CMD_DESTROY_CQ] = ib_uverbs_destroy_cq, 92 [IB_USER_VERBS_CMD_DESTROY_CQ] = ib_uverbs_destroy_cq,
90 [IB_USER_VERBS_CMD_CREATE_QP] = ib_uverbs_create_qp, 93 [IB_USER_VERBS_CMD_CREATE_QP] = ib_uverbs_create_qp,
91 [IB_USER_VERBS_CMD_MODIFY_QP] = ib_uverbs_modify_qp, 94 [IB_USER_VERBS_CMD_MODIFY_QP] = ib_uverbs_modify_qp,
92 [IB_USER_VERBS_CMD_DESTROY_QP] = ib_uverbs_destroy_qp, 95 [IB_USER_VERBS_CMD_DESTROY_QP] = ib_uverbs_destroy_qp,
96 [IB_USER_VERBS_CMD_POST_SEND] = ib_uverbs_post_send,
97 [IB_USER_VERBS_CMD_POST_RECV] = ib_uverbs_post_recv,
98 [IB_USER_VERBS_CMD_POST_SRQ_RECV] = ib_uverbs_post_srq_recv,
99 [IB_USER_VERBS_CMD_CREATE_AH] = ib_uverbs_create_ah,
100 [IB_USER_VERBS_CMD_DESTROY_AH] = ib_uverbs_destroy_ah,
93 [IB_USER_VERBS_CMD_ATTACH_MCAST] = ib_uverbs_attach_mcast, 101 [IB_USER_VERBS_CMD_ATTACH_MCAST] = ib_uverbs_attach_mcast,
94 [IB_USER_VERBS_CMD_DETACH_MCAST] = ib_uverbs_detach_mcast, 102 [IB_USER_VERBS_CMD_DETACH_MCAST] = ib_uverbs_detach_mcast,
95 [IB_USER_VERBS_CMD_CREATE_SRQ] = ib_uverbs_create_srq, 103 [IB_USER_VERBS_CMD_CREATE_SRQ] = ib_uverbs_create_srq,
@@ -111,7 +119,13 @@ static int ib_dealloc_ucontext(struct ib_ucontext *context)
111 119
112 down(&ib_uverbs_idr_mutex); 120 down(&ib_uverbs_idr_mutex);
113 121
114 /* XXX Free AHs */ 122 list_for_each_entry_safe(uobj, tmp, &context->ah_list, list) {
123 struct ib_ah *ah = idr_find(&ib_uverbs_ah_idr, uobj->id);
124 idr_remove(&ib_uverbs_ah_idr, uobj->id);
125 ib_destroy_ah(ah);
126 list_del(&uobj->list);
127 kfree(uobj);
128 }
115 129
116 list_for_each_entry_safe(uobj, tmp, &context->qp_list, list) { 130 list_for_each_entry_safe(uobj, tmp, &context->qp_list, list) {
117 struct ib_qp *qp = idr_find(&ib_uverbs_qp_idr, uobj->id); 131 struct ib_qp *qp = idr_find(&ib_uverbs_qp_idr, uobj->id);