When creating a new user context, exit if the kernel does not support XRC. (OFED libmlx4 has a compatibility problem). Signed-off-by: Jack Morgenstein Index: libmlx4/src/mlx4.c =================================================================== --- libmlx4.orig/src/mlx4.c 2009-05-10 12:16:33.000000000 +0300 +++ libmlx4/src/mlx4.c 2009-05-10 12:30:06.000000000 +0300 @@ -190,6 +190,12 @@ context->max_qp_wr = dev_attrs.max_qp_wr; context->max_sge = dev_attrs.max_sge; context->max_cqe = dev_attrs.max_cqe; + if (!(dev_attrs.device_cap_flags & IBV_DEVICE_XRC)) { + fprintf(stderr, PFX "There is a mismatch between " + "the kernel and the userspace libraries: " + "Kernel does not support XRC. Exiting.\n"); + goto query_free; + } return &context->ibv_ctx;