~shefty/libmlx4.git
7 years agolibmlx4: Add support for XRC QPs master xrc
Sean Hefty [Tue, 18 Sep 2012 18:24:19 +0000 (11:24 -0700)]
libmlx4: Add support for XRC QPs

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
8 years agolibmlx4: Infra-structure changes to support verbs extensions
Yishai Hadas [Sun, 26 Aug 2012 14:00:34 +0000 (17:00 +0300)]
libmlx4: Infra-structure changes to support verbs extensions

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Tzahi Oved <tzahio@mellanox.com>
8 years agoRoll libmlx4 1.0.4 release
Roland Dreier [Wed, 28 Mar 2012 17:56:58 +0000 (10:56 -0700)]
Roll libmlx4 1.0.4 release

Signed-off-by: Roland Dreier <roland@purestorage.com>
8 years agoUpdate maintainer now that I'm a DD
Roland Dreier [Wed, 28 Mar 2012 17:30:05 +0000 (10:30 -0700)]
Update maintainer now that I'm a DD

Signed-off-by: Roland Dreier <roland@purestorage.com>
8 years agoAdd IBoE multicast support
Shawn Bohrer [Fri, 24 Feb 2012 16:32:30 +0000 (10:32 -0600)]
Add IBoE multicast support

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>
8 years agoRoll libmlx4 1.0.3 release
Roland Dreier [Mon, 26 Mar 2012 16:40:39 +0000 (09:40 -0700)]
Roll libmlx4 1.0.3 release

Signed-off-by: Roland Dreier <roland@purestorage.com>
8 years agoFix IBoE SL -> 802.1Q priority-bits mapping
Or Gerlitz [Sun, 11 Dec 2011 14:45:40 +0000 (16:45 +0200)]
Fix IBoE SL -> 802.1Q priority-bits mapping

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>
8 years agoAdd link_layer field to mlx4 QPs
Or Gerlitz [Sun, 11 Dec 2011 14:44:13 +0000 (16:44 +0200)]
Add link_layer field to mlx4 QPs

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>
8 years agoUse Ethernet 802.1Q VLAN-related fields in CQE
Or Gerlitz [Sun, 11 Dec 2011 14:42:22 +0000 (16:42 +0200)]
Use Ethernet 802.1Q VLAN-related fields in CQE

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>
8 years agoFix possible missed completion event
Roland Dreier [Wed, 7 Mar 2012 01:30:40 +0000 (17:30 -0800)]
Fix possible missed completion event

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>
9 years agoAdd "foreign" option to AM_INIT_AUTOMAKE
Roland Dreier [Thu, 11 Aug 2011 16:35:20 +0000 (09:35 -0700)]
Add "foreign" option to AM_INIT_AUTOMAKE

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>
9 years agoAlign the list of supported ConnectX devices with kernel
Or Gerlitz [Tue, 19 Jul 2011 09:36:13 +0000 (09:36 +0000)]
Align the list of supported ConnectX devices with kernel

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>
9 years agoAdd IBoE UD/VLANs support
Or Gerlitz [Tue, 19 Jul 2011 09:34:15 +0000 (09:34 +0000)]
Add IBoE UD/VLANs support

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>
9 years agoAdd IBoE support
Or Gerlitz [Tue, 19 Jul 2011 09:32:52 +0000 (09:32 +0000)]
Add IBoE support

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>
9 years agoMoving plugin out of /usr/lib means we now depend on libibverbs 1.1.3
Roland Dreier [Thu, 7 Jul 2011 06:55:04 +0000 (23:55 -0700)]
Moving plugin out of /usr/lib means we now depend on libibverbs 1.1.3

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoAcknowledge Debian NMU
Roland Dreier [Wed, 6 Jul 2011 20:45:45 +0000 (13:45 -0700)]
Acknowledge Debian NMU

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoUpdate to Debian standards version 3.9.2
Roland Dreier [Wed, 6 Jul 2011 20:33:08 +0000 (13:33 -0700)]
Update to Debian standards version 3.9.2

Also collapse Debian changelog, since 1.0.1 was never uploaded to Debian.

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoRoll libmlx4 1.0.2 release
Roland Dreier [Wed, 6 Jul 2011 16:16:33 +0000 (09:16 -0700)]
Roll libmlx4 1.0.2 release

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoReturn ERRNO codes from ibv_post_send/recv instead of -1
Jason Gunthorpe [Wed, 9 Mar 2011 01:28:10 +0000 (01:28 +0000)]
Return ERRNO codes from ibv_post_send/recv instead of -1

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>
9 years agoMove plugin .so to /usr/lib/libibverbs
Roland Dreier [Wed, 6 Jul 2011 08:29:09 +0000 (01:29 -0700)]
Move plugin .so to /usr/lib/libibverbs

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>
9 years agoEnable quiet build rules with automake 1.11+
Roland Dreier [Wed, 6 Jul 2011 08:26:04 +0000 (01:26 -0700)]
Enable quiet build rules with automake 1.11+

Conditionally use the new AM_SILENT_RULES macro in configure.in.

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoRevert "Update build system to use shave"
Roland Dreier [Wed, 6 Jul 2011 08:25:22 +0000 (01:25 -0700)]
Revert "Update build system to use shave"

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>
9 years agoSmall configure.in modernizations
Roland Dreier [Wed, 6 Jul 2011 08:24:46 +0000 (01:24 -0700)]
Small configure.in modernizations

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoChange Debian build system from cdbs to debhelper 7
Roland Dreier [Wed, 6 Jul 2011 08:23:36 +0000 (01:23 -0700)]
Change Debian build system from cdbs to debhelper 7

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoDon't ship .la files in Debian libmlx4-dev
Roland Dreier [Wed, 6 Jul 2011 08:18:10 +0000 (01:18 -0700)]
Don't ship .la files in Debian libmlx4-dev

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoNote that we fix Debian bug about maintainer address in Debian changelog
Roland Dreier [Wed, 6 Jul 2011 08:16:51 +0000 (01:16 -0700)]
Note that we fix Debian bug about maintainer address in Debian changelog

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoConvert to new 3.0 (quilt) source format.
Roland Dreier [Tue, 5 Jul 2011 22:20:23 +0000 (15:20 -0700)]
Convert to new 3.0 (quilt) source format.

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

Signed-off-by: Roland Dreier <roland@purestorage.com>
9 years agoPackage description shouldn't start with an article
Roland Dreier [Tue, 26 Apr 2011 21:03:00 +0000 (14:03 -0700)]
Package description shouldn't start with an article

Signed-off-by: Roland Dreier <roland@purestorage.com>
10 years agoInitialize SRQ scatter entries when creating an SRQ
Jack Morgenstein [Thu, 17 Dec 2009 15:15:40 +0000 (17:15 +0200)]
Initialize SRQ scatter entries when creating an SRQ

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>
11 years agoUpdate function prototypes to match libibverbs enum type change
Jason Gunthorpe [Thu, 23 Jul 2009 16:03:12 +0000 (10:03 -0600)]
Update function prototypes to match libibverbs enum type change

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>
11 years agoFix version in taball filename in RPM spec file
Sebastien Dugue [Mon, 3 Aug 2009 20:47:43 +0000 (13:47 -0700)]
Fix version in taball filename in RPM spec file

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>
11 years agommap() needs some includes
Sebastien Dugue [Mon, 3 Aug 2009 13:40:01 +0000 (15:40 +0200)]
mmap() needs some includes

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>
11 years agoUse mmap(MAP_ANONYMOUS) to allocate queue buffers
Sebastien Dugue [Wed, 29 Jul 2009 18:45:55 +0000 (11:45 -0700)]
Use mmap(MAP_ANONYMOUS) to allocate queue buffers

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>
11 years agoRemove empty stubs for detach/attach_mcast
Jason Gunthorpe [Mon, 20 Jul 2009 22:37:24 +0000 (16:37 -0600)]
Remove empty stubs for detach/attach_mcast

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>
11 years agoRoll libmlx4-1.0.1 release
Roland Dreier [Wed, 17 Jun 2009 18:00:51 +0000 (11:00 -0700)]
Roll libmlx4-1.0.1 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
11 years agoMerge spec file changelog from Fedora
Roland Dreier [Wed, 17 Jun 2009 17:53:29 +0000 (10:53 -0700)]
Merge spec file changelog from Fedora

Signed-off-by: Roland Dreier <rolandd@cisco.com>
11 years agoMove -dbg Debian package to section debug
Roland Dreier [Wed, 17 Jun 2009 17:27:02 +0000 (10:27 -0700)]
Move -dbg Debian package to section debug

Signed-off-by: Roland Dreier <rolandd@cisco.com>
11 years agoUpdate build system to use shave
Roland Dreier [Wed, 17 Jun 2009 17:21:49 +0000 (10:21 -0700)]
Update build system to use shave

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>
11 years agoUpdate Debian policy version to 3.8.2
Roland Dreier [Wed, 17 Jun 2009 17:04:49 +0000 (10:04 -0700)]
Update Debian policy version to 3.8.2

None of the changes 3.7.3 -> 3.8.2 affect us.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
11 years agoSet ownership bit correctly when copying over CQEs during CQ resize
Jack Morgenstein [Sun, 14 Dec 2008 16:14:20 +0000 (18:14 +0200)]
Set ownership bit correctly when copying over CQEs during CQ resize

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>
11 years agoFix race between create QP and destroy QP
Jack Morgenstein [Tue, 25 Nov 2008 06:40:07 +0000 (08:40 +0200)]
Fix race between create QP and destroy QP

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>
12 years agoOptimize QP stamping
Eli Cohen [Mon, 16 Jun 2008 08:09:18 +0000 (11:09 +0300)]
Optimize QP stamping

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>
12 years agoImplement resize CQ
Vladimir Sokolovsky [Mon, 31 Mar 2008 08:51:18 +0000 (11:51 +0300)]
Implement resize CQ

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoFix CQ cleanup when QP is destroyed
Roland Dreier [Fri, 4 Apr 2008 19:14:57 +0000 (12:14 -0700)]
Fix CQ cleanup when QP is destroyed

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>
12 years agoChange openib.org URLs to openfabrics.org URLs
Roland Dreier [Mon, 31 Mar 2008 01:31:31 +0000 (18:31 -0700)]
Change openib.org URLs to openfabrics.org URLs

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoAdd debian/watch file
Roland Dreier [Wed, 12 Mar 2008 17:35:53 +0000 (10:35 -0700)]
Add debian/watch file

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoUpdate RPM spec changelog to avoid a macro
Roland Dreier [Mon, 28 Jan 2008 21:33:39 +0000 (13:33 -0800)]
Update RPM spec changelog to avoid a macro

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>
12 years agoSpec file cleanups based on Fedora review
Roland Dreier [Mon, 28 Jan 2008 04:30:03 +0000 (20:30 -0800)]
Spec file cleanups based on Fedora review

 - 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>
12 years agoDon't use memcpy() to write blueflame sends
Jack Morgenstein [Thu, 24 Jan 2008 23:53:26 +0000 (15:53 -0800)]
Don't use memcpy() to write blueflame sends

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>
12 years agoFix value of pkey_index in QP1 completions
Dotan Barak [Fri, 11 Jan 2008 19:04:22 +0000 (11:04 -0800)]
Fix value of pkey_index in QP1 completions

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>
12 years agoRevert "Don't add an extra entry to CQs"
Roland Dreier [Thu, 10 Jan 2008 17:52:14 +0000 (09:52 -0800)]
Revert "Don't add an extra entry to CQs"

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
12 years agoMicro-optimize mlx4_poll_one()
Roland Dreier [Fri, 4 Jan 2008 03:59:05 +0000 (19:59 -0800)]
Micro-optimize mlx4_poll_one()

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>
12 years agoFix test for GRH presence in mlx4_poll_one()
Jack Morgenstein [Mon, 24 Dec 2007 11:54:01 +0000 (13:54 +0200)]
Fix test for GRH presence in mlx4_poll_one()

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>
12 years agoClear context struct at allocation time
Jack Morgenstein [Mon, 17 Dec 2007 08:19:21 +0000 (10:19 +0200)]
Clear context struct at allocation time

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>
12 years agoUse real Homepage: tag instead of pseudo-header inside description
Roland Dreier [Sat, 15 Dec 2007 06:15:11 +0000 (22:15 -0800)]
Use real Homepage: tag instead of pseudo-header inside description

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

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoAdd Closes: tag for Debian ITP bug
Roland Dreier [Fri, 14 Dec 2007 21:29:20 +0000 (13:29 -0800)]
Add Closes: tag for Debian ITP bug

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoMove to using cdbs to generate Debian/control for better Build-depends
Roland Dreier [Fri, 14 Dec 2007 18:02:11 +0000 (10:02 -0800)]
Move to using cdbs to generate Debian/control for better Build-depends

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoUpdate Debian version to 1.0-1
Roland Dreier [Fri, 14 Dec 2007 17:51:59 +0000 (09:51 -0800)]
Update Debian version to 1.0-1

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoRoll libmlx4 1.0 release
Roland Dreier [Sun, 9 Dec 2007 19:07:55 +0000 (11:07 -0800)]
Roll libmlx4 1.0 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoUpdate summary line to mention "ConnectX" in Fedora RPM spec file
Roland Dreier [Mon, 3 Dec 2007 22:05:58 +0000 (14:05 -0800)]
Update summary line to mention "ConnectX" in Fedora RPM spec file

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

None of the changes 3.7.2 -> 3.7.3 affect us.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoRoll libmlx4-1.0-rc1 release
Roland Dreier [Fri, 30 Nov 2007 21:54:03 +0000 (13:54 -0800)]
Roll libmlx4-1.0-rc1 release

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoUse DEB_AUTO_UPDATE_LIBTOOL to avoid setting RPATH
Roland Dreier [Sat, 1 Dec 2007 00:06:30 +0000 (16:06 -0800)]
Use DEB_AUTO_UPDATE_LIBTOOL to avoid setting RPATH

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoMark "driver" file in sysconfdir with %config
Roland Dreier [Fri, 30 Nov 2007 23:31:10 +0000 (15:31 -0800)]
Mark "driver" file in sysconfdir with %config

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoDon't add an extra entry to CQs
Roland Dreier [Thu, 29 Nov 2007 22:52:36 +0000 (14:52 -0800)]
Don't add an extra entry to CQs

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>
12 years agoUpdate download URL
Roland Dreier [Thu, 29 Nov 2007 22:44:45 +0000 (14:44 -0800)]
Update download URL

Downloads directory on openfabrics.org is downloads/mlx4/ now.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agoSlightly improve wording in README
Roland Dreier [Thu, 29 Nov 2007 22:42:31 +0000 (14:42 -0800)]
Slightly improve wording in README

Signed-off-by: Roland Dreier <rolandd@cisco.com>
12 years agomax_recv_wr must be > 0 for non-SRQ QPs
Jack Morgenstein [Wed, 28 Nov 2007 10:44:20 +0000 (12:44 +0200)]
max_recv_wr must be > 0 for non-SRQ QPs

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>
12 years agoReturn ENOSYS instead of -ENOSYS
Gleb Natapov [Wed, 28 Nov 2007 15:15:07 +0000 (17:15 +0200)]
Return ENOSYS instead of -ENOSYS

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>
13 years agoFix spec file License: tag
Roland Dreier [Fri, 26 Oct 2007 20:11:21 +0000 (13:11 -0700)]
Fix spec file License: tag

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

Signed-off-by: Roland Dreier <rolandd@cisco.com>
13 years agoChange __always_inline to inline
Roland Dreier [Tue, 23 Oct 2007 18:44:24 +0000 (11:44 -0700)]
Change __always_inline to inline

__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>
13 years agoFix thinko in headroom marking order commit
Jack Morgenstein [Mon, 22 Oct 2007 13:30:39 +0000 (15:30 +0200)]
Fix thinko in headroom marking order commit

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>
13 years agoFix data corruption triggered by wrong headroom marking order
Jack Morgenstein [Thu, 20 Sep 2007 18:22:37 +0000 (11:22 -0700)]
Fix data corruption triggered by wrong headroom marking order

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>
13 years agoFactor out setting WQE segment entries
Roland Dreier [Wed, 19 Sep 2007 03:41:11 +0000 (20:41 -0700)]
Factor out setting WQE segment entries

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>
13 years agoReset RQ doorbell counter to 0 when QP is reset
Michael S. Tsirkin [Sun, 9 Sep 2007 09:01:21 +0000 (12:01 +0300)]
Reset RQ doorbell counter to 0 when QP is reset

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
13 years agolibmlx4 has no ChangeLog, so remove mention from spec file
Roland Dreier [Tue, 21 Aug 2007 14:29:46 +0000 (07:29 -0700)]
libmlx4 has no ChangeLog, so remove mention from spec file

Signed-off-by: Roland Dreier <rolandd@cisco.com>
13 years agoKernel module is called mlx4_ib, not ib_mlx4
Roland Dreier [Tue, 21 Aug 2007 14:28:58 +0000 (07:28 -0700)]
Kernel module is called mlx4_ib, not ib_mlx4

Signed-off-by: Roland Dreier <rolandd@cisco.com>
13 years agoRemove ibv_driver_init from linker version script
Roland Dreier [Wed, 8 Aug 2007 20:10:05 +0000 (13:10 -0700)]
Remove ibv_driver_init from linker version script

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>
13 years agoFix inline sends with num_sge > 1
Gleb Natapov [Tue, 24 Jul 2007 12:14:40 +0000 (15:14 +0300)]
Fix inline sends with num_sge > 1

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>
13 years agoFill in send queue sizes in userspace query QP function
Jack Morgenstein [Wed, 18 Jul 2007 04:07:44 +0000 (21:07 -0700)]
Fill in send queue sizes in userspace query QP function

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>
13 years agoUse BlueFlame for RDMA_READ work requests too
Jack Morgenstein [Thu, 21 Jun 2007 09:01:58 +0000 (12:01 +0300)]
Use BlueFlame for RDMA_READ work requests too

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>
13 years agoFix Valgrind annotations so they can actually be built
Roland Dreier [Tue, 3 Jul 2007 18:55:03 +0000 (11:55 -0700)]
Fix Valgrind annotations so they can actually be built

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

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

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

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

Signed-off-by: Roland Dreier <rolandd@cisco.com>
13 years agoAdd new device IDs for PCIe gen2 HCAs
Roland Dreier [Tue, 3 Jul 2007 03:45:40 +0000 (20:45 -0700)]
Add new device IDs for PCIe gen2 HCAs

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>
13 years agoRemove deprecated ${Source-Version} from debian/control
Roland Dreier [Thu, 21 Jun 2007 19:00:47 +0000 (12:00 -0700)]
Remove deprecated ${Source-Version} from debian/control

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

Signed-off-by: Roland Dreier <rolandd@cisco.com>
13 years agoRemove private implementation of ibv_read_sysfs_file()
Roland Dreier [Tue, 19 Jun 2007 02:17:54 +0000 (19:17 -0700)]
Remove private implementation of ibv_read_sysfs_file()

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>
13 years agoAdd a memory barrier before setting an inline data segment's byte count
Jack Morgenstein [Mon, 18 Jun 2007 16:27:45 +0000 (09:27 -0700)]
Add a memory barrier before setting an inline data segment's byte count

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>
13 years agoFix returned max_inline_data QP cap
Roland Dreier [Sat, 16 Jun 2007 21:27:38 +0000 (14:27 -0700)]
Fix returned max_inline_data QP cap

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>
13 years agoMake sure inline segments in send WQEs don't cross 64 byte boundaries
Roland Dreier [Thu, 14 Jun 2007 20:23:33 +0000 (13:23 -0700)]
Make sure inline segments in send WQEs don't cross 64 byte boundaries

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>
13 years agoHandle buffer wraparound in mlx4_cq_clean()
Jack Morgenstein [Wed, 13 Jun 2007 20:34:30 +0000 (13:34 -0700)]
Handle buffer wraparound in mlx4_cq_clean()

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>
13 years agoHandle new FW requirement for send request prefetching
Roland Dreier [Wed, 13 Jun 2007 17:31:16 +0000 (10:31 -0700)]
Handle new FW requirement for send request prefetching

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>
13 years agoMake sure RQs have max_recv_sge >= 1
Roland Dreier [Mon, 11 Jun 2007 21:55:23 +0000 (14:55 -0700)]
Make sure RQs have max_recv_sge >= 1

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>
13 years agoFix problem with inline WQE in post_send error flow
Jack Morgenstein [Mon, 11 Jun 2007 15:09:50 +0000 (18:09 +0300)]
Fix problem with inline WQE in post_send error flow

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>
13 years agoFix handling of wq->tail for send completions
Eli Cohen [Mon, 11 Jun 2007 21:43:26 +0000 (14:43 -0700)]
Fix handling of wq->tail for send completions

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>
13 years agoMake sure RQ allocation is always valid
Roland Dreier [Thu, 7 Jun 2007 21:11:02 +0000 (14:11 -0700)]
Make sure RQ allocation is always valid

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>
13 years agoFix word size in doorbell allocator bitmaps
Eli Cohen [Mon, 4 Jun 2007 14:16:35 +0000 (17:16 +0300)]
Fix word size in doorbell allocator bitmaps

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>
13 years agoFix max_send_sge and max_inline_data returned from create QP
Roland Dreier [Tue, 29 May 2007 18:31:04 +0000 (11:31 -0700)]
Fix max_send_sge and max_inline_data returned from create QP

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>
13 years agoInitialize send queue entry ownership bits
Roland Dreier [Thu, 24 May 2007 20:58:20 +0000 (13:58 -0700)]
Initialize send queue entry ownership bits

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>
13 years agoDon't allocate RQ doorbell if using SRQ
Roland Dreier [Wed, 23 May 2007 22:25:06 +0000 (15:25 -0700)]
Don't allocate RQ doorbell if using SRQ

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>