1219820SjeffWhen creating a new user context, exit if the kernel
2219820Sjeffdoes not support XRC. (OFED libmlx4 has a compatibility problem).
3219820Sjeff
4219820SjeffSigned-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
5219820Sjeff
6219820SjeffIndex: libmlx4/src/mlx4.c
7219820Sjeff===================================================================
8219820Sjeff--- libmlx4.orig/src/mlx4.c	2009-05-10 12:16:33.000000000 +0300
9219820Sjeff+++ libmlx4/src/mlx4.c	2009-05-10 12:30:06.000000000 +0300
10219820Sjeff@@ -190,6 +190,12 @@
11219820Sjeff 	context->max_qp_wr = dev_attrs.max_qp_wr;
12219820Sjeff 	context->max_sge = dev_attrs.max_sge;
13219820Sjeff 	context->max_cqe = dev_attrs.max_cqe;
14219820Sjeff+	if (!(dev_attrs.device_cap_flags & IBV_DEVICE_XRC)) {
15219820Sjeff+		fprintf(stderr, PFX "There is a mismatch between "
16219820Sjeff+		        "the kernel and the userspace libraries: "
17219820Sjeff+			"Kernel does not support XRC. Exiting.\n");
18219820Sjeff+		goto query_free;
19219820Sjeff+	}
20219820Sjeff 
21219820Sjeff 	return &context->ibv_ctx;
22219820Sjeff 
23