1When creating a new user context, exit if the kernel
2does not support XRC. (OFED libmlx4 has a compatibility problem).
3
4Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
5
6Index: libmlx4/src/mlx4.c
7===================================================================
8--- libmlx4.orig/src/mlx4.c	2009-05-10 12:16:33.000000000 +0300
9+++ libmlx4/src/mlx4.c	2009-05-10 12:30:06.000000000 +0300
10@@ -190,6 +190,12 @@
11 	context->max_qp_wr = dev_attrs.max_qp_wr;
12 	context->max_sge = dev_attrs.max_sge;
13 	context->max_cqe = dev_attrs.max_cqe;
14+	if (!(dev_attrs.device_cap_flags & IBV_DEVICE_XRC)) {
15+		fprintf(stderr, PFX "There is a mismatch between "
16+		        "the kernel and the userspace libraries: "
17+			"Kernel does not support XRC. Exiting.\n");
18+		goto query_free;
19+	}
20 
21 	return &context->ibv_ctx;
22 
23