Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Dotan Barak <dotan@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Conditionally use the new AM_SILENT_RULES macro in configure.in.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
None of the changes 3.7.3 -> 3.8.2 affect us.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
This fixes the rpmlint warning
libibverbs-devel.x86_64: W: no-dependency-on libibverbs
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
libibverbs sources are now in downloads/verbs/, not just downloads/
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Need to mark response buffer as defined after write() succeeds.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
New dpkg can actually parse Homepage: fields in debian/control.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
None of the changes 3.7.2 -> 3.7.3 affect us.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Our license information is properly described as "GPLv2 or BSD".
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
<infiniband/arch.h> uses uint64_t, so it needs to include <stdint.h>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Replace ${Source-Version} with the more-correct ${binary:Version}.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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)
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
- 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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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)
|
|
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>
|
|
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>
|
|
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>
|
|
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)
|
|
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>
|
|
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)
|
|
Handle asprintf() allocation failures in pingpong examples.
Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Don't blindly copy device pointers if calloc() returns NULL.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
(cherry picked from commit 789728f7be1e6c7f22380ae739d7b692d2c08d0f)
|
|
Don't blindly copy device pointers if calloc() returns NULL.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Cherry-picked from dd3d43d89e398f23c4824d26f2698446ff2d120f.
Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Dotan Barak <dotanb@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Remove extra parameter to AC_SUBST left by mistake.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
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)
|
|
Now that we're in git, there's no reason to have $Id in files.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Print a warning if Valgrind annotations are requested but
<valgrind/memcheck.h> is not found.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
The result of asprintf needs to be free when no longer needed.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Leonid Arsh <leonida@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Remove unused driver structure member, constify a few things, etc.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Print a warning if Valgrind annotations are requested but
<valgrind/memcheck.h> is not found.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
This helps apps work with both iWARP and IB devices.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
While comma at end of enumerator list is legal since 1999, some tools
(notably gcc versions pre-4.0) seem to default to 1989 mode when
running with -pedantic flag, and warn about this usage.
Since most of our enums in header files do not have comma at end, its
probably easier to fix the remaining two cases than educate all users
of libibverbs on virtues of C99.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Add code to libibvers that uses madvise(..., MADV_DONTFORK) to make
fork() work for verbs consumers.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Fix build failure with Debian sparc compiler: membar is only supported
under V9 ISA.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
The result of asprintf needs to be free when no longer needed.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Leonid Arsh <leonida@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Start 1.1 development in main libibverbs tree:
- Remove libsysfs use
- Remove deprecated symbols
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|