Roland Dreier [Thu, 11 Jan 2007 21:19:01 +0000 (13:19 -0800)]
Don't use d_type member of struct dirent
On some filesystems (notably reiserfs), dent->d_type is always
DT_UNKNOWN. Therefore libibverbs should use stat() to check file
types when scanning through directories rather than relying on the
d_type returned from readdir().
Roland Dreier [Thu, 11 Jan 2007 15:19:49 +0000 (07:19 -0800)]
Revert "Pass driver data through ibv_cmd_req_notify_cq()"
This reverts commit d5b9ab3d7009b77ee45e98827e803205d322ce7d, since
the Chelsio cxgb3 driver no longer needs it and the kernel side of
req_notify_cq() doesn't handle user data anyway.
Roland Dreier [Mon, 11 Dec 2006 01:34:18 +0000 (17:34 -0800)]
Implement new method for finding and loading device-specific drivers
Export an ibv_register_driver() entry point, and expect plugins to
call it from __attribute__((constructor)) code. This will allow
multiple drivers to be statically linked in.
Also read config files and then use dlopen() with a relative path to
find drivers (rather than searching a specific lib/infiniband/
directory for .so files). This allows multiple versions of a driver
to be installed in parallel, and also allows for optimized drivers in
places like /lib/i686.
Drivers should no longer export an ibv_driver_init() function any
more. Instead, they should add a function (which can be static) with
__attribute__((constructor)) that calls ibv_register_driver() to
register the driver's probe function. Also, drivers should install a
file with a line "driver <driver name>" under ${sysconfdir}/libibverbs.d.
Steve Wise [Thu, 5 Oct 2006 17:37:35 +0000 (12:37 -0500)]
Support provider response data in reg_mr command
Allow kernel register MR command to pass back driver-specific data to
the userspace driver. The code is there to do this in the kernel, but
not in the libibverbs cmd interface.
Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Steve Wise [Thu, 16 Nov 2006 20:06:14 +0000 (14:06 -0600)]
Add async_event callback function to struct ibv_context_ops
Add a callback function so low-level driver libraries can get a
callback with each async event retrieved by the user. It allows the
bypass library to do WQ or CQ processing that needs to happen when a
fatal async event happens. This async callback is similar to the
cq_event callback that already exists in libibverbs.
Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Jack Morgenstein [Tue, 31 Oct 2006 05:30:54 +0000 (05:30 +0000)]
Return sq_draining properly from query_qp
Return the sq_draining value back to user space for query_qp instead
of the en_sqd_async notify value. This last is valid only for
modify_qp. For query_qp (according to the IB Spec V1.2), the draining
status should returned.
Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Roland Dreier [Wed, 4 Oct 2006 23:57:10 +0000 (23:57 +0000)]
Add Valgrind annotations
Add basic Valgrind annotations to libibverbs (disabled by default, can
be enabled by configuring with --with-valgrind). These reduce false
positive warnings from the Valgrind memcheck module.
Based on work and suggestions from Rainer Keller <keller@hlrs.de> and
Jeff Squyres <jsquyres@cisco.com>.
Ralph Campbell [Wed, 23 Aug 2006 22:01:20 +0000 (22:01 +0000)]
Add response handling to ibv_cmd_resize_cq()
Add resp and resp_size parameters to ibv_cmd_resize_cq() so that the
low-level driver in the kernel can return device-specific information
from the resize CQ operation.
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
While comma at end of enumerator list is legal since 1999, some tools
(notably gcc versions pre-4.0) seem to default to 1989 mode when
running with -pedantic flag, and warn about this usage.
Since most of our enums in header files do not have comma at end, its
probably easier to fix the remaining two cases than educate all users
of libibverbs on virtues of C99.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Roland Dreier [Tue, 11 Apr 2006 23:27:38 +0000 (23:27 +0000)]
Reduce dependency on libsysfs
Reduce libibverbs dependency on libsysfs by using local functions for
internal sysfs access. libsysfs is still required because of the ABI,
which passes a struct sysfs_class_device * to low-level driver init
functions.
Roland Dreier [Tue, 14 Mar 2006 00:24:55 +0000 (00:24 +0000)]
Use sysfs_open_attribute() and sysfs_read_attribute()
Use sysfs_open_attribute() and sysfs_read_attribute() instead of the
deprecated function sysfs_read_attribute_value(), which is no longer
present in libsysfs2 (which is already in Debian and Ubuntu).
Roland Dreier [Wed, 15 Feb 2006 22:48:01 +0000 (22:48 +0000)]
Add response handling to ibv_cmd_create_qp()
Add resp and resp_size parameters to libibverbs's ibv_cmd_create_qp()
function so that kernel low-level drivers can return private data to
userspace device drivers.
Dotan Barak [Tue, 14 Feb 2006 05:43:28 +0000 (05:43 +0000)]
Report board_id from ibv_devinfo, if present
Signed-off-by: Dotan Barak <dotanb@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Dotan Barak [Mon, 23 Jan 2006 05:07:09 +0000 (05:07 +0000)]
List all devices in ibv_devinfo
Make ibv_devinfo list all IB devices by default, rather than the first
device only.
Signed-off-by: Dotan Barak <dotanb@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Ralph Campbell [Tue, 17 Jan 2006 17:20:37 +0000 (17:20 +0000)]
Arm CQ early enough in pingpong examples
The example pingpong programs have a race when using events where the
client sends the first packet but the server hasn't yet armed the CQ
by calling ibv_req_notify_cq() thus waiting forever in
ibv_get_cq_event(). The fix is to move the call to
ibv_req_notify_cq() before signaling the client to "start".
Signed-off-by: Ralph Campbell <ralphc@pathscale.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Shirley Ma [Thu, 15 Dec 2005 21:25:33 +0000 (21:25 +0000)]
Handle devices that don't support SRQ
create_srq is not a mandatory device function, therefore in
userspace/libibverbs/src/verbs.c ibv_create_srq should check
create_srq() first before calling it, otherwise the caller will cause
the segmentation fault on device which doesn't support SRQs.
Signed-off-by: Shirley Ma <xma@us.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>