freebsd-skq/contrib/ofed/libmlx4/fixes/xrc_kernel_user_mismatch.patch
2011-03-21 09:58:24 +00:00

23 lines
810 B
Diff

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 <jackm@dev.mellanox.co.il>
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;