aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-12-21Roll libibverbs 1.1.6 releaselibibverbs-1.1.6stableRoland Dreier3-5/+11
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-12-19Fix memory leaks in various error flowsDotan Barak3-3/+9
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il> Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-12-13Add support to ibv_devinfo for displaying extended speedsMarcel Apfelbaum1-1/+6
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>
2011-11-11Debian: Don't use brace expansion for {a,so} in libibverbs-dev.installRoland Dreier2-1/+8
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-08-11Makefile.am: Fix an automake warningBart Van Assche1-1/+1
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>
2011-08-11Add "foreign" option to AM_INIT_AUTOMAKEBart Van Assche1-1/+1
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>
2011-07-26Update examples for IBoEOr Gerlitz7-88/+342
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>
2011-07-26Add GID change eventOr Gerlitz4-2/+8
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>
2011-07-26Update kernel API header to include link_layerOr Gerlitz2-1/+3
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>
2011-07-26Add link_layer field port attributeOr Gerlitz2-0/+27
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>
2011-06-29Update Debian Standards-Version to 3.9.2Roland Dreier2-2/+3
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-06-29Don't ship .la files in Debian libibverbs-devRoland Dreier2-3/+4
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-06-29Package description shouldn't start with an articleRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-06-29debian/libibverbs1.postinst: Let debhelper code run in all casesJulien BLACHE1-4/+2
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>
2011-06-28Roll libibverbs 1.1.5 releaselibibverbs-1.1.5Roland Dreier3-7/+13
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-06-28Handle huge pages in ibv_fork_init() and madvise trackingAlexander Schmidt2-6/+99
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>
2011-06-27Set DM-Upload-Allowed now that Roland is a Debian MaintainerRoland Dreier1-1/+2
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-06-17Fix date format in RPM spec file changelogDotan Barak1-1/+1
Signed-off-by: Dotan Barak <dotan@dev.mellanox.co.il> Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-05-31read_config_file: ignore driver line without driver nameYann Droneaud1-1/+1
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>
2011-05-27Fix crash if no devices and ibv_get_device_list() is called multiple timesRoland Dreier1-10/+10
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>
2010-12-15Add AC_PROG_LIBTOOL to fix libtool configure warningTom Tucker1-0/+1
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>
2010-12-08Fix autotools to include the necessary m4 filesJason Gunthorpe2-0/+2
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>
2010-06-03Roll libibverbs 1.1.4 releaselibibverbs-1.1.4Roland Dreier3-6/+12
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2010-06-03Small configure.in modernizationsRoland Dreier1-2/+2
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2010-06-03Debian: Switch to dpkg-source 3.0 formatRoland Dreier2-0/+7
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2010-06-02Force line-buffering in ibv_asyncwatchHakon Bugge1-0/+3
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>
2010-05-16Add path record definitions to sa.hSean Hefty1-0/+35
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>
2010-04-21Undo changes in memory range tree when madvise() failsAlex Vainman1-3/+19
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>
2010-03-19Fix incorrect splits/merges in the memory tree when madvise() fails.Alex Vainman1-1/+36
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>
2010-03-19Increment node refcount in ibv_madvise_range() only if madvise() succeedsAlex Vainman1-4/+3
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>
2010-03-19Factor out range handling in ibv_madvise_range()Alex Vainman1-37/+50
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>
2009-11-11Update Debian build rules so -dbg package isn't emptyRoland Dreier2-0/+10
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>
2009-10-30Use proper build dependency version in debian control fileRoland Dreier1-1/+1
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>
2009-10-29Roll libibverbs 1.1.3 releaselibibverbs-1.1.3Roland Dreier3-7/+13
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-10-29Merge Fedora spec file changesRoland Dreier1-1/+13
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-10-29Rewrite GID output in ibv_devinfo to avoid type punning warningsRoland Dreier1-9/+9
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>
2009-10-29Return errors from ibv_get_device_list() via errnoJason Gunthorpe10-34/+58
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>
2009-10-29Fix double free in find_sysfs_devs()Jason Gunthorpe1-1/+0
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>
2009-10-28Show transport (IB vs. iWARP) type in ibv_devinfoJeff Squyres1-0/+11
Signed-off-by: Jeff Squyres <jsquyres@cisco.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-09-14Fix fall-through bug in options case in pingpong examplesRobert Pearson2-0/+2
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>
2009-09-14Do not use enum types for bit flagsJason Gunthorpe11-44/+45
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>
2009-09-02Update Debian Standards-Version to 3.8.3Roland Dreier2-3/+3
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-09-02Change Debian build system from cdbs to debhelper 7Roland Dreier4-8/+8
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>
2009-08-24Use AC_GNU_SOURCE in configure.in instead of -D_GNU_SOURCE in MakefileRoland Dreier2-5/+6
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-08-24Enable quiet build rules with automake 1.11+Roland Dreier1-0/+1
Conditionally use the new AM_SILENT_RULES macro in configure.in. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-08-24Revert "Update build system to use shave"Roland Dreier5-324/+1
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>
2009-07-22Make the gid argument to ibv_attach_mcast and ibv_detach_mcast constJason Gunthorpe5-12/+12
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>
2009-07-16Allow config file paths to the driver library to be absoluteJason Gunthorpe1-0/+2
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>
2009-06-25Merge branch 'stable'Roland Dreier2-2/+9
2009-06-25Update Debian policy version to 3.8.2Roland Dreier2-2/+3
None of the changes 3.7.3 -> 3.8.2 affect us. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-06-25Move -dbg Debian package to section debugRoland Dreier2-1/+7
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-06-24Update build system to use shaveRoland Dreier5-1/+324
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>
2008-11-04Update Dotan's emailDotan Barak34-34/+34
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>
2008-08-20Implement PPC wmb() with sync instead of eieioShirley Ma1-1/+1
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>
2008-06-24Revert conversion of ibv_devinfo to use ibv_port_state_str()Roland Dreier1-1/+12
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>
2008-05-27Code formatting cleanupsDotan Barak5-9/+8
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>
2008-04-21Update Debian packaging to include new manpage symlinksRoland Dreier1-0/+2
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-18Include NMU changes for version 1.1.1-1.1 in Debian changelogRoland Dreier1-0/+8
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-18Change .nl macro in man pages to .spRoland Dreier15-19/+19
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>
2008-04-18Roll libibverbs 1.1.2 releaselibibverbs-1.1.2Roland Dreier4-10/+15
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-18Add RPM dependency on base package to -devel packageRoland Dreier1-0/+2
This fixes the rpmlint warning libibverbs-devel.x86_64: W: no-dependency-on libibverbs Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-18Correct typo ibv_mult_to_rate -> mult_to_ibv_rate in man pageRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-18Add functions to convert enum values to stringsIra Weiny10-33/+218
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>
2008-04-18Update various text to talk about general RDMA, not just InfiniBandRoland Dreier19-74/+91
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>
2008-03-30Fix download directory in RPM spec fileRoland Dreier1-1/+1
libibverbs sources are now in downloads/verbs/, not just downloads/ Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-03-19Add command line parameter to set SL for pingpong examplesDotan Barak8-37/+81
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>
2008-03-12Add debian/watch fileRoland Dreier2-1/+5
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-03-09Fix valgrind false positive in ibv_create_comp_channel()Troy Benjegerdes1-0/+2
Need to mark response buffer as defined after write() succeeds. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-02-18Document IBV_SEND_INLINE buffer ownershipOr Gerlitz2-1/+6
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>
2008-02-18Fixes for man pagesDotan Barak10-13/+33
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>
2008-02-18Fix some issues in the examplesDotan Barak6-35/+58
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>
2008-02-15Fix several valgrind false positivesDotan Barak1-2/+14
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>
2008-02-12Put correct version information in Debian shlibsRoland Dreier2-1/+5
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>
2008-01-23Convert hyphen to minus sign in ibv_query_pkey man pageRoland Dreier1-1/+1
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>
2008-01-21Use real Homepage: tag instead of pseudo-header inside descriptionRoland Dreier1-8/+1
New dpkg can actually parse Homepage: fields in debian/control. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-12-03Update Debian policy version to 3.7.3Roland Dreier1-1/+1
None of the changes 3.7.2 -> 3.7.3 affect us. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-20Always return valid bad_wr on error from ibv_post_{send,recv,srq_recv}Roland Dreier1-3/+6
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>
2007-10-26Fix spec file License: tagRoland Dreier1-1/+1
Our license information is properly described as "GPLv2 or BSD". Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-10-09Set ibv_device->node_type when allocating deviceswelch@systemfabricworks.com1-6/+5
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>
2007-08-13Initialize reserved attributes in modify QP commandDotan Barak1-0/+2
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>
2007-07-10Fix too-big madvise() call in ibv_madvise_range()Roland Dreier1-3/+18
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>
2007-07-03Fix Valgrind annotations so they can actually be builtRoland Dreier1-5/+6
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>
2007-07-03Clean up NVALGRIND comment in config.h.inRoland Dreier1-1/+1
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>
2007-06-26Add <stdint.h> to <infiniband/arch.h>Roland Dreier1-0/+1
<infiniband/arch.h> uses uint64_t, so it needs to include <stdint.h>. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-06-21Remove deprecated ${Source-Version} from debian/controlRoland Dreier2-3/+9
Replace ${Source-Version} with the more-correct ${binary:Version}. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-06-15Roll libibverbs 1.1.1 releaselibibverbs-1.1.1Roland Dreier3-4/+17
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-06-03Merge branch 'master' into stableRoland Dreier1-0/+1
2007-06-03Initialize QP state to RESETJack Morgenstein1-0/+1
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>
2007-05-31Merge branch 'master' into stableRoland Dreier10-84/+119
2007-05-30Don't warn root if RLIMIT_MEMLOCK is lowMichael S. Tsirkin1-0/+3
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>
2007-05-17ibv_devinfo: Decode max_vl_num to actual numberDotan Barak1-1/+14
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>
2007-05-17Add wc_wmb()Roland Dreier1-24/+35
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>
2007-05-03Fix call to ibv_free_device_list() in pingpong examplesRoland Dreier4-8/+16
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>
2007-05-03Trivial whitespace fixes in examples/Roland Dreier5-47/+47
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-28Update Debian buildRoland Dreier3-4/+4
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>
2007-04-12Merge branches 'stable' and 'stable-1.0' into stableRoland Dreier0-0/+0
2007-04-12Roll libibverbs 1.1 releaselibibverbs-1.1Roland Dreier3-8/+17
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-11Change a few references from OpenIB to OpenFabricsRoland Dreier3-7/+7
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-09Fix ibv_srq_pingpong option handlingRoland Dreier1-0/+1
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)
2007-04-06Fix ibv_srq_pingpong option handlingRoland Dreier1-0/+1
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>
2007-04-06Add missing newline to rlimit(MEMLOCK) warningRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-04Roll libibverbs 1.1-rc2 releaselibibverbs-1.1-rc2Roland Dreier3-6/+6
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-04Clean up spec fileRoland Dreier1-9/+23
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>
2007-03-29Print warning if memlock limit is lowRoland Dreier1-0/+19
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>
2007-03-29Update README now that 1.1 ABI is (semi-)frozenRoland Dreier1-9/+6
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-03-28Bump version number to 1.1-rc2-pre1Roland Dreier3-6/+6
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-03-27Roll libibverbs 1.1-rc1 releaselibibverbs-1.1-rc1Roland Dreier3-8/+8
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-03-27Man page updatesDotan Barak6-26/+137
- 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>
2007-03-27Reference count completion channelsRoland Dreier4-13/+61
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>
2007-03-19Fix memory leak on ibv_fork_init() error pathDotan Barak1-3/+6
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>
2007-03-08Add low-level driver hooks for reregister MR and memory windowsRoland Dreier1-1/+37
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>
2007-02-22Delete man3 symbolic links before creating them during installJack Morgenstein1-0/+14
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>
2007-02-20Add remaining libibverbs manpagesRoland Dreier28-5/+1862
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>
2007-02-19Start adding libibverbs manpagesRoland Dreier10-1/+209
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>
2007-01-31Update Debian changelogRoland Dreier1-3/+11
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>
2007-01-31Revert "The ibv_cmd_* create functions need to set context"Roland Dreier2-16/+21
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>
2007-01-31Fix unset context breakage when a low-level driver does kernel bypassRoland Dreier1-2/+14
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>
2007-01-29Rename Debian package back to libibverbs1Roland Dreier4-9/+9
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>
2007-01-29Add ABI compatibility for apps linked against libibverbs 1.0Roland Dreier7-60/+1023
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>
2007-01-29The ibv_cmd_* create functions need to set contextRoland Dreier2-21/+16
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)
2007-01-29The ibv_cmd_* create functions need to set contextSteve Wise2-21/+16
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>
2007-01-26Fix caching of --version-script checkRoland Dreier1-2/+8
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>
2007-01-23Add resource cleanup at end of pingpong testsDotan Barak4-4/+222
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>
2007-01-18Fix checks of asprintf() return valueRoland Dreier2-2/+2
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)
2007-01-18Fix checks of asprintf() return valueMichael S. Tsirkin2-2/+2
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>
2007-01-17Check asprintf() return in pingpong examplesDotan Barak4-8/+24
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)
2007-01-17Check asprintf() return in pingpong examplesDotan Barak4-8/+24
Handle asprintf() allocation failures in pingpong examples. Signed-off-by: Dotan Barak <dotanb@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-01-17Check return of calloc() in ibv_get_device_list()Roland Dreier1-0/+4
Don't blindly copy device pointers if calloc() returns NULL. Signed-off-by: Roland Dreier <rolandd@cisco.com> (cherry picked from commit 789728f7be1e6c7f22380ae739d7b692d2c08d0f)
2007-01-17Check return of calloc() in ibv_get_device_list()Roland Dreier1-0/+4
Don't blindly copy device pointers if calloc() returns NULL. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-01-16Fix some memory leaks in read_config() error pathDotan Barak1-2/+3
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>
2007-01-16Handle asprintf memory allocation failuresDotan Barak2-2/+4
Cherry-picked from dd3d43d89e398f23c4824d26f2698446ff2d120f. Signed-off-by: Dotan Barak <dotanb@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-01-16Handle asprintf memory allocation failuresDotan Barak2-2/+4
Signed-off-by: Dotan Barak <dotanb@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-01-11Don't lose devices when multiple RDMA devices are presentSteve Wise1-1/+1
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>
2007-01-11Don't use d_type member of struct direntRoland Dreier1-19/+43
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>
2007-01-11Revert "Pass driver data through ibv_cmd_req_notify_cq()"Roland Dreier2-10/+7
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>
2006-12-10Implement new method for finding and loading device-specific driversRoland Dreier6-168/+350
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>
2006-11-16Pass driver data through ibv_cmd_req_notify_cq()Steve Wise2-7/+10
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>
2006-11-16Fix rewritten test for linker script supportRoland Dreier1-1/+1
Remove extra parameter to AC_SUBST left by mistake. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-16Support provider response data in reg_mr commandSteve Wise2-7/+9
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>
2006-11-16Add async_event callback function to struct ibv_context_opsSteve Wise2-0/+4
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>
2006-11-15Remove svn keywordsRoland Dreier25-50/+0
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)
2006-11-13Remove svn keywordsRoland Dreier25-50/+0
Now that we're in git, there's no reason to have $Id in files. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Bump version numberRoland Dreier3-5/+14
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add final Debian changelog for libibverbs 1.0.4Roland Dreier1-1/+4
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Roll libibverbs 1.0.4 releaselibibverbs-1.0.4Roland Dreier1-0/+4
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix previous sq_draining change so it actually buildsRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Return sq_draining properly from query_qpJack Morgenstein3-2/+10
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>
2006-11-09Make device finding work againRoland Dreier2-2/+12
Fix operator precedence issues in how libibverbs-1.0 adds devices to its list. Also change so that devices are reported in the same order as they were in older versions. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix static linking of libibverbs-1.0Roland Dreier4-59/+183
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add rmb() and wmb() to <infiniband/arch.h>Roland Dreier2-2/+36
Update i386/x86_64 versions to use "lock; addl $0"/"lfence" instead of just a compiler barrier, to guard against out-of-order speculative reads. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add README notes about Valgrind memcheck supportJeff Squyres1-0/+33
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add handling of --with-valgrind=<valgrind dir>Roland Dreier1-3/+9
Change libibverbs/libmthca Valgrind support so that --with-valgrind can take an installation directory to look in for Valgrind headers. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Update ChangeLogs to give credit for Valgrind annotationsRoland Dreier1-1/+3
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix up configure test for <valgrind/memcheck.h>Roland Dreier1-2/+6
Print a warning if Valgrind annotations are requested but <valgrind/memcheck.h> is not found. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add Valgrind annotationsRoland Dreier4-0/+86
Add basic Valgrind annotations to libibverbs and libmthca (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>. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Update libibverbs man pages so they don't refer to "OpenIB"Roland Dreier7-7/+7
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Debian packaging improvementsRoland Dreier2-12/+29
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix libibverbs definition of mb() for sparcRoland Dreier2-1/+7
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix ibv_get_device_list() to really NULL-terminate the arrayRoland Dreier2-3/+8
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix minor memory leaksRoland Dreier3-0/+8
The result of asprintf needs to be free when no longer needed. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add IBV_EVENT_CLIENT_REREGISTER to libibverbsLeonid Arsh3-1/+13
Signed-off-by: Leonid Arsh <leonida@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix update to Debian policy 3.7.2Roland Dreier2-2/+2
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Rewrite test for linker script to get rid of Makefile conditionalsRoland Dreier2-11/+6
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix previous sq_draining change so it actually buildsRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Return sq_draining properly from query_qpJack Morgenstein3-2/+10
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>
2006-11-09Minor cleanupsRoland Dreier3-6/+19
Remove unused driver structure member, constify a few things, etc. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add rmb() and wmb() to <infiniband/arch.h>Roland Dreier2-2/+36
Update i386/x86_64 versions to use "lock; addl $0"/"lfence" instead of just a compiler barrier, to guard against out-of-order speculative reads. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add README notes about Valgrind memcheck supportJeff Squyres1-0/+33
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add handling of --with-valgrind=<valgrind dir>Roland Dreier1-3/+9
Change libibverbs Valgrind support so that --with-valgrind can take an installation directory to look in for Valgrind headers. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Update ChangeLogs to give credit for Valgrind annotationsRoland Dreier1-1/+3
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix up configure test for <valgrind/memcheck.h>Roland Dreier1-2/+6
Print a warning if Valgrind annotations are requested but <valgrind/memcheck.h> is not found. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add Valgrind annotationsRoland Dreier4-0/+84
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>. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add node_type and transport_type members to struct ibv_deviceRoland Dreier3-4/+52
This helps apps work with both iWARP and IB devices. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Update libibverbs man pages so they don't refer to "OpenIB"Roland Dreier7-7/+7
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix alignment of work request structuresRoland Dreier2-2/+8
Swap next and wr_id members of struct ibv_send_wr and ibv_recv_wr to allow wr_id to be naturally aligned on 32-bit architectures without padding. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Debian packaging improvementsRoland Dreier2-9/+26
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add response handling to ibv_cmd_resize_cq()Ralph Campbell4-5/+21
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>
2006-11-09Add a request for ChangeLog entries to the READMERoland Dreier1-0/+3
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix formatting of pingpong man pages slightlyRoland Dreier4-25/+25
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Get rid of commas at end of enum listsMichael S. Tsirkin2-2/+7
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>
2006-11-09Simplify Debian package versionRoland Dreier1-2/+2
Use ~ in Debian package version to get sort order of -pre packages correct in a better way. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Bump version numberRoland Dreier3-4/+13
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Make fork() work for verbs consumersRoland Dreier9-131/+475
Add code to libibvers that uses madvise(..., MADV_DONTFORK) to make fork() work for verbs consumers. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Update to debian policy 3.7.0Roland Dreier2-2/+3
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix libibverbs definition of mb() for sparcRoland Dreier2-1/+7
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Use correct email address in Debian changelogRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add some helper functions to simplify using UD QPsSean Hefty6-2/+114
Add new routines: ibv_init_ah_from_wc() and ibv_create_ah_from_wc() to simplify UD QP communication. Expose ibv_copy_ah_attr_from_kern to retrieve ibv_ah_attr from kernel for a UD QP. Signed-off-by: Sean Hefty <sean.hefty@intel.com>
2006-11-09Roll libibverbs 1.0.3 releaselibibverbs-1.0.3Roland Dreier1-0/+4
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix ibv_get_device_list() to really NULL-terminate the arrayRoland Dreier2-1/+6
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix Debian sparc build failureRoland Dreier3-3/+18
Fix build failure with Debian sparc compiler: membar is only supported under V9 ISA. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix minor memory leaksRoland Dreier2-0/+5
The result of asprintf needs to be free when no longer needed. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add IBV_EVENT_CLIENT_REREGISTER to libibverbsLeonid Arsh3-1/+13
Signed-off-by: Leonid Arsh <leonida@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix update to Debian policy 3.7.2Roland Dreier1-2/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Branch a libibverbs-1.0 tree for maintenanceRoland Dreier21-169/+159
Start 1.1 development in main libibverbs tree: - Remove libsysfs use - Remove deprecated symbols Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Fix memory leak in ibv_read_sysfs_file()Roland Dreier2-1/+5
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Reduce dependency on libsysfsRoland Dreier8-66/+154
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. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Deprecate "ib_XXX" namesRoland Dreier6-52/+90
Deprecate various "ib_XXX" names (introduced as part of SA and marshalling code). Preferred versions like "ibv_XXX" are now available. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add ibv_rate_to_mult() and mult_to_ibv_rate() functionsHoang-Nam Nguyen4-0/+54
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Add __attribute_const macro for gcc >= 3Roland Dreier2-0/+13
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2006-11-09Minor Debian packaging tweaksRoland Dreier1-2/+3
Signed-off-by: Roland Dreier <rolandd@cisco.com>