aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-05-06Roll libmlx4 1.0.6 releaseHEADlibmlx4-1.0.6masterRoland Dreier4-6/+10
Signed-off-by: Roland Dreier <roland@purestorage.com>
2014-05-06Enable subdir-objects for automakeRoland Dreier1-1/+1
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>
2014-05-05Use dh-autoreconf to fix build on ppc64elRoland Dreier3-2/+11
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>
2014-05-05Add receive flow steering supportMatan Barak1-0/+2
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>
2014-01-29Add support for XRC QPsSean Hefty8-95/+453
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>
2014-01-29Update to use libiverbs extension support / verbs_register_driver()Yishai Hadas5-43/+50
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>
2014-01-29Remove compatibility with libibverbs < 1.1.7Roland Dreier8-92/+26
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>
2013-11-15resize_cq: Fix possible endless loop scanning CQRoland Dreier1-1/+1
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>
2013-05-30Roll libmlx4 1.0.5 releaselibmlx4-1.0.5Roland Dreier3-3/+14
Signed-off-by: Roland Dreier <roland@purestorage.com>
2013-05-28configure: Minor updates suggested by autoupdateRoland Dreier1-5/+3
Signed-off-by: Roland Dreier <roland@purestorage.com>
2013-05-21Use autoreconf in autogen.shRoland Dreier1-5/+1
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>
2013-05-21Rename configure.in -> configure.acRoland Dreier1-0/+0
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>
2013-04-03Add raw packet QP supportOr Gerlitz3-0/+21
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>
2013-04-03Have ibv_modify_qp() return right value when ibv_query_port() failsDotan Barak1-2/+4
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>
2013-04-03Change enumeration names for masked atomic opcodesDotan Barak1-2/+2
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>
2013-04-03Use BlueFlame for RDMA Write [with immediate] without dataDotan Barak1-0/+2
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>
2013-04-03Allow using the whole Blue Flame bufferDotan Barak1-1/+1
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>
2013-04-03Replace sscanf() with strtol()Dotan Barak1-2/+2
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>
2013-03-22Add support for 64B CQEsOr Gerlitz5-39/+87
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>
2012-03-28Roll libmlx4 1.0.4 releaselibmlx4-1.0.4Roland Dreier3-5/+8
Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-03-28Update maintainer now that I'm a DDRoland Dreier2-2/+9
Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-03-26Add IBoE multicast supportShawn Bohrer1-7/+32
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>
2012-03-26Roll libmlx4 1.0.3 releaselibmlx4-1.0.3Roland Dreier3-4/+10
Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-03-23Fix IBoE SL -> 802.1Q priority-bits mappingOr Gerlitz2-3/+7
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>
2012-03-23Add link_layer field to mlx4 QPsOr Gerlitz2-0/+10
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>
2012-03-23Use Ethernet 802.1Q VLAN-related fields in CQEOr Gerlitz1-11/+14
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>
2012-03-06Fix possible missed completion eventRoland Dreier1-1/+1
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>
2011-08-11Add "foreign" option to AM_INIT_AUTOMAKERoland Dreier1-1/+1
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>
2011-07-26Align the list of supported ConnectX devices with kernelOr Gerlitz1-0/+22
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>
2011-07-26Add IBoE UD/VLANs supportOr Gerlitz4-3/+10
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>
2011-07-26Add IBoE supportOr Gerlitz4-3/+51
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>
2011-07-06Moving plugin out of /usr/lib means we now depend on libibverbs 1.1.3Roland Dreier2-2/+9
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-06Acknowledge Debian NMURoland Dreier1-1/+8
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-06Update to Debian standards version 3.9.2Roland Dreier2-12/+6
Also collapse Debian changelog, since 1.0.1 was never uploaded to Debian. Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-06Roll libmlx4 1.0.2 releaselibmlx4-1.0.2Roland Dreier3-5/+9
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-06Return ERRNO codes from ibv_post_send/recv instead of -1Jason Gunthorpe1-6/+7
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>
2011-07-06Move plugin .so to /usr/lib/libibverbsRoland Dreier4-2/+15
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>
2011-07-06Enable quiet build rules with automake 1.11+Roland Dreier1-0/+2
Conditionally use the new AM_SILENT_RULES macro in configure.in. Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-06Revert "Update build system to use shave"Roland Dreier5-324/+1
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>
2011-07-06Small configure.in modernizationsRoland Dreier1-2/+3
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-06Change Debian build system from cdbs to debhelper 7Roland Dreier4-7/+10
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-06Don't ship .la files in Debian libmlx4-devRoland Dreier2-2/+3
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-06Note that we fix Debian bug about maintainer address in Debian changelogRoland Dreier1-2/+2
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-05Convert to new 3.0 (quilt) source format.Roland Dreier2-0/+8
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-06-27Set DM-Upload-Allowed now that Roland is a Debian MaintainerRoland Dreier1-1/+2
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-04-26Package description shouldn't start with an articleRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <roland@purestorage.com>
2010-02-08Initialize SRQ scatter entries when creating an SRQJack Morgenstein1-0/+6
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>
2009-09-14Update function prototypes to match libibverbs enum type changeJason Gunthorpe2-8/+8
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>
2009-08-03Fix version in taball filename in RPM spec fileSebastien Dugue1-1/+1
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>
2009-08-03mmap() needs some includesSebastien Dugue1-0/+2
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>
2009-07-29Use mmap(MAP_ANONYMOUS) to allocate queue buffersSebastien Dugue1-8/+7
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>
2009-07-22Remove empty stubs for detach/attach_mcastJason Gunthorpe3-14/+2
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>
2009-06-17Roll libmlx4-1.0.1 releaselibmlx4-1.0.1Roland Dreier3-6/+14
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-06-17Merge spec file changelog from FedoraRoland Dreier1-1/+4
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-06-17Move -dbg Debian package to section debugRoland Dreier2-3/+4
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-06-17Update build system to use shaveRoland Dreier5-1/+324
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>
2009-06-17Update Debian policy version to 3.8.2Roland Dreier2-2/+3
None of the changes 3.7.3 -> 3.8.2 affect us. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-12-24Set ownership bit correctly when copying over CQEs during CQ resizeJack Morgenstein1-0/+2
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>
2008-11-25Fix race between create QP and destroy QPJack Morgenstein2-16/+12
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>
2008-06-23Optimize QP stampingEli Cohen1-1/+3
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>
2008-04-23Implement resize CQVladimir Sokolovsky3-6/+91
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-04Fix CQ cleanup when QP is destroyedRoland Dreier3-18/+18
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>
2008-03-30Change openib.org URLs to openfabrics.org URLsRoland Dreier1-2/+2
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-03-12Add debian/watch fileRoland Dreier2-0/+9
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-01-28Update RPM spec changelog to avoid a macroRoland Dreier1-3/+3
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>
2008-01-27Spec file cleanups based on Fedora reviewRoland Dreier1-5/+12
- 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>
2008-01-24Don't use memcpy() to write blueflame sendsJack Morgenstein1-1/+16
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>
2008-01-11Fix value of pkey_index in QP1 completionsDotan Barak1-1/+1
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>
2008-01-10Revert "Don't add an extra entry to CQs"Roland Dreier2-14/+6
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
2008-01-03Micro-optimize mlx4_poll_one()Roland Dreier1-4/+5
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>
2008-01-03Fix test for GRH presence in mlx4_poll_one()Jack Morgenstein1-1/+1
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>
2007-12-18Clear context struct at allocation timeJack Morgenstein1-1/+1
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>
2007-12-14Use real Homepage: tag instead of pseudo-header inside descriptionRoland Dreier1-6/+1
New dpkg can actually parse Header: fields in debian/control. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-12-14Add Closes: tag for Debian ITP bugRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-12-14Move to using cdbs to generate Debian/control for better Build-dependsRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-12-14Update Debian version to 1.0-1Roland Dreier1-2/+2
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-12-09Roll libmlx4 1.0 releaselibmlx4-1.0Roland Dreier2-4/+7
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-12-03Update summary line to mention "ConnectX" in Fedora RPM spec fileRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-12-03Update Debian policy version to 3.7.3Roland Dreier1-1/+1
None of the changes 3.7.2 -> 3.7.3 affect us. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-30Roll libmlx4-1.0-rc1 releaselibmlx4-1.0-rc1Roland Dreier3-8/+8
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-30Use DEB_AUTO_UPDATE_LIBTOOL to avoid setting RPATHRoland Dreier1-0/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-30Mark "driver" file in sysconfdir with %configRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-29Don't add an extra entry to CQsRoland Dreier2-6/+14
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>
2007-11-29Update download URLRoland Dreier2-2/+2
Downloads directory on openfabrics.org is downloads/mlx4/ now. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-29Slightly improve wording in READMERoland Dreier1-3/+3
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-11-28max_recv_wr must be > 0 for non-SRQ QPsJack Morgenstein1-2/+6
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>
2007-11-28Return ENOSYS instead of -ENOSYSGleb Natapov1-1/+1
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>
2007-10-26Fix spec file License: tagRoland Dreier1-1/+1
Our license information is properly described as "GPLv2 or BSD". Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-10-23Change __always_inline to inlineRoland Dreier1-2/+2
__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>
2007-10-22Fix thinko in headroom marking order commitJack Morgenstein1-1/+1
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>
2007-09-20Fix data corruption triggered by wrong headroom marking orderJack Morgenstein1-3/+20
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>
2007-09-18Factor out setting WQE segment entriesRoland Dreier1-40/+46
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>
2007-09-10Reset RQ doorbell counter to 0 when QP is resetMichael S. Tsirkin1-0/+2
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-08-21libmlx4 has no ChangeLog, so remove mention from spec fileRoland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-08-21Kernel module is called mlx4_ib, not ib_mlx4Roland Dreier1-1/+1
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-08-08Remove ibv_driver_init from linker version scriptRoland Dreier1-1/+0
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>
2007-07-27Fix inline sends with num_sge > 1Gleb Natapov1-0/+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>
2007-07-17Fill in send queue sizes in userspace query QP functionJack Morgenstein1-2/+14
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>
2007-07-10Use BlueFlame for RDMA_READ work requests tooJack Morgenstein1-1/+3
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>
2007-07-03Fix Valgrind annotations so they can actually be builtRoland Dreier1-5/+6
The AC_CHECK_HEADER() test for <valgrind/memcheck.h> will never result in HAVE_VALGRIND_MEMCHECK_H being defined, so ibverbs.h will never include <valgrind/memcheck.h> and Valgrind annotations will never actually get built. Fix this by adding an AC_DEFINE() of HAVE_VALGRIND_MEMCHECK_H if the header is found. Pointed out by Jeff Squyres <jsquyres@cisco.com>. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-07-03Clean up NVALGRIND comment in config.h.inRoland Dreier1-1/+1
Update configure.in so that the comment generated by autoheader for NVALGRIND in config.h.in is a complete sentence to match the style of the rest of the file. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-07-02Add new device IDs for PCIe gen2 HCAsRoland Dreier1-16/+6
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>
2007-06-21Remove deprecated ${Source-Version} from debian/controlRoland Dreier1-3/+3
Replace ${Source-Version} with the more-correct ${binary:Version}. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-06-18Remove private implementation of ibv_read_sysfs_file()Roland Dreier2-38/+3
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>
2007-06-18Add a memory barrier before setting an inline data segment's byte countJack Morgenstein1-0/+13
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>
2007-06-16Fix returned max_inline_data QP capRoland Dreier1-1/+1
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>
2007-06-14Make sure inline segments in send WQEs don't cross 64 byte boundariesRoland Dreier2-29/+92
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>
2007-06-13Handle buffer wraparound in mlx4_cq_clean()Jack Morgenstein1-5/+10
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>
2007-06-13Handle new FW requirement for send request prefetchingRoland Dreier5-46/+94
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>
2007-06-11Make sure RQs have max_recv_sge >= 1Roland Dreier1-0/+2
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>
2007-06-11Fix problem with inline WQE in post_send error flowJack Morgenstein1-0/+1
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>
2007-06-11Fix handling of wq->tail for send completionsEli Cohen1-1/+1
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>
2007-06-07Make sure RQ allocation is always validRoland Dreier2-29/+19
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>
2007-06-04Fix word size in doorbell allocator bitmapsEli Cohen1-2/+2
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>
2007-05-29Fix max_send_sge and max_inline_data returned from create QPRoland Dreier1-3/+2
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>
2007-05-24Initialize send queue entry ownership bitsRoland Dreier3-7/+18
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>
2007-05-23Don't allocate RQ doorbell if using SRQRoland Dreier1-9/+16
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>
2007-05-22Handle freeing doorbell recordsRoland Dreier3-16/+45
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>
2007-05-20debian/rules: Remove DEB_DH_STRIP_ARGSRoland Dreier1-1/+0
We use debhelper compat level 5, so cdbs will handle this automatically. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-05-20Check if SRQ is full when posting receiveRoland Dreier1-0/+7
Make mlx4_post_srq_recv() fail if the SRQ is full (head == tail). Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-05-20Pass send queue sizes from userspace to kernelRoland Dreier5-11/+51
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>
2007-05-20Use wc_wmb() when posting BlueFlame send WQEsRoland Dreier2-1/+18
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>
2007-05-02Fix inline send posting when posting more than one requestJack Morgenstein1-0/+1
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>
2007-04-23Use BlueFlame for inline sendsRoland Dreier5-10/+55
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>
2007-04-20Handle IBV_SEND_INLINE for send work requestsRoland Dreier1-1/+25
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>
2007-04-20Remove inline keyword from wq_overflow()Roland Dreier1-1/+1
Let the compiler decide whether it should be inlined. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-19Implement mlx4_cq_clean()Roland Dreier1-4/+52
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>
2007-04-19Fix paths in Debian install files for libibverbs 1.1Roland Dreier2-2/+3
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-19Trivial whitespace fixesRoland Dreier4-23/+23
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-19Fix implicit declaration of memset() and memcpy() warningsJack Morgenstein1-1/+1
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>
2007-04-19Fix CQ size sanity checkJack Morgenstein1-1/+1
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>
2007-04-12Implement posting of RDMA and atomic operationsRoland Dreier2-25/+54
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>
2007-04-12Set correct byte_len in completions for atomic operationsRoland Dreier1-2/+2
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-10Multiple SRQ fixesRoland Dreier1-4/+3
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>
2007-04-10Trivial whitespace change to line up '='sRoland Dreier1-2/+2
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-10Add all PCI idsRoland Dreier1-3/+13
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>
2007-04-10Trivial whitespace cleanupsRoland Dreier1-8/+8
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-10Don't set last byte of GID for non-global address vectorsRoland Dreier1-3/+0
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>
2007-04-10Remove unused source file ah.cRoland Dreier1-60/+0
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2007-04-09Implement handling for completions with errorRoland Dreier1-26/+71
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>
2007-04-09Simplify completion with error handlingRoland Dreier1-6/+3
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>
2007-04-09Initial import of libmlx4 repositoryRoland Dreier31-0/+3412
Signed-off-by: Roland Dreier <rolandd@cisco.com>