]> git.openfabrics.org - ~shefty/libibverbs.git/log
~shefty/libibverbs.git
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>
17 years agoAdd missing newline to rlimit(MEMLOCK) warning
Roland Dreier [Fri, 6 Apr 2007 14:28:02 +0000 (07:28 -0700)]
Add missing newline to rlimit(MEMLOCK) warning

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRoll libibverbs 1.1-rc2 release
Roland Dreier [Wed, 4 Apr 2007 23:17:27 +0000 (16:17 -0700)]
Roll libibverbs 1.1-rc2 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoClean up spec file
Roland Dreier [Wed, 4 Apr 2007 22:33:02 +0000 (15:33 -0700)]
Clean up spec file

Modernize spec file to better match Fedora guidelines:
 - remove unused %ver macro
 - fix Release to avoid '-' character
 - switch to newer recommendation for BuildRoot
 - add Requires(post): /sbin/ldconfig and Requires(postun): /sbin/ldconfig
 - split static libraries into new -devel-static package
 - don't use %makeinstall

Based on a patch from Doug Ledford <dledford@redhat.com>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoPrint warning if memlock limit is low
Roland Dreier [Thu, 29 Mar 2007 17:48:54 +0000 (10:48 -0700)]
Print warning if memlock limit is low

Check RLIMIT_MEMLOCK, and if it is 32 KB or less, print a warning.
This should help with support requests for systems that set this limit
too low.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoUpdate README now that 1.1 ABI is (semi-)frozen
Roland Dreier [Thu, 29 Mar 2007 17:05:56 +0000 (10:05 -0700)]
Update README now that 1.1 ABI is (semi-)frozen

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoBump version number to 1.1-rc2-pre1
Roland Dreier [Wed, 28 Mar 2007 22:08:59 +0000 (15:08 -0700)]
Bump version number to 1.1-rc2-pre1

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRoll libibverbs 1.1-rc1 release
Roland Dreier [Tue, 27 Mar 2007 20:15:31 +0000 (13:15 -0700)]
Roll libibverbs 1.1-rc1 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMan page updates
Dotan Barak [Tue, 27 Mar 2007 17:22:43 +0000 (10:22 -0700)]
Man page updates

- Fix spelling mistakes
- Convert "PKey"/"QKey" to "P_Key"/"Q_Key"
- Fix variable names in ibv_get_cq_event() example
- Add non-blocking examples for ibv_get_cq_event() and ibv_get_async_event()

Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoReference count completion channels
Roland Dreier [Tue, 27 Mar 2007 17:04:46 +0000 (10:04 -0700)]
Reference count completion channels

Keep a reference count in completion channel structure, so that
ibv_destroy_comp_channel() can return EBUSY if a consumer tries to
destroy a channel that still has CQs attached.

Suggested by Dotan Barak <dotanb@mellanox.co.il>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix memory leak on ibv_fork_init() error path
Dotan Barak [Mon, 19 Mar 2007 20:01:26 +0000 (13:01 -0700)]
Fix memory leak on ibv_fork_init() error path

Free test buffer so we don't leak memory when madvise() fails.

Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoAdd low-level driver hooks for reregister MR and memory windows
Roland Dreier [Thu, 8 Mar 2007 18:05:24 +0000 (10:05 -0800)]
Add low-level driver hooks for reregister MR and memory windows

Add methods to struct ibv_context_ops to make it possible to implement
reregister memory region and alloc/bind/dealloc memory window
operations in the future without breaking the libibverbs ABI.

Assuming these methods and data structures are designed properly
(which is hard to say, absent any real implementation) then it will
only be necessary to add new libibverbs functions to call the hooks,
which will be source and binary compatible with existing applications
and low-level drivers.  Applications that want to use the new
functions can easily check for their existence at compile time.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoDelete man3 symbolic links before creating them during install
Jack Morgenstein [Thu, 22 Feb 2007 18:16:43 +0000 (20:16 +0200)]
Delete man3 symbolic links before creating them during install

The following patch removes manpage symbolic links so that they may be
relinked in the install.  Otherwise a second install will fail, since
the links already exist.

Suggested by Michael Tsirkin.

Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoAdd remaining libibverbs manpages
Roland Dreier [Wed, 21 Feb 2007 00:05:27 +0000 (16:05 -0800)]
Add remaining libibverbs manpages

Add the rest of the manpages for libibverbs functions in section 3.
These manpages were written by Dotan Barak <dotanb@mellanox.co.il>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoStart adding libibverbs manpages
Roland Dreier [Tue, 20 Feb 2007 06:34:58 +0000 (22:34 -0800)]
Start adding libibverbs manpages

Add the first few manpages for libibverbs functions in section 3.
Also, add them into the build and add rules to the Makefile to link
shared manpages together (since eg ibv_get_device_list and
ibv_free_device_list have the same manpage).  Update Debian and Fedora
packaging to include section 3 manpages in the development package.

These manpages were written by Dotan Barak <dotanb@mellanox.co.il>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoUpdate Debian changelog
Roland Dreier [Wed, 31 Jan 2007 18:44:14 +0000 (10:44 -0800)]
Update Debian changelog

Remove item about bumping soname, since it's no longer true.  Merge in
1.0.4-1 info from stable branch, since it's been uploaded to Debian
archive already.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRevert "The ibv_cmd_* create functions need to set context"
Roland Dreier [Wed, 31 Jan 2007 18:39:51 +0000 (10:39 -0800)]
Revert "The ibv_cmd_* create functions need to set context"

This reverts commit 5eaee85aec025be16e5aeeaac64abc6d8d9c191c.

This breaks ibv_destroy_ah() with libmthca, and isn't really appropriate
for the stable branch.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix unset context breakage when a low-level driver does kernel bypass
Roland Dreier [Wed, 31 Jan 2007 18:38:50 +0000 (10:38 -0800)]
Fix unset context breakage when a low-level driver does kernel bypass

Commit 8b3d2254 ("The ibv_cmd_* create functions need to set context")
breaks things when a low-level driver does not actually use an
ibv_cmd_* function to create an object, since then the context member
of that object never gets set.  For example, libmthca does not nee to
call into the kernel to create an AH, and hence ibv_destroy_ah() will
crash because it tries to call a function pointer from the AH's
context member, which never gets set.

Fix this by adding back all the setting of context to the main verbs
functions like ibv_create_ah() (but still leave the setting in the
ibv_cmd_* create functions too).  This means context gets set twice,
but that doesn't really hurt anything.  Once we branch off libibverbs
1.1 as stable, we can change the signatures of the ibv_cmd_* destroy
functions to take an explicit context parameter, and get rid of
setting context in the ibv_cmd_* create functions.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRename Debian package back to libibverbs1
Roland Dreier [Mon, 29 Jan 2007 17:30:30 +0000 (09:30 -0800)]
Rename Debian package back to libibverbs1

Since commit fd448acc ("Add ABI compatibility for apps linked against
libibverbs 1.0") makes libibverbs 1.1 binary compatible with
applications linked against libibverbs 1.0 and the soname of the
library remains at 1, change the Debian package back to libibverbs1
instead of bumping it to libibverbs2.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoAdd ABI compatibility for apps linked against libibverbs 1.0
Roland Dreier [Mon, 29 Jan 2007 17:22:18 +0000 (09:22 -0800)]
Add ABI compatibility for apps linked against libibverbs 1.0

Add a compatibility layer that allows applications (but not low-level
drivers) linked against libibverbs 1.0 to work with libibverbs 1.1.
This is done by using Linux's versioned symbol linking support: the
native libibverbs entry points are given IBVERBS_1.1 versions, and
compatibility wrappers for entry points from libibverbs 1.0 are
created with an IBVERBS_1.0 version (to match what libibverbs 1.0
exported).

In essense these wrappers create compatible proxies for every
structure returned to the application (struct ibv_device, ibv_context,
ibv_pd, etc), and map between the proxy and the real object when the
application calls into libibverbs.  This code is mostly
straightforward, with a few complications in handling async events,
because the pointers in event structures must be translated back to
proxy structures when they are returned to the application.

There are a few further wrinkles because the calls to data path
functions (poll CQ, post send, etc) are actually inline functions that
call directly into the context ops, so the context ops proxy structure
must actually contain pointers to compatibility wrappers for these
functions as well.  This may have some performance impact but it seems
the overhead is unavoidable, and tests with NetPIPE on top of Open MPI
shows that the latency and throughput differences seem to be lost in
the noise anyway.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoThe ibv_cmd_* create functions need to set context
Roland Dreier [Mon, 29 Jan 2007 17:17:50 +0000 (09:17 -0800)]
The ibv_cmd_* create functions need to set context

If the ibv_cmd_* create function succeeds, then the object context
pointer must be set by that function so that the corresponding destroy
function will work.  This avoids problems in the error cleanup path of
a low-level driver's create function that fails after calling an
ibv_cmd_* create function.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
(cherry picked from commit 8b3d225476c99ea29a68109a7d40e5ef353d4388)

17 years agoThe ibv_cmd_* create functions need to set context
Steve Wise [Fri, 19 Jan 2007 21:16:59 +0000 (15:16 -0600)]
The ibv_cmd_* create functions need to set context

If the ibv_cmd_* create function succeeds, then the object context
pointer must be set by that function so that the corresponding destroy
function will work.  This avoids problems in the error cleanup path of
a low-level driver's create function that fails after calling an
ibv_cmd_* create function.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix caching of --version-script check
Roland Dreier [Fri, 26 Jan 2007 21:42:04 +0000 (13:42 -0800)]
Fix caching of --version-script check

The shell code in AC_CACHE_CHECK() should set the variable that we say
is being cached.  So set ac_cv_version_script when testing whether ld
accepts --version-script, and then set LIBIBVERBS_VERSION_SCRIPT based
on the (possibly cached) value of ac_cv_version_script outside of the
AC_CACHE_CHECK().

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoAdd resource cleanup at end of pingpong tests
Dotan Barak [Wed, 17 Jan 2007 09:39:01 +0000 (11:39 +0200)]
Add resource cleanup at end of pingpong tests

Clean up all IB resources at the end of pingpong examples.  Ack CQ
events when using events to all CQ to be destroyed.

Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix checks of asprintf() return value
Roland Dreier [Thu, 18 Jan 2007 15:13:58 +0000 (07:13 -0800)]
Fix checks of asprintf() return value

asprintf() returns the number of bytes printed, so the way to check
for failure is to test if the return value is < 0.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
(cherry picked from commit 2d83a4b522b00ab36ada613920e9cf5594648934)

17 years agoFix checks of asprintf() return value
Michael S. Tsirkin [Thu, 18 Jan 2007 15:13:02 +0000 (07:13 -0800)]
Fix checks of asprintf() return value

asprintf() returns the number of bytes printed, so the way to check
for failure is to test if the return value is < 0.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoCheck asprintf() return in pingpong examples
Dotan Barak [Wed, 17 Jan 2007 21:59:21 +0000 (13:59 -0800)]
Check asprintf() return in pingpong examples

Handle asprintf() allocation failures in pingpong examples.

Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
(cherry picked from commit db39573253488a800ad3a57bf8846902c090450f)

17 years agoCheck asprintf() return in pingpong examples
Dotan Barak [Wed, 17 Jan 2007 21:59:21 +0000 (13:59 -0800)]
Check asprintf() return in pingpong examples

Handle asprintf() allocation failures in pingpong examples.

Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoCheck return of calloc() in ibv_get_device_list()
Roland Dreier [Wed, 17 Jan 2007 21:41:33 +0000 (13:41 -0800)]
Check return of calloc() in ibv_get_device_list()

Don't blindly copy device pointers if calloc() returns NULL.

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

17 years agoCheck return of calloc() in ibv_get_device_list()
Roland Dreier [Wed, 17 Jan 2007 21:41:33 +0000 (13:41 -0800)]
Check return of calloc() in ibv_get_device_list()

Don't blindly copy device pointers if calloc() returns NULL.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix some memory leaks in read_config() error path
Dotan Barak [Tue, 16 Jan 2007 20:26:39 +0000 (12:26 -0800)]
Fix some memory leaks in read_config() error path

Don't leak path if stat() fails or file isn't a regular file.

Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoHandle asprintf memory allocation failures
Dotan Barak [Tue, 16 Jan 2007 20:21:25 +0000 (12:21 -0800)]
Handle asprintf memory allocation failures

Cherry-picked from dd3d43d89e398f23c4824d26f2698446ff2d120f.

Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoHandle asprintf memory allocation failures
Dotan Barak [Tue, 16 Jan 2007 20:21:25 +0000 (12:21 -0800)]
Handle asprintf memory allocation failures

Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoDon't lose devices when multiple RDMA devices are present
Steve Wise [Thu, 11 Jan 2007 21:30:33 +0000 (13:30 -0800)]
Don't lose devices when multiple RDMA devices are present

When scanning through /sys/class/infiniband_verbs, link structs into
the list of found devices properly so that older devices aren't lost.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoDon't use d_type member of struct dirent
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().

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRevert "Pass driver data through ibv_cmd_req_notify_cq()"
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.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoImplement new method for finding and loading device-specific drivers
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.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoPass driver data through ibv_cmd_req_notify_cq()
Steve Wise [Fri, 6 Oct 2006 22:29:34 +0000 (17:29 -0500)]
Pass driver data through ibv_cmd_req_notify_cq()

The Chelsio iWARP driver library needs to pass information to the
kernel device-specific driver for re-arming the CQ.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix rewritten test for linker script support
Roland Dreier [Thu, 16 Nov 2006 23:39:43 +0000 (15:39 -0800)]
Fix rewritten test for linker script support

Remove extra parameter to AC_SUBST left by mistake.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoSupport provider response data in reg_mr command
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>
17 years agoAdd async_event callback function to struct ibv_context_ops
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>
17 years agoRemove svn keywords
Roland Dreier [Tue, 14 Nov 2006 05:19:34 +0000 (21:19 -0800)]
Remove svn keywords

Now that we're in git, there's no reason to have $Id in files.

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

17 years agoRemove svn keywords
Roland Dreier [Tue, 14 Nov 2006 05:19:34 +0000 (21:19 -0800)]
Remove svn keywords

Now that we're in git, there's no reason to have $Id in files.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoBump version number
Roland Dreier [Thu, 2 Nov 2006 05:17:41 +0000 (05:17 +0000)]
Bump version number

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoAdd final Debian changelog for libibverbs 1.0.4
Roland Dreier [Tue, 31 Oct 2006 23:13:57 +0000 (23:13 +0000)]
Add final Debian changelog for libibverbs 1.0.4

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRoll libibverbs 1.0.4 release
Roland Dreier [Tue, 31 Oct 2006 22:52:03 +0000 (22:52 +0000)]
Roll libibverbs 1.0.4 release

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