XRC implementation, consolidated:
xrc ops were moved to their own structure at the end of
struct ibv_context (to preserve binary compatibility).
Check for ibv_context.xrc_ops member via AC_CHECK_MEMBER
XRC QPs have MSB set in qp number, for identification in
completion handling.
Various bug fixes.
(OFED 1.3 commit 39fe7f47e8fc07f356098df048d00740ba585fc5)
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Index: libmlx4/configure.in
===================================================================
--- libmlx4.orig/configure.in 2008-01-30 10:33:08.000000000 +0200
+++ libmlx4/configure.in 2008-06-23 09:04:50.000000000 +0300
@@ -42,6 +42,9 @@ AC_CHECK_HEADER(valgrind/memcheck.h,
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_CHECK_SIZEOF(long)
+AC_CHECK_MEMBER(struct ibv_context.xrc_ops,
+ [AC_DEFINE([HAVE_IBV_XRC_OPS], 1, [Define to 1 if xrc_ops is a member of ibv_context])],,
+ [#include <infiniband/verbs.h>])
dnl Checks for library functions
AC_CHECK_FUNC(ibv_read_sysfs_file, [],
Index: libmlx4/src/cq.c
===================================================================
--- libmlx4.orig/src/cq.c 2008-06-03 15:41:58.000000000 +0300
+++ libmlx4/src/cq.c 2008-06-23 09:04:50.000000000 +0300
@@ -196,10 +196,12 @@ static int mlx4_poll_one(struct mlx4_cq
struct mlx4_cqe *cqe;
struct mlx4_srq *srq;
uint32_t qpn;
+ uint32_t srqn;
uint32_t g_mlpath_rqpn;
uint16_t wqe_index;
int is_error;
int is_send;
+ int is_src_recv = 0;
cqe = next_cqe_sw(cq);
if (!cqe)
@@ -221,20 +223,30 @@ static int mlx4_poll_one(struct mlx4_cq
is_error = (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) ==
MLX4_CQE_OPCODE_ERROR;
- if (!*cur_qp ||
- (ntohl(cqe->my_qpn) & 0xffffff) != (*cur_qp)->ibv_qp.qp_num) {
- /*
- * We do not have to take the QP table lock here,
- * because CQs will be locked while QPs are removed
- * from the table.
- */
- *cur_qp = ...