Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Follow the advice automake gives us:
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled. For now, the corresponding output
automake: object file(s) will be placed in the top-level directory. However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Patch from Logan Rosen <logan@ubuntu.com> / https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733843
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
The implementation uses the default commands from libibverbs.
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Implement the XRC APIs for libmlx4. Hook the XRC functions as part of
mlx4_init_context(), then make relevant changes on both control and
data path to work properly with XRC.
Main changes include using verbs_qp, verbs_srq, which are extendable
based as part of calling libibverbs command API (i.e. cmd.c), managing
an XRC SRQ table for mapping between mlx4_srq and srqn, differentiating
between IBV_QPT_XRC_SEND and IBV_QPT_XRC_RECV.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Have libmlx4 register with libibverbs with verbs_register_driver() to
indicate that libmlx4 supports verbs extensions, supplying its
verbs_init_func() for further initialization. This will be used to
add XRC support.
Acked-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Tzahi Oved <tzahio@mellanox.com>
[ Update configure script and deb/rpm packaging to check for new enough
libibverbs. - Roland ]
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Since the changes to add verbs extensions / XRC support will break
compatibility with libibverbs < 1.1.8, take this chance to strip out all
the backwards compatibility code that won't make any sense once we do that.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
When calling get_sw_cqe() we need pass the consumer_index and not the
masked value. Failure to do so will cause incorrect result of
get_sw_cqe() possibly leading to endless loop.
Based on a patch by Eli Cohen <eli@dev.mellanox.co.il> fixing the same
bug in the kernel.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
The old sequence of Autotools commands listed in autogen.sh is no longer
correct. Instead, just use the single "autoreconf" command, which will
invoke all the Right Autotools commands in the correct order.
Identical to a libibverbs patch from Jeff Squyres <jsquyres@cisco.com>.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Rename configure.in -> configure.ac to accomodate newer GNU Autotools.
(http://lists.gnu.org/archive/html/autotools-announce/2012-11/msg00000.html
announced the intent to drop support for "configure.in" in future
versions of Autoconf).
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Implement raw packet QPs for Ethernet ports.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
[ Fix to build against old libibverbs without IBV_QPT_RAW_PACKET. - Roland ]
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
When the ibv_query_port() call made by mlx4_modify_qp() fails, the
return value from the latter should indicate the error status of the
former and not simply -1.
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Change the enumeration names of the masked atomic opcodes to be
consistent with the ones used by the mlx4 kernel driver.
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Use Blue-Flame for RDMA Write and RDMA Write with immediate without
any data (no s/g). This improves latency for those messages.
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Increase the maximum size of messages (from 192 to 208) that will use
the Blue Flame buffer -- the old code will not use the buffer if the
size to be copied fits in the buffer exactly.
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
When converting a string to a numeric value, strtol() is safer to use.
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
ConnectX-3 devices can work with 64- or 32-byte CQEs. Using 64-byte
CQEs allows better utilization of new chipsets for higher performance.
This patch reads the configured size of a CQE from the kernel and uses
this size in CQ-related code.
The code is changed to store the per-device ABI version read from the
device uverbs sysfs entry, and uses this to determine the CQE size
if/as advertised by the kernel mlx4_ib driver. Older kernel mlx4_ib
ABI versions are still supported.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Add multicast support for IBoE to the address handle creation flow.
Derived from work by Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
For IBoE, SLs 0-7 are mapped to Ethernet 802.1Q user priority bits
(pbits) which are part of the VLAN tag. SLs 8-15 are reserved.
Under Ethernet, the ConnectX firmware decodes/encodes the four-bit SL
field in various constructs such as QPC / UD WQE / CQE as PPP0 and not
as 0PPP. This matches the fact that within the VLAN tag the pbits are
located in bits 15-13 and not 12-14.
The current code was buggy around this:
- The encoding into the address handle was wrong which resulted in
wrong priority-bits for datagram WQEs.
- Decoding from the CQE was wrong, which resulted in wrong input into
an AH built up from a completion, eg consumers of ibv_init_ah_from_wc().
This is fixed by using PPP0 where appropriate.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
The link layer field is to be used in few flows, including some
fast-path operations such as CQ polling.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
When running IBoE traffic, the hardware places Ethernet fields into
the CQE. This patch adds the ones related to VLANs.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
If an erroneous CQE is polled in the first iteration (i.e. npolled ==
0), we don't update the consumer index and hence the hardware could
get a wrong notion of how many CQEs software polled. Fix this by
updating the doorbell record on error too.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Switch to the modern form of the AM_INIT_AUTOMAKE macro and tell
automake that the libmlx4 package does not follow the GNU standards.
This change makes it possible to use 'autoreconf' for libmlx4.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Align the list of ConnectX devices supported by the library to be the
same as the mlx4 driver from the upstream kernel.
These two simple awk/cut commands can be used to actually validate the
claim made by the changelog:
grep MELLANOX libmlx4.git/src/mlx4.c | grep HCA | awk '{ print $2 }' | cut -d ")" -f 1 > lib
grep MELLANOX linux-2.6.git/drivers/net/mlx4/main.c | awk '{ print $3 }' | cut -d ")" -f 1 > ker
diff lib ker
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
|
|
Add VLAN support for the UD address handle creation flow, where the
VLAN id is taken from the destination GID and the VLAN priority from
the IB SL specified by the application.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
|
|
Modify libmlx4 to support IBoE. The only user space piece to handle
is the creation of UD address handles - the L2 Ethernet attributes
have to be resolved from the DGID. Derived from work by Eli Cohen
<eli@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Also collapse Debian changelog, since 1.0.1 was never uploaded to Debian.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
The man pages for these functions document a positive return of errno, not -1.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch>
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
This fixes multiple lintian warnings such as package-name-doesnt-match-sonames,
pkg-has-shlibs-control-file-but-no-actual-shared-libs etc.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Conditionally use the new AM_SILENT_RULES macro in configure.in.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
This reverts commit aff8bf0a2eb7f6ab3e74d44d0925ca4c7ae887aa. Rather
than using shave, we'll use automake 1.11's native quiet build.
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
Signed-off-by: Roland Dreier <roland@purestorage.com>
|
|
ConnectX requires SRQ WQE scatter entries to be initialized with the
invalid L_Key at SRQ creation time.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Change enum bit flags to int to match libibverbs prototype changes.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Forgot to bump the tarball filename when releasing libmlx4-1.0.1.
Signed-off-by: Sebastien Dugue <sebastien.dugue@bull.net>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Add errno.h and sys/mman.h includes in buf.c for mmap(). The includes
were left out of 87750d1d ("Use mmap(MAP_ANONYMOUS) to allocate queue
buffers") by mistake.
Signed-off-by: Sebastien Dugue <sebastien.dugue@bull.net>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Internal buffers for QPs, CQs, SRQs etc. are allocated with
mlx4_alloc_buf(), which rounds the buffer's size to the page size and
then allocates page aligned memory using posix_memalign().
However, this allocation is quite wasteful on architectures using 64K
pages (ia64 for example) because we then hit glibc's MMAP_THRESHOLD
malloc parameter and chunks are allocated using mmap. Thus we end up
allocating:
(requested size rounded to the page size) + (page size) + (malloc overhead)
rounded internally to the page size.
So for example, if we request a buffer of page_size bytes, we end up
consuming 3 pages. In short, for each buffer we allocate, there is an
overhead of 2 pages. This is quite visible on large clusters where
the number of QPs can reach several thousands.
This patch replaces the call to posix_memalign() in mlx4_alloc_buf()
with a direct call to mmap().
Signed-off-by: Sebastien Dugue <sebastien.dugue@bull.net>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Just use ibv_cmd_* directly. Simplifies the code and fixes const
correctness warnings due to changes in libibverbs.
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>
|
|
Add shave (git://git.lespiau.name/shave) to make build output of libmlx4
much more readable by abbreviating the outputed commands so that
warnings become visible, etc.
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>
|
|
When resizing a CQ, when copying over unpolled CQEs from the old CQE
buffer to the new buffer, the ownership bit must be set appropriately
for the new buffer, or the ownership bit in the new buffer gets
corrupted.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
There is a race in libmlx4 because mlx4_create_qp() and
mlx4_destroy_qp() are not atomic WRT each other. If one thread is
destroying a QP while another is creating a QP, the following can
happen: the destroying thread can be scheduled out after it has
deleted the QP from kernel space, but before it has cleared it from
userspace store (mlx4_clear_qp()). If the other thread creates a QP
during this break, it gets the same QP base number and overwrites the
destroyed QP's entry with mlx4_store_qp(). When the destroying thread
resumes, it clears the new entry from the userspace store via
mlx4_clear_qp.
Fix this by expanding where qp_table_mutex is held to serialize the
full create and destroy operations against each other.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Optimize samping by reading the value of the DS field just before we
stamp, which would give the effective size of the descriptor as used
in the previous post and. Then we stamp only that area, since the rest
of the descriptor is already stamped.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
The current code is mlx4_destroy_qp() cleans completions from the QP
being destroyed out of CQs before calling into the kernel to actually
destroy the QP. This leaves a window where new completions could be
added and left in the CQ, which leads to problems when that completion
is polled. Fix this by cleaning the CQ and removing the QP from the
QP table after the QP is really gone.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Don't risk confusion by using the "%config" macro in the spec file
changelog section. This fixes an rpmlint warning.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
- Don't mark libmlx4.driver as a %config, since it is not user modifiable.
- Change the name of the -devel-static package to plain -devel, since
it would be empty without the static library.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Some memcpy() implementations may use move-string-buffer assembly
instructions, which do not guarantee copy order into the blueflame
buffer. This causes problems when writing into a blueflame buffer, so
use our own copy function instead.
Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Fix the value of pkey_index in completions. Since userspace can't
create QP1, this doesn't matter, but we might as well have correct code.
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
This reverts commit 216b90eac10cc8e11b9abaa710385986e26fbf85.
The extra CQ entry will be required to implement resize CQ.
Reported-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>y
|
|
Rather than byte-swapping cqe->g_mlpath_rqpn each time we extract a
field from it, byte-swap it once into a temporary variable. This
results in smaller, better code.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
The CQE member g_mlpath_rqpn is 32 bits, so we need to use ntohl().
Found by Reuven Amitai of Mellanox.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Future versions of libibverbs will add additional ops to the end of
struct ibv_context. This means that driver libraries should zero the
entire struct ibv_context at allocation time, so that any new ops will
be NULL by default.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
New dpkg can actually parse Header: fields in debian/control.
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>
|
|
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>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
With mlx4 hardware, there is no need to add an extra entry when
creating a CQ. This potentially saves a lot of memory if a consumer
asks for an exact power of 2 entries.
This change works without changing the kernel mlx4_ib driver's ABI by
subtracting 1 from the number of CQ entries before passing the value
to the kernel; the kernel will add 1 and end up with the same value
actually used by libmlx4.
Based on work from Jack Morgenstein <jackm@dev.mellanox.co.il>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Downloads directory on openfabrics.org is downloads/mlx4/ now.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
max_recv_wr must also be non-zero for QPs which are not associated
with an SRQ.
Without this patch, if the userspace caller specifies max_recv_wr == 0
for a non-srq QP, the creation will be rejected in kernel space in
file infiniband/hw/mlx4/qp.c, function set_rq_size():
} else {
/* HW requires >= 1 RQ entry with >= 1 gather entry */
==> NOTE: if (is_user && (!cap->max_recv_wr || !cap->max_recv_sge))
return -EINVAL;
We make sure max_recv_sge is at least 1, but not max_recv_wr.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Return ENOSYS instead of -ENOSYS from mlx4_resize_cq(), since we are
in userspace, not the kernel.
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>
|
|
__always_inline is a kernel macro, so we can't use it in userspace code.
The inline keyword seems to work just as well in the one place libmlx4
uses it, so just change __always_inline to inline.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Fix a thinko bug in commit c45efd89 ("Fix data corruption triggered by
wrong headroom marking order"), which leaves s/g entries being written
in forward (rather than reverse) order.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
This is an addendum to commit 561da8d1 ("Handle new FW requirement for
send request prefetching"). We also need to handle prefetch marking
properly for S/G segments, or else the HCA may end up processing S/G
segments that are not fully written and end up sending the wrong data.
We write S/G segments in reverse order into the WQE, in order to
guarantee that the first dword of all cachelines containing S/G
segments is written last (overwriting the headroom invalidation
pattern). The entire cacheline will thus contain valid data when the
invalidation pattern is overwritten.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Clean up setting WQE segment entries by moving code out of the main
work request posting functions into inline functions. This also lets
the compiler do a better job of optimizing.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
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_driver_init isn't defined anywhere, and the name is just an
obsolete leftover in the linker version script, so delete it.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
A work request with IBV_SEND_INLINE set and more than one gather entry
does not have its data copied into the WQE correctly, because the
offset is not updated properly. Add the missing update of off when a
gather entry does not fill an inline segment exactly.
Signed-off-by: Gleb Natapov <glebn@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
The kernel doesn't know the real size of the send queue so we have to
fill in the info in userspace.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Use BlueFlame for RDMA READ requests too. This improves latency.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
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>
|
|
Also just use hex device IDs plus comments instead of creating defines
that are only used once.
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>
|
|
The release of libibverbs 1.0.3 (which introduced
ibv_read_sysfs_file()) was more than a year ago, so it seems safe for
libmlx4 to depend on it. In fact libmlx4 relies on the recent fix to
libibverbs to set the state of newly created QPs, so libmlx4 wouldn't
have a chance at working with libibverbs 1.0.2 or older anyway. So
remove libmlx4's private implementation of ibv_read_sysfs_file() and
just fail the build if libibverbs doesn't supply the function.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
We need a memory barrier before setting an inline segment byte count
to make sure that all the inline data for a cacheline has been written
before changing the cacheline's byte-count from 0xffffffff to
something valid.
Signed-off-by: Ishai Rabinovitz <ishai@mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Set the value of max_inline_data that is returned in the QP caps from
mlx4_create_qp() after we calculate the real value, rather than just
returning whatever uninitialized junk is in qp->max_inline_data before
it is set.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Hardware requires that inline data segments do not cross a 64 byte
boundary. Make sure that send work requests satisfy this by using
multiple inline data segments when needed.
Based on a patch from Jack Morgenstein <jackm@dev.mellanox.co.il>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
When compacting CQ entries, we need to set the correct value of the
ownership bit in case the value is different between the index we copy
the CQE from and the index we copy it to.
Also correct wrong placement of () when checking QP number: the
"& 0xffffff" should be outside of the parameter to ntohl().
Found by Ronni Zimmerman of Mellanox.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
New ConnectX firmware introduces FW command interface revision 2,
which requires that for each QP, a chunk of send queue entries (the
"headroom") is kept marked as invalid, so that the HCA doesn't get
confused if it prefetches entries that haven't been posted yet. Add
code to libmlx4 to do this.
Also, handle the new kernel ABI that adds the sq_no_prefetch parameter
to the create QP operation. We just hard-code sq_no_prefetch to 0 and
always provide the full SQ headroom for now.
Based on a patch from Jack Morgenstein <jackm@dev.mellanox.co.il>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
When creating a QP that does have a receive queue, make sure that
max_recv_sge is >= 1.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Suppose a consumer posts a list of two WQEs, with the second wqe in
the list being an INLINE which is too long. In this case, post_send
jumps to "out" with: nreq = 1, inl positive, and size in the range
allowing blueflame. All the blueflame test conditions are met.
However, the cntl pointer now points to the invalid wqe, and this will
be "blueflamed".
Fix this by setting inl to 0 before jumping out of the loop.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Cast the increment added to wq->tail when send completions are
processed to uint16_t to avoid using wrong values caused by standard
integer promotions.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
QPs attached to an SRQ must never have their own RQ, and QPs not
attached to SRQs must have an RQ with at least 1 entry. Enforce all
of this in set_rq_size().
Also simplify how we round up queue sizes. There's no need to pass the
context into align_queue_size(), since that parameter is completely
unused, and we don't really need two functions for rounding up to the
next power of two.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Use an explicitly long constant 1UL identical to the type of the
variable holding the bit mask. This avoids using the same bit twice,
because on 64 bit architectures, 1 << 32 == 0.
Found by Dotan Barak at Mellanox.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Fix the calulation of max_inline_data and max_send_sge returned to the
user. Without this fix, the size of the SQ WQEs may increase every
time create QP is called using values returned from a previous call.
For example, here is a quote from the output of the test showing the
problem with a UD QP:
request: cap.max_send_sge = 1, cap.max_inline_data = 0
got: cap.max_send_sge = 5, cap.max_inline_data = 76
request: cap.max_send_sge = 5, cap.max_inline_data = 76
got: cap. max_send_sge = 13, cap.max_inline_data = 204
The problem is that we forgot to subtract the size of the control
segment in mlx4_set_sq_sizes().
Pointed out by Eli Cohen <eli@mellanox.co.il>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
We need to initialize the owner bit of send queue WQEs to hardware
ownership whenever the QP is modified from reset to init, not just
when the QP is first allocated. This avoids having the hardware
process stale WQEs when the QP is moved to reset but not destroyed and
then modified to init again.
This is the same bug fixed in the kernel by Eli Cohen <eli@mellanox.co.il>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
If a QP is attached to a shared receive queue (SRQ), then it doesn't
have a receive queue (RQ). So don't allocate an RQ doorbell.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Actually implement mlx4_free_db() that just naively searches through
all doorbell pages. Also add a doorbell type parameter to the
function to avoid searching through all CQ doorbell pages when we
really want to find an RQ doorbell.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
We use debhelper compat level 5, so cdbs will handle this automatically.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Make mlx4_post_srq_recv() fail if the SRQ is full (head == tail).
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Update to handle kernel mlx4 ABI version 2: pass log_2 of send queue
WQE basic block size and log_2 of number of send queue basic blocks to
the kernel to avoid bugs caused by the kernel calculating a different
send queue WQE size. This will also allow us to use multiple BBs per
WQE if we want to someday.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Use wc_wmb() after copying WQE to BlueFlame register to avoid having
WQEs reach the device out of order if the BlueFlame page is mapped with
write combining.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Need to set inl parameter to zero for each request when posting a list
of requests, so that the value of inl is correct for each work
request, and is not cumulative.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
If BlueFlame is available, map the BlueFlame page when creating a
context and use BlueFlame for inline sends.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
If IBV_SEND_INLINE is set for a send work request, copy the data to be
sent into an inline segment in the WQE.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Let the compiler decide whether it should be inlined.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Fill in the implementation of mlx4_cq_clean(), so we sweep CQ entries
from CQs when a QP is destroyed or moved to the RESET state.
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 a typo -- the include should be <string.h>, not <strings.h>.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
The maximum permissible number of CQEs per CQ for Hermon is 0x3fffff,
so we need to fix the sanity check in mlx4_create_cq() accordingly.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Clean up the definitions of remote address and atomic operations WQE
segments. Fill in the missing code that fills in these segments when
posting RDMA or atomic operations to a send queue.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Several one-liner fixes to SRQ support:
- Scatter entry address is 64 bits, so use htonll() instead of
htonl() when filling in WQE.
- Minimum SRQ WQE size is 32 bytes, so use 5 as a minimum value of
wqe_shift.
- When initializing next_wqe_index values, use htons() to put indices
into big-endian byte order.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
SDR, DDR and QDR IB versions of ConnectX have different PCI device ids
(0x6340, 0x634a and 0x6354). Add all of them to the table of
supported devices.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Previous generation HCAs needed the last byte of the GID set to 2 for
non-global address vectors, but ConnectX just ignores the remote GID
field for non-global AVs, so remove the unnecessary code that sets it.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Convert status from HCA's hardware values to libibverbs enum for
completions with error in mlx4_handle_error_cqe(). Also, there's no
way mlx4_handle_error_cqe() can fail, so there's no reason for it to
return a value.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
The out-of-line function to handle error CQEs doesn't need as many
parameters as the libmthca version did, so get rid of everything
except the CQE pointer and the WC pointer.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|
|
Signed-off-by: Roland Dreier <rolandd@cisco.com>
|