]> git.openfabrics.org - ~shefty/libibverbs.git/log
~shefty/libibverbs.git
12 years agoAllow 3rd party extensions to verb routines
Sean Hefty [Thu, 22 Dec 2011 08:07:51 +0000 (00:07 -0800)]
Allow 3rd party extensions to verb routines

In order to support OFED, vendor specific calls, or new ibverbs
operations, define a generic extension mechanism.  This allows
OFED, an RDMA vendor, or another registered 3rd party (for
example, the librdmacm) to define RDMA extensions, plus provides
a backwards compatible way to add new features to ibverbs.

Users which make use extensions are aware that they are not
only using an extended call, but are given information regarding
how widely the extension by be supported based on the name of the
extension.  E.g. a VENDOR extension is specific to a vendor, whereas
an OFA extension is standardized within an organization.
Support for extended functions, data structures, and enums are defined.

Extensions are referenced by name.  There is an assumption that
extension names are prefixed relative to the supporting party.
Until an extension has been incorporated into libibverbs, it
should be defined in an appropriate external header file.

Driver libraries that support extensions are given a new
registration call, ibv_register_device_ext().  Use of this call
indicates to libibverbs that the library allocates extended
versions of struct ibv_device and struct ibv_context.

The following new APIs are added to libibverbs to applications
to use to determine if an extension is supported and to obtain the
extended function calls.

ibv_have_ext_ops - returns true if an extension is supported
ibv_get_device_ext_ops - return extended operations for a device
ibv_get_ext_ops - return extended operations for an open context

To maintain backwards compatibility with existing applications,
internally, the library uses the last byte of the device name
to record if the device was registered with extension support.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
12 years agoFix memory leaks in various error flows
Dotan Barak [Mon, 14 Nov 2011 16:54:38 +0000 (08:54 -0800)]
Fix memory leaks in various error flows

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoAdd support to ibv_devinfo for displaying extended speeds
Marcel Apfelbaum [Mon, 3 Oct 2011 15:56:25 +0000 (18:56 +0300)]
Add support to ibv_devinfo for displaying extended speeds

Add code to ibv_devinfo to display the following new speeds:

    8:  FDR-10 is a proprietary link speed which is 10.3125 Gbps with 64b/66b
        encoding rather than 8b/10b encoding.
    16: FDR - 14.0625 Gbps
    32: EDR - 25.78125 Gbps

Signed-off-by: Marcel Apfelbaum <marcela@dev.mellanox.co.il>
Reviewed-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoDebian: Don't use brace expansion for {a,so} in libibverbs-dev.install
Roland Dreier [Fri, 11 Nov 2011 23:04:58 +0000 (15:04 -0800)]
Debian: Don't use brace expansion for {a,so} in libibverbs-dev.install

Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoMakefile.am: Fix an automake warning
Bart Van Assche [Sun, 7 Aug 2011 18:01:48 +0000 (18:01 +0000)]
Makefile.am: Fix an automake warning

Fix the following automake warning message:

    Makefile.am:1: `INCLUDES' is the old name for `AM_CPPFLAGS' (or `*_CPPFLAGS')

A quote from the automake manual:

    INCLUDES
        This does the same job as AM_CPPFLAGS (or any per-target _CPPFLAGS variable
        if it is used). It is an older name for the same functionality. This
        variable is deprecated; we suggest using AM_CPPFLAGS and per-target
        _CPPFLAGS instead.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
12 years agoAdd "foreign" option to AM_INIT_AUTOMAKE
Bart Van Assche [Sun, 7 Aug 2011 18:01:08 +0000 (18:01 +0000)]
Add "foreign" option to AM_INIT_AUTOMAKE

Switch to the modern form of the AM_INIT_AUTOMAKE macro and tell
automake that the libibverbs package does not follow the GNU
standards.  This change makes it possible to use 'autoreconf' for the
libibverbs package.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
12 years agoUpdate examples for IBoE
Or Gerlitz [Tue, 19 Jul 2011 09:31:32 +0000 (09:31 +0000)]
Update examples for IBoE

Since IBoE requires usage of GRH, update ibv_*_pinpong examples to
accept GIDs.  GIDs are given as an index to the local port's table and
are exchanged between the client and the server through the socket
connection.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.co.il>
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
12 years agoAdd GID change event
Or Gerlitz [Wed, 20 Jul 2011 19:38:58 +0000 (19:38 +0000)]
Add GID change event

Add handling for GID change events, which are generated by the kernel
IBoE stack when the HW driver updates the GID table.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.co.il>
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
12 years agoUpdate kernel API header to include link_layer
Or Gerlitz [Tue, 19 Jul 2011 09:28:42 +0000 (09:28 +0000)]
Update kernel API header to include link_layer

Modify the code to handle returning the link layer of a port from the
kernel to the library.  The kernel has done this since commit
2420b60b1dc4 ("IB/uverbs: Return link layer type to userspace for
query port operation"), merged in 2.6.37-rc1.

The new field does not change the size of struct ibv_query_port_resp
as it replaces a reserved field.  Binary compatibility between the
kernel to the library is kept, since old kernels running below new
library will not zero that field, so it will be read as "unspecified,"
while an old library running over new kernel will ignore the value
returned by the kernel.

The solution was suggested by Roland Dreier <roland@purestorage.com>
and Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.co.il>
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
12 years agoAdd link_layer field port attribute
Or Gerlitz [Wed, 20 Jul 2011 19:37:24 +0000 (19:37 +0000)]
Add link_layer field port attribute

The new field has three possible values: IBV_LINK_LAYER_UNSPECIFIED,
IBV_LINK_LAYER_INFINIBAND, IBV_LINK_LAYER_ETHERNET.  It can be used by
applications to know the link layer used by the port, which can be
either InfiniBand or Ethernet.

The addition of the new field does not change the size of struct
ibv_port_attr due to alignment of the preceding fields.  Binary
compatibility between the library to applications is kept, since old
apps running over new library do not read this field, and new apps
running over old library will determine the link layer as unspecified
and hence take their IB code path.

The solution was suggested by Roland Dreier <roland@purestorage.com>
and Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.co.il>
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
13 years agoUpdate Debian Standards-Version to 3.9.2
Roland Dreier [Thu, 30 Jun 2011 06:58:10 +0000 (23:58 -0700)]
Update Debian Standards-Version to 3.9.2

Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoDon't ship .la files in Debian libibverbs-dev
Roland Dreier [Thu, 30 Jun 2011 06:56:41 +0000 (23:56 -0700)]
Don't ship .la files in Debian libibverbs-dev

Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoPackage description shouldn't start with an article
Roland Dreier [Thu, 30 Jun 2011 06:44:12 +0000 (23:44 -0700)]
Package description shouldn't start with an article

Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agodebian/libibverbs1.postinst: Let debhelper code run in all cases
Julien BLACHE [Thu, 30 Jun 2011 04:42:06 +0000 (21:42 -0700)]
debian/libibverbs1.postinst: Let debhelper code run in all cases

Do not exit postinst if not configuring -- code added by debhelper needs
to run in all cases, not only the configure case.

Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoRoll libibverbs 1.1.5 release
Roland Dreier [Tue, 28 Jun 2011 20:55:55 +0000 (13:55 -0700)]
Roll libibverbs 1.1.5 release

Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoHandle huge pages in ibv_fork_init() and madvise tracking
Alexander Schmidt [Fri, 20 Aug 2010 09:06:16 +0000 (09:06 +0000)]
Handle huge pages in ibv_fork_init() and madvise tracking

When fork support is enabled in libibverbs, madvise() is called for
every memory page that is registered as a memory region.  Memory
ranges that are passed to madvise() must be page aligned and the size
must be a multiple of the page size.

libibverbs uses sysconf(_SC_PAGESIZE) to find out the system page size
and rounds all ranges passed to reg_mr() according to this page size.
When memory from libhugetlbfs is passed to reg_mr(), this does not
work as the page size for this memory range might be different
(e.g. 16MB).  So libibverbs would have to use the huge page size to
calculate a page aligned range for madvise.

As huge pages are provided to the application "under the hood" when
preloading libhugetlbfs, the application does not have any knowledge
about when it registers a huge page or a usual page.

To work around this issue, detect the use of huge pages in libibverbs
and align memory ranges passed to madvise according to the huge page
size.  Determining the page size of a given memory range by watching
madvise() fail has proven to be unreliable.  So we introduce the
RDMAV_HUGEPAGES_SAFE environment variable to let the user decide if
the page size should be checked on every reg_mr() call or not. This
requires the user to be aware if huge pages are used by the running
application or not.

I did not add an aditional API call to enable this, as applications
can use setenv() + ibv_fork_init() to enable checking for huge pages
in the code.

Signed-off-by: Alexander Schmidt <alexs@linux.vnet.ibm.com>
[ Updated ibv_fork_init() manpage for RDMAV_HUGEPAGES_SAFE.  - Roland ]

Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoSet DM-Upload-Allowed now that Roland is a Debian Maintainer
Roland Dreier [Tue, 28 Jun 2011 06:50:14 +0000 (23:50 -0700)]
Set DM-Upload-Allowed now that Roland is a Debian Maintainer

Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoFix date format in RPM spec file changelog
Dotan Barak [Wed, 15 Jun 2011 06:12:08 +0000 (06:12 +0000)]
Fix date format in RPM spec file changelog

Signed-off-by: Dotan Barak <dotan@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoread_config_file: ignore driver line without driver name
Yann Droneaud [Tue, 31 May 2011 18:20:39 +0000 (11:20 -0700)]
read_config_file: ignore driver line without driver name

If there's no driver name, strsep() will set config to NULL and later
processing of the driver name will segfault.

Spotted with zzuf.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoFix crash if no devices and ibv_get_device_list() is called multiple times
Roland Dreier [Fri, 27 May 2011 18:20:46 +0000 (11:20 -0700)]
Fix crash if no devices and ibv_get_device_list() is called multiple times

If no devices are found, ibverbs_init() sets num_devices to 0.  This
means the next call to __ibv_get_device_list() would call
ibverbs_init() again, which crashes because ibverbs_init() leaves
various internal pointers pointing to freed memory.

Fix this by using pthread_once() to call ibverbs_init() exactly once,
and then doing the right thing even if num_devices stays 0.

Tested-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoAdd AC_PROG_LIBTOOL to fix libtool configure warning
Tom Tucker [Thu, 29 Jul 2010 16:31:51 +0000 (16:31 +0000)]
Add AC_PROG_LIBTOOL to fix libtool configure warning

Add AC_PROG_LIBTOOL to configure.in to fix an autogen.sh warning about
LIBTOOL configuration.

Signed-off-by: Tom Tucker <tom@ogc.us>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
13 years agoFix autotools to include the necessary m4 files
Jason Gunthorpe [Thu, 7 Oct 2010 22:38:33 +0000 (22:38 +0000)]
Fix autotools to include the necessary m4 files

Running autogen.sh with a new version of autotools and then building
on a system with an older version tends to explode.  Unfortunately
this is sometimes necessary since the new version is required by the
package.  The fix changes the autogen.sh output from:

    + aclocal -I config
    + libtoolize --force --copy
    libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
    libtoolize: copying file `config/ltmain.sh'
    libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
    libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
    libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
    + autoheader
    + automake --foreign --add-missing --copy
    + autoconf

to:

    + aclocal -I config
    + libtoolize --force --copy
    libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
    libtoolize: copying file `config/ltmain.sh'
    libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `config'.
    libtoolize: copying file `config/libtool.m4'
    libtoolize: copying file `config/ltoptions.m4'
    libtoolize: copying file `config/ltsugar.m4'
    libtoolize: copying file `config/ltversion.m4'
    libtoolize: copying file `config/lt~obsolete.m4'
    + autoheader
    + automake --foreign --add-missing --copy
    + autoconf

And fixes various build problems in weird cases.

This is how GNU envisions this mess works at least...

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoRoll libibverbs 1.1.4 release
Roland Dreier [Thu, 3 Jun 2010 21:47:27 +0000 (14:47 -0700)]
Roll libibverbs 1.1.4 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoSmall configure.in modernizations
Roland Dreier [Thu, 3 Jun 2010 20:39:07 +0000 (13:39 -0700)]
Small configure.in modernizations

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoDebian: Switch to dpkg-source 3.0 format
Roland Dreier [Thu, 3 Jun 2010 20:14:30 +0000 (13:14 -0700)]
Debian: Switch to dpkg-source 3.0 format

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoForce line-buffering in ibv_asyncwatch
Hakon Bugge [Wed, 2 Jun 2010 17:01:10 +0000 (10:01 -0700)]
Force line-buffering in ibv_asyncwatch

ibv_asyncwatch defaults to block-buffering when stdout is redirected to
a file or pipe.  Changing to line-buffered mode makes it more usable in
scripted environments.

Signed-off-by: Hakon Bugge <Haakon.Bugge@sun.com>
14 years agoAdd path record definitions to sa.h
Sean Hefty [Thu, 6 May 2010 23:20:48 +0000 (16:20 -0700)]
Add path record definitions to sa.h

Add definitions for path record wire definition.  This will be used by
the librdmacm and ib_acm service, and is exchanged with the kernel
using the newer set and query route functionality.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoUndo changes in memory range tree when madvise() fails
Alex Vainman [Sun, 28 Mar 2010 17:06:16 +0000 (20:06 +0300)]
Undo changes in memory range tree when madvise() fails

ibv_madvise_range() doesn't cleanup if madvise() fails.  This patch
rolls back changes already made in the memory range tracking tree by
madvise() calls before the one that failed.  We can do this fairly
simply by simply restarting ibv_madvise_range() from the original
start to the current location with the opposite advice/inc values.

Signed-off-by: Alex Vainman <alexv@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoFix incorrect splits/merges in the memory tree when madvise() fails.
Alex Vainman [Mon, 1 Feb 2010 05:57:45 +0000 (07:57 +0200)]
Fix incorrect splits/merges in the memory tree when madvise() fails.

ibv_madvise_range() first manages (splits or merges) memory ranges in
the tree and only then calls madvise().  If madvise() fails, the
tree's memory range may contain incorrectly split or merged ranges.
The patch undoes the split and merge operations performed on the node
which caused the madvise() failure as well as on that node's
neighbors.

Signed-off-by: Alex Vainman <alexv@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoIncrement node refcount in ibv_madvise_range() only if madvise() succeeds
Alex Vainman [Mon, 1 Feb 2010 05:58:00 +0000 (07:58 +0200)]
Increment node refcount in ibv_madvise_range() only if madvise() succeeds

ibv_madvise_range() first updates the memory range reference count and
then calls to madvise().  If madvise() fails, the reference count of
the failed node is incorrect.  Fix this by updating the node's
reference count only after a successful call to madvise() (or if no
call to madvise() was needed).

Signed-off-by: Alex Vainman <alexv@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoFactor out range handling in ibv_madvise_range()
Alex Vainman [Mon, 1 Feb 2010 05:58:04 +0000 (07:58 +0200)]
Factor out range handling in ibv_madvise_range()

Clean up some code in ibv_madvise_range() by adding functions
merge_ranges(), split_range() and get_start_node().

Signed-off-by: Alex Vainman <alexv@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoUpdate Debian build rules so -dbg package isn't empty
Roland Dreier [Wed, 11 Nov 2009 22:45:46 +0000 (14:45 -0800)]
Update Debian build rules so -dbg package isn't empty

Add an override_dh_strip target so that the -dbg package ends up with
actual debug information in it.  This was broken in the dh7 transition.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoUse proper build dependency version in debian control file
Roland Dreier [Sat, 31 Oct 2009 04:23:18 +0000 (21:23 -0700)]
Use proper build dependency version in debian control file

The debian rules use a override_dh_makeshlibs target, so (as lintian
points out) we need a build dependency on debhelper >= 7.0.50.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoRoll libibverbs 1.1.3 release
Roland Dreier [Thu, 29 Oct 2009 21:24:49 +0000 (14:24 -0700)]
Roll libibverbs 1.1.3 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoMerge Fedora spec file changes
Roland Dreier [Thu, 29 Oct 2009 21:13:23 +0000 (14:13 -0700)]
Merge Fedora spec file changes

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoRewrite GID output in ibv_devinfo to avoid type punning warnings
Roland Dreier [Thu, 29 Oct 2009 21:09:08 +0000 (14:09 -0700)]
Rewrite GID output in ibv_devinfo to avoid type punning warnings

Avoid casting from uint8_t* to uint16_t* and then dereferencing to avoid
warnings about type punning.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoReturn errors from ibv_get_device_list() via errno
Jason Gunthorpe [Wed, 28 Oct 2009 23:42:21 +0000 (17:42 -0600)]
Return errors from ibv_get_device_list() via errno

Get rid of the output to stderr on various failure cases from
ibv_get_device_list() such as no device driver found, so that
applications can control how to present errors.  Fix up the examples
and the man page to match.

Code expecting this behavior linking to old libibverbs will
get the old fprint and errno set to garbage (probably ESPIPE).

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoFix double free in find_sysfs_devs()
Jason Gunthorpe [Thu, 29 Oct 2009 17:42:01 +0000 (10:42 -0700)]
Fix double free in find_sysfs_devs()

Fix double free of sysfs_dev in find_sysfs_devs if ibv_read_sysfs_file()
fails (which is unlikely in practice).

Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoShow transport (IB vs. iWARP) type in ibv_devinfo
Jeff Squyres [Wed, 28 Oct 2009 22:42:21 +0000 (15:42 -0700)]
Show transport (IB vs. iWARP) type in ibv_devinfo

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoFix fall-through bug in options case in pingpong examples
Robert Pearson [Mon, 14 Sep 2009 17:39:20 +0000 (12:39 -0500)]
Fix fall-through bug in options case in pingpong examples

Add missing breaks for the 'm' case of options handling.

Signed-off-by: Bob Pearson <rpearson@systemfabricworks.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoDo not use enum types for bit flags
Jason Gunthorpe [Thu, 30 Jul 2009 22:58:16 +0000 (16:58 -0600)]
Do not use enum types for bit flags

Arithmetic operations on enum members do not result in the enum type;
C++ is stricter about this than C.  So using flag enums results in
compile errors when they are OR'd together in a C++ application.

To fix this, replace all flag enum objects with int.  int was selected
to preserve the ABI; we checked that enum types are the same size as
int on at least i386, x86-64, ppc32, ppc64, ia64, and mips, and arm
and sparc also appear compatible with this choice.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoUpdate Debian Standards-Version to 3.8.3
Roland Dreier [Wed, 2 Sep 2009 19:13:48 +0000 (12:13 -0700)]
Update Debian Standards-Version to 3.8.3

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoChange Debian build system from cdbs to debhelper 7
Roland Dreier [Wed, 2 Sep 2009 19:11:06 +0000 (12:11 -0700)]
Change Debian build system from cdbs to debhelper 7

With debhelper 7 we can get just as simple a rules file without all of
the cdbs magic.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoUse AC_GNU_SOURCE in configure.in instead of -D_GNU_SOURCE in Makefile
Roland Dreier [Mon, 24 Aug 2009 21:02:58 +0000 (14:02 -0700)]
Use AC_GNU_SOURCE in configure.in instead of -D_GNU_SOURCE in Makefile

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoEnable quiet build rules with automake 1.11+
Roland Dreier [Mon, 24 Aug 2009 21:00:41 +0000 (14:00 -0700)]
Enable quiet build rules with automake 1.11+

Conditionally use the new AM_SILENT_RULES macro in configure.in.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoRevert "Update build system to use shave"
Roland Dreier [Mon, 24 Aug 2009 20:54:10 +0000 (13:54 -0700)]
Revert "Update build system to use shave"

This reverts commit 25ade84d1cd0b8b3a68872d3fc195e88cc7c4211.  Rather
than using shave, we'll use automake 1.11's native quiet build.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 years agoMake the gid argument to ibv_attach_mcast and ibv_detach_mcast const
Jason Gunthorpe [Sun, 19 Jul 2009 05:26:34 +0000 (23:26 -0600)]
Make the gid argument to ibv_attach_mcast and ibv_detach_mcast const

ibv_attach_mcast() and ibv_detach_mcast() don't change the gid
argument, so the arguments should be const to allow applications to
pass in constant gids.  This constness flows through to the driver
call struct and into the drivers and back into
ibv_cmd_attach_mcast()/ibv_cmd_detach_mcast().

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoAllow config file paths to the driver library to be absolute
Jason Gunthorpe [Tue, 14 Jul 2009 21:16:53 +0000 (15:16 -0600)]
Allow config file paths to the driver library to be absolute

If the driver line starts with a / then no lib prefix is applied and
the full path is passed to dlopen().  This allows a completely
self-contained installation that relies on RPATH for the binaries and
this mechanism for the drivers.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoMerge branch 'stable'
Roland Dreier [Thu, 25 Jun 2009 20:41:16 +0000 (13:41 -0700)]
Merge branch 'stable'

15 years agoUpdate Debian policy version to 3.8.2
Roland Dreier [Thu, 25 Jun 2009 17:26:43 +0000 (10:26 -0700)]
Update Debian policy version to 3.8.2

None of the changes 3.7.3 -> 3.8.2 affect us.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoMove -dbg Debian package to section debug
Roland Dreier [Wed, 24 Jun 2009 18:39:47 +0000 (11:39 -0700)]
Move -dbg Debian package to section debug

Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoUpdate build system to use shave
Roland Dreier [Wed, 24 Jun 2009 18:08:36 +0000 (11:08 -0700)]
Update build system to use shave

Add shave (git://git.lespiau.name/shave) to make build output of libibverbs
much more readable by abbreviating the outputed commands so that
warnings become visible, etc.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoUpdate Dotan's email
Dotan Barak [Sat, 18 Oct 2008 02:35:00 +0000 (04:35 +0200)]
Update Dotan's email

Update Dotan's email in all of the files it appears.

Signed-off-by: Dotan Barak <dotanba@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoImplement PPC wmb() with sync instead of eieio
Shirley Ma [Tue, 22 Jul 2008 22:06:50 +0000 (15:06 -0700)]
Implement PPC wmb() with sync instead of eieio

wmb() for PPC was incorrect defined as an eieio instruction in
libibverbs.  eieio only orders pure I/O memory or a pure system memory
accesses.  In a situation where the device drivers use the d_map
kernel services to share a portion of system memory with an I/O
adapter, we need to use sync() instead. See below link for reference:

http://www.ibm.com/developerworks/eserver/articles/powerpc.html

Signed-off-by: Shirley Ma <xma@us.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRevert conversion of ibv_devinfo to use ibv_port_state_str()
Roland Dreier [Wed, 25 Jun 2008 02:32:27 +0000 (19:32 -0700)]
Revert conversion of ibv_devinfo to use ibv_port_state_str()

Using ibv_port_state_str() changes the port state output of ibv_devinfo
(eg "PORT_DOWN" becomes "down"), which is reported to break scripts that
parse this output.  Revert to using the old code in ibv_devinfo; we want
ibv_port_state_str() to continue producing the nicer-looking lower case
output, so just leave the open-coded alternative in ibv_devinfo.

Reported-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoCode formatting cleanups
Dotan Barak [Fri, 23 May 2008 20:32:07 +0000 (23:32 +0300)]
Code formatting cleanups

Improve readability based on warnings from kernel's checkpatch.pl.

Signed-off-by: Dotan Barak <dotanba@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoUpdate Debian packaging to include new manpage symlinks
Roland Dreier [Mon, 21 Apr 2008 21:54:24 +0000 (14:54 -0700)]
Update Debian packaging to include new manpage symlinks

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoInclude NMU changes for version 1.1.1-1.1 in Debian changelog
Roland Dreier [Sat, 19 Apr 2008 02:39:50 +0000 (19:39 -0700)]
Include NMU changes for version 1.1.1-1.1 in Debian changelog

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoChange .nl macro in man pages to .sp
Roland Dreier [Fri, 18 Apr 2008 23:12:14 +0000 (16:12 -0700)]
Change .nl macro in man pages to .sp

There actually is no ".nl" macro defined in troff, so convert all uses
of it to ".sp", which seems to be what was intended.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRoll libibverbs 1.1.2 release
Roland Dreier [Fri, 18 Apr 2008 22:12:21 +0000 (15:12 -0700)]
Roll libibverbs 1.1.2 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoAdd RPM dependency on base package to -devel package
Roland Dreier [Fri, 18 Apr 2008 22:30:00 +0000 (15:30 -0700)]
Add RPM dependency on base package to -devel package

This fixes the rpmlint warning

    libibverbs-devel.x86_64: W: no-dependency-on libibverbs

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoCorrect typo ibv_mult_to_rate -> mult_to_ibv_rate in man page
Roland Dreier [Fri, 18 Apr 2008 22:00:50 +0000 (15:00 -0700)]
Correct typo ibv_mult_to_rate -> mult_to_ibv_rate in man page

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoAdd functions to convert enum values to strings
Ira Weiny [Tue, 15 Apr 2008 20:35:48 +0000 (13:35 -0700)]
Add functions to convert enum values to strings

Add ibv_xxx_str() functions to convert node type, port state, event
type and wc status enum values to strings.

Signed-off-by: Ira K. Weiny <weiny2@llnl.gov>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoUpdate various text to talk about general RDMA, not just InfiniBand
Roland Dreier [Fri, 18 Apr 2008 16:22:13 +0000 (09:22 -0700)]
Update various text to talk about general RDMA, not just InfiniBand

libibverbs works with both iWARP and InfiniBand devices, so update
various places that talk about InfiniBand to be more general.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoFix download directory in RPM spec file
Roland Dreier [Mon, 31 Mar 2008 01:28:20 +0000 (18:28 -0700)]
Fix download directory in RPM spec file

libibverbs sources are now in downloads/verbs/, not just downloads/

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoAdd command line parameter to set SL for pingpong examples
Dotan Barak [Tue, 23 Oct 2007 12:39:25 +0000 (14:39 +0200)]
Add command line parameter to set SL for pingpong examples

Add a --sl/-l command line parameter for the pingpong examples to set
the SL of the QP/AH.  This can be used to test a QoS setup.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoAdd debian/watch file
Roland Dreier [Wed, 12 Mar 2008 17:29:53 +0000 (10:29 -0700)]
Add debian/watch file

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoFix valgrind false positive in ibv_create_comp_channel()
Troy Benjegerdes [Mon, 10 Mar 2008 02:39:39 +0000 (19:39 -0700)]
Fix valgrind false positive in ibv_create_comp_channel()

Need to mark response buffer as defined after write() succeeds.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoDocument IBV_SEND_INLINE buffer ownership
Or Gerlitz [Wed, 25 Jul 2007 06:45:16 +0000 (09:45 +0300)]
Document IBV_SEND_INLINE buffer ownership

If the IBV_SEND_INLINE flag is set in a work request posted with
ibv_post_send(), the data buffers can be reused immediately after the
call returns.  Document this.

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoFixes for man pages
Dotan Barak [Sun, 3 Feb 2008 15:55:04 +0000 (17:55 +0200)]
Fixes for man pages

Some fixes and updates to several man pages:
 * Correct formatting in a few places.
 * Add more "SEE ALSO" functions where appropriate.
 * Document byte order of GUID and P_Key fields.
 * Fix example code in ibv_get_cq_event.3
 * Document GRH handling on receive.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoFix some issues in the examples
Dotan Barak [Wed, 10 Oct 2007 09:26:18 +0000 (11:26 +0200)]
Fix some issues in the examples

Fix the following issues reported by valgrind in the examples:
 * memory leaks
 * uninitialized members of attribute structures

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoFix several valgrind false positives
Dotan Barak [Wed, 10 Oct 2007 09:25:18 +0000 (11:25 +0200)]
Fix several valgrind false positives

Fix several issues that were reported by valgrind:

* Initialize reserved attributes of command structures

* Fix the pointer and size when calling VALGRIND_MAKE_MEM_DEFINED in
  ibv_cmd_reg_mr() and ibv_cmd_create_cq_v2(): if we have struct
  xxx_resp *resp and resp_size, we need to do

VALGRIND_MAKE_MEM_DEFINED(resp, resp_size)

  rather than the getting the paramters wrong as in

VALGRIND_MAKE_MEM_DEFINED(&resp, sizeof resp)
VALGRIND_MAKE_MEM_DEFINED(resp, sizeof resp_size);

* Call VALGRIND_MAKE_MEM_DEFINED for buffers that are filled by
  the kernel in ibv_cmd_query_srq(), ibv_cmd_destroy_srq() and
  ibv_cmd_query_qp().

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoPut correct version information in Debian shlibs
Roland Dreier [Tue, 12 Feb 2008 18:59:24 +0000 (10:59 -0800)]
Put correct version information in Debian shlibs

Use DEB_DH_MAKESHLIBS_ARGS_ALL to pass appropriate -V option to
dh_makeshlibs, since new symbols were added in version 1.1.0.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoConvert hyphen to minus sign in ibv_query_pkey man page
Roland Dreier [Thu, 24 Jan 2008 04:04:50 +0000 (20:04 -0800)]
Convert hyphen to minus sign in ibv_query_pkey man page

A bare "-" in a man page will be rendered as a hyphen; to get a minus
sign, "\-" must be used.  Very pedantic people (or automatic checkers,
such as Debian's lintian tool) may notice the difference.  The man page
for ibv_query_pkey incorrectly wrote a negative return value as "-1".
Fix this to be the correct "\-1".

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoUse real Homepage: tag instead of pseudo-header inside description
Roland Dreier [Mon, 21 Jan 2008 21:14:54 +0000 (13:14 -0800)]
Use real Homepage: tag instead of pseudo-header inside description

New dpkg can actually parse Homepage: fields in debian/control.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoUpdate Debian policy version to 3.7.3
Roland Dreier [Mon, 3 Dec 2007 22:07:09 +0000 (14:07 -0800)]
Update Debian policy version to 3.7.3

None of the changes 3.7.2 -> 3.7.3 affect us.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoAlways return valid bad_wr on error from ibv_post_{send,recv,srq_recv}
Roland Dreier [Tue, 20 Nov 2007 21:12:15 +0000 (13:12 -0800)]
Always return valid bad_wr on error from ibv_post_{send,recv,srq_recv}

There are error cases in the kernel's uverbs work request posting
functions where the return value is negative (i.e., an error) and yet a
non-zero resp.bad_wr is not written back to userspace.  In this case,
ibv_cmd_post_send() should still set the bad_wr pointer.

Bug pointed out in ibv_post_send() by Ralph Campbell
<ralph.campbell@qlogic.com>, and noticed elsewhere by Dotan Barak
<dotanb@dev.mellanox.co.il>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoFix spec file License: tag
Roland Dreier [Fri, 26 Oct 2007 20:11:13 +0000 (13:11 -0700)]
Fix spec file License: tag

Our license information is properly described as "GPLv2 or BSD".

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoSet ibv_device->node_type when allocating device
swelch@systemfabricworks.com [Fri, 31 Aug 2007 16:30:51 +0000 (11:30 -0500)]
Set ibv_device->node_type when allocating device

When allocating a device structure, set the node_type member correctly.

Signed-off-by: Steve Welch <swelch@systemfabricworks.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoInitialize reserved attributes in modify QP command
Dotan Barak [Wed, 8 Aug 2007 13:27:08 +0000 (16:27 +0300)]
Initialize reserved attributes in modify QP command

Initialize the reserved attributes in modify QP command to eliminate
valgrind warnings like:

==23549== Syscall param write(buf) points to uninitialised byte(s)
==23549==    at 0x316B1B933F: (within /lib64/tls/libc-2.3.4.so)
==23549==    by 0x4A33AF7: ibv_cmd_modify_qp (cmd.c:782)
==23549==    by 0x4F860D8: mlx4_modify_qp (verbs.c:480)
==23549==    by 0x4A37A53: ibv_modify_qp@@IBVERBS_1.1 (verbs.c:441)
==23549==    by 0x40972E: qp_reset_to_rtr (mr_test_fun.c:1189)
==23549==    by 0x403AFC: mr_test_connect_qp (mr_test.c:232)
==23549==    by 0x404956: do_test (mr_test.c:85)
==23549==    by 0x402DF8: main (main.c:448)
==23549==  Address 0x7FEFFF2AE is on thread 1's stack

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix too-big madvise() call in ibv_madvise_range()
Roland Dreier [Tue, 10 Jul 2007 18:23:18 +0000 (11:23 -0700)]
Fix too-big madvise() call in ibv_madvise_range()

When the first memory range found in ibv_madvise_range() is merged
with the previous range before entering the loop that calls madvise(),
a too-big range could be passed to madvise().  This could lead to
trying to madvise() memory that has already been freed and unmapped,
which causes madvise() and therefore ibv_reg_mr() to fail.

Fix this by making sure we don't madvise() any memory outside the
range passed into ibv_madvise_range().

This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=682>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix Valgrind annotations so they can actually be built
Roland Dreier [Tue, 3 Jul 2007 18:53:47 +0000 (11:53 -0700)]
Fix Valgrind annotations so they can actually be built

The AC_CHECK_HEADER() test for <valgrind/memcheck.h> will never result
in HAVE_VALGRIND_MEMCHECK_H being defined, so ibverbs.h will never
include <valgrind/memcheck.h> and Valgrind annotations will never actually
get built.  Fix this by adding an AC_DEFINE() of HAVE_VALGRIND_MEMCHECK_H
if the header is found.

Pointed out by Jeff Squyres <jsquyres@cisco.com>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoClean up NVALGRIND comment in config.h.in
Roland Dreier [Tue, 3 Jul 2007 18:48:40 +0000 (11:48 -0700)]
Clean up NVALGRIND comment in config.h.in

Update configure.in so that the comment generated by autoheader for
NVALGRIND in config.h.in is a complete sentence to match the style of
the rest of the file.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoAdd <stdint.h> to <infiniband/arch.h>
Roland Dreier [Tue, 26 Jun 2007 21:37:38 +0000 (14:37 -0700)]
Add <stdint.h> to <infiniband/arch.h>

<infiniband/arch.h> uses uint64_t, so it needs to include <stdint.h>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRemove deprecated ${Source-Version} from debian/control
Roland Dreier [Thu, 21 Jun 2007 19:05:21 +0000 (12:05 -0700)]
Remove deprecated ${Source-Version} from debian/control

Replace ${Source-Version} with the more-correct ${binary:Version}.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRoll libibverbs 1.1.1 release
Roland Dreier [Fri, 15 Jun 2007 19:48:38 +0000 (12:48 -0700)]
Roll libibverbs 1.1.1 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMerge branch 'master' into stable
Roland Dreier [Sun, 3 Jun 2007 20:33:12 +0000 (13:33 -0700)]
Merge branch 'master' into stable

17 years agoInitialize QP state to RESET
Jack Morgenstein [Sun, 3 Jun 2007 20:33:01 +0000 (13:33 -0700)]
Initialize QP state to RESET

For newly created QPs, set qp->state to IBV_QPS_RESET.  At least
libmlx4 needs this fix, or else it won't correctly initialize the QP's
send queue when transitioning to INIT.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMerge branch 'master' into stable
Roland Dreier [Thu, 31 May 2007 17:38:30 +0000 (10:38 -0700)]
Merge branch 'master' into stable

17 years agoDon't warn root if RLIMIT_MEMLOCK is low
Michael S. Tsirkin [Wed, 30 May 2007 17:58:10 +0000 (10:58 -0700)]
Don't warn root if RLIMIT_MEMLOCK is low

The amount of memory root can lock isn't limited, so the rlimit value
doesn't matter in this case.  Do not print a warning about
RLIMIT_MEMLOCK being too low if EUID is 0.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoibv_devinfo: Decode max_vl_num to actual number
Dotan Barak [Sun, 6 May 2007 13:46:42 +0000 (16:46 +0300)]
ibv_devinfo: Decode max_vl_num to actual number

Print max_vl_num as the actual number of VLs in addition to the
encoded value.

Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoAdd wc_wmb()
Roland Dreier [Thu, 17 May 2007 22:07:18 +0000 (15:07 -0700)]
Add wc_wmb()

Add a write-combining flush operation, wc_wmb(), which can be used by
low-level drivers to force ordering of write-combined stores.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix call to ibv_free_device_list() in pingpong examples
Roland Dreier [Thu, 3 May 2007 18:09:44 +0000 (11:09 -0700)]
Fix call to ibv_free_device_list() in pingpong examples

When a -d option to specify which device to use is passed to the
pingpong examples, they iterate through the device list by
incrementing the dev_list pointer.  This means that the call to
ibv_free_device_list() may not get the right pointer.

Fix this by using an index to iterate through the array and leaving
the dev_list pointer itself alone.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoTrivial whitespace fixes in examples/
Roland Dreier [Thu, 3 May 2007 17:48:51 +0000 (10:48 -0700)]
Trivial whitespace fixes in examples/

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoUpdate Debian build
Roland Dreier [Sat, 28 Apr 2007 21:18:43 +0000 (14:18 -0700)]
Update Debian build

Use DEB_AUTO_UPDATE_LIBTOOL rather than manual rerunning autotools to
avoid setting RPATH.  Remove DEB_DH_STRIP_ARGS since cdbs should
handle this automatically at debhelper compat level 5.  Let cdbs
generate build-deps automatically (move control to control.in).

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMerge branches 'stable' and 'stable-1.0' into stable
Roland Dreier [Thu, 12 Apr 2007 21:36:23 +0000 (14:36 -0700)]
Merge branches 'stable' and 'stable-1.0' into stable

17 years agoRoll libibverbs 1.1 release
Roland Dreier [Wed, 11 Apr 2007 21:41:56 +0000 (14:41 -0700)]
Roll libibverbs 1.1 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoChange a few references from OpenIB to OpenFabrics
Roland Dreier [Wed, 11 Apr 2007 21:20:26 +0000 (14:20 -0700)]
Change a few references from OpenIB to OpenFabrics

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix ibv_srq_pingpong option handling
Roland Dreier [Fri, 6 Apr 2007 14:44:39 +0000 (07:44 -0700)]
Fix ibv_srq_pingpong option handling

Add missing break statement in command line option handling switch.
Without the break statement, setting the 'm' (mtu) command line option
fell through to the next case and the same value was used for the 'q'
(num-qp) option.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
(cherry picked from commit 09335ff6377acf90d5ed1c28a6ce69d2aa620e09)

17 years agoFix ibv_srq_pingpong option handling
Roland Dreier [Fri, 6 Apr 2007 14:44:39 +0000 (07:44 -0700)]
Fix ibv_srq_pingpong option handling

Add missing break statement in command line option handling switch.
Without the break statement, setting the 'm' (mtu) command line option
fell through to the next case and the same value was used for the 'q'
(num-qp) option.

Signed-off-by: Roland Dreier <rolandd@cisco.com>