]> git.openfabrics.org - ~shefty/libmlx4.git/log
~shefty/libmlx4.git
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 years agoHandle freeing doorbell records
Roland Dreier [Tue, 22 May 2007 21:13:15 +0000 (14:13 -0700)]
Handle freeing doorbell records

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>
17 years agodebian/rules: Remove DEB_DH_STRIP_ARGS
Roland Dreier [Mon, 21 May 2007 03:25:25 +0000 (20:25 -0700)]
debian/rules: Remove DEB_DH_STRIP_ARGS

We use debhelper compat level 5, so cdbs will handle this automatically.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoCheck if SRQ is full when posting receive
Roland Dreier [Mon, 21 May 2007 03:15:11 +0000 (20:15 -0700)]
Check if SRQ is full when posting receive

Make mlx4_post_srq_recv() fail if the SRQ is full (head == tail).

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoPass send queue sizes from userspace to kernel
Roland Dreier [Mon, 21 May 2007 03:12:15 +0000 (20:12 -0700)]
Pass send queue sizes from userspace to kernel

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>
17 years agoUse wc_wmb() when posting BlueFlame send WQEs
Roland Dreier [Sun, 20 May 2007 18:06:44 +0000 (11:06 -0700)]
Use wc_wmb() when posting BlueFlame send WQEs

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>
17 years agoFix inline send posting when posting more than one request
Jack Morgenstein [Wed, 2 May 2007 14:12:24 +0000 (17:12 +0300)]
Fix inline send posting when posting more than one request

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>
17 years agoUse BlueFlame for inline sends
Roland Dreier [Mon, 23 Apr 2007 22:07:49 +0000 (15:07 -0700)]
Use BlueFlame for inline sends

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>
17 years agoHandle IBV_SEND_INLINE for send work requests
Roland Dreier [Sat, 21 Apr 2007 05:14:14 +0000 (22:14 -0700)]
Handle IBV_SEND_INLINE for send work requests

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>
17 years agoRemove inline keyword from wq_overflow()
Roland Dreier [Sat, 21 Apr 2007 05:08:27 +0000 (22:08 -0700)]
Remove inline keyword from wq_overflow()

Let the compiler decide whether it should be inlined.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoImplement mlx4_cq_clean()
Roland Dreier [Thu, 19 Apr 2007 20:10:36 +0000 (13:10 -0700)]
Implement mlx4_cq_clean()

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>
17 years agoFix paths in Debian install files for libibverbs 1.1
Roland Dreier [Thu, 19 Apr 2007 20:08:36 +0000 (13:08 -0700)]
Fix paths in Debian install files for libibverbs 1.1

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoTrivial whitespace fixes
Roland Dreier [Thu, 19 Apr 2007 18:36:38 +0000 (11:36 -0700)]
Trivial whitespace fixes

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoFix implicit declaration of memset() and memcpy() warnings
Jack Morgenstein [Thu, 19 Apr 2007 09:02:20 +0000 (12:02 +0300)]
Fix implicit declaration of memset() and memcpy() warnings

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>
17 years agoFix CQ size sanity check
Jack Morgenstein [Thu, 19 Apr 2007 08:53:16 +0000 (11:53 +0300)]
Fix CQ size sanity check

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>
17 years agoImplement posting of RDMA and atomic operations
Roland Dreier [Fri, 13 Apr 2007 04:23:59 +0000 (21:23 -0700)]
Implement posting of RDMA and atomic operations

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>
17 years agoSet correct byte_len in completions for atomic operations
Roland Dreier [Thu, 12 Apr 2007 22:20:28 +0000 (15:20 -0700)]
Set correct byte_len in completions for atomic operations

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMultiple SRQ fixes
Roland Dreier [Wed, 11 Apr 2007 06:16:59 +0000 (23:16 -0700)]
Multiple SRQ fixes

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>
17 years agoTrivial whitespace change to line up '='s
Roland Dreier [Wed, 11 Apr 2007 06:14:25 +0000 (23:14 -0700)]
Trivial whitespace change to line up '='s

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoAdd all PCI ids
Roland Dreier [Wed, 11 Apr 2007 03:14:56 +0000 (20:14 -0700)]
Add all PCI ids

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>
17 years agoTrivial whitespace cleanups
Roland Dreier [Tue, 10 Apr 2007 18:24:36 +0000 (11:24 -0700)]
Trivial whitespace cleanups

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoDon't set last byte of GID for non-global address vectors
Roland Dreier [Tue, 10 Apr 2007 17:33:48 +0000 (10:33 -0700)]
Don't set last byte of GID for non-global address vectors

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>
17 years agoRemove unused source file ah.c
Roland Dreier [Tue, 10 Apr 2007 17:31:03 +0000 (10:31 -0700)]
Remove unused source file ah.c

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoImplement handling for completions with error
Roland Dreier [Tue, 10 Apr 2007 03:36:47 +0000 (20:36 -0700)]
Implement handling for completions with error

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>
17 years agoSimplify completion with error handling
Roland Dreier [Tue, 10 Apr 2007 03:20:44 +0000 (20:20 -0700)]
Simplify completion with error handling

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>
17 years agoInitial import of libmlx4 repository
Roland Dreier [Mon, 9 Apr 2007 07:49:42 +0000 (00:49 -0700)]
Initial import of libmlx4 repository

Signed-off-by: Roland Dreier <rolandd@cisco.com>