summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/uverbs_main.c
AgeCommit message (Collapse)Author
2006-01-17IB/uverbs: Flush scheduled work before unloading moduleMichael S. Tsirkin
uverbs might schedule work to clean up when a file is closed. Make sure that this work runs before allowing module text to go away. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-01-13IB: convert from semaphores to mutexesIngo Molnar
semaphore to mutex conversion by Ingo and Arjan's script. Signed-off-by: Ingo Molnar <mingo@elte.hu> [ Sanity-checked on real IB hardware ] Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-11-29IB/uverbs: track multicast group membership for userspace QPsJack Morgenstein
uverbs needs to track which multicast groups is each qp attached to, in order to properly detach when cleanup is performed on device file close. Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-11-02[IB] kzalloc() conversionsRoland Dreier
Replace kmalloc()+memset(,0,) with kzalloc(), for a net savings of 35 source lines and about 500 bytes of text. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-10-31[IB] uverbs: Avoid NULL pointer deref on CQ async eventRoland Dreier
Userspace CQs that have no completion event channel attached end up with their cq_context set to NULL. However, asynchronous events like "CQ overrun" can still occur on such CQs, so add a uverbs_file member to struct ib_ucq_object that we can follow to deliver these events. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-10-28[IB] fix up class_device_create() callsRoland Dreier
Fix class_device_create() calls to match the new prototype which takes a parent device pointer. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-10-28[IB] uverbs: Fix device lifetime problemsRoland Dreier
Move ib_uverbs module to using cdev_alloc() and class_device_create() so that we can handle device lifetime properly. Now we can make sure we keep all of our data structures around until the last way to reach them is gone. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-10-24Manual merge of for-linus to upstream (fix conflicts in ↵Roland Dreier
drivers/infiniband/core/ucm.c)
2005-10-24[IB] Add idr_destroy() calls on module unloadRoland Dreier
Add idr_destroy() calls to the module_exit() functions of the four IB driver modules that use idrs, so we don't leak idr_layer_cache objects when these modules are unloaded. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-10-17[IB] uverbs: Implement more commandsRoland Dreier
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>
2005-10-17[IB] uverbs: Add a mask of device methods allowed for userspaceRoland Dreier
Give each device a uverbs_cmd_mask, so that a low-level driver can control which methods may be called on behalf of userspace. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-10-17[IB] uverbs: unlock correctly in error pathsRoland Dreier
A couple of functions were missing spin_unlock calls in error paths. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-10-17[IB] uverbs: Add device-specific ABI version attributeRoland Dreier
Add abi_version attribute to uverbs class devices to allow for ABI versioning of device-specific interfaces. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-10-17[IB] uverbs: ABI-breaking fixes for userspace verbsRoland Dreier
Introduce new userspace verbs ABI version 3. This eliminates some unneeded commands, and adds support for user-created completion channels. This cleans up problems with file leaks on error paths, and also makes sure that file descriptors are always installed into the correct process. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-09-26[IB] uverbs: Close some exploitable racesRoland Dreier
Al Viro pointed out that the current IB userspace verbs interface allows userspace to cause mischief by closing file descriptors before we're ready, or issuing the same command twice at the same time. This patch closes those races, and fixes other obvious problems such as a module reference leak. Some other interface bogosities will require an ABI change to fix properly, so I'm deferring those fixes until 2.6.15. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-09-09Make sure that userspace does not retrieve stale asynchronous orRoland Dreier
completion events after destroying a CQ, QP or SRQ. We do this by sweeping the event lists before returning from a destroy calls, and then return the number of events already reported before the destroy call. This allows userspace wait until it has processed all events for an object returned from the kernel before it frees its context for the object. The ABI of the destroy CQ, destroy QP and destroy SRQ commands has to change to return the event count, so bump the ABI version from 1 to 2. The userspace libibverbs library has already been updated to handle both the old and new ABI versions. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-08-26[PATCH] IB: userspace SRQ supportRoland Dreier
Add SRQ support to userspace verbs module. This adds several commands and associated structures, but it's OK to do this without bumping the ABI version because the commands are added at the end of the list so they don't change the existing numbering. There are two cases to worry about: 1. New kernel, old userspace. This is OK because old userspace simply won't try to use the new SRQ commands. None of the old commands are changed. 2. Old kernel, new userspace. This works perfectly as long as userspace doesn't try to use SRQ commands. If userspace tries to use SRQ commands, it will get EINVAL, which is perfectly reasonable: the kernel doesn't support SRQs, so we couldn't do any better. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-08-26[PATCH] IB: Add copyright noticesRoland Dreier
Make some lawyers happy and add copyright notices for people who forgot to include them when they actually touched the code. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-08-26[PATCH] IB: fix use-after-free in user verbs cleanupRoland Dreier
Fix a use-after-free bug in userspace verbs cleanup: we can't touch mr->device after we free mr by calling ib_dereg_mr(). Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-27[IB/uverbs]: Add O_ASYNC supportGleb Natapov
Add support for O_ASYNC notifications on userspace verbs completion and asynchronous event file descriptors. Signed-off-by: Gleb Natapov <glebn@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2005-07-07[PATCH] IB uverbs: core implementationRoland Dreier
Add the core of the InfiniBand userspace verbs implementation, including creating character device nodes, dispatching requests from userspace, and passing event notifications back up to userspace. Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>