[PATCH rdma-core 2/2] rxe: Update abi_version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

rxe never used the ABI version system properly, start doing so now.

New kernels will report ABI version 2, indicating they have
the right struct layout, even if compiled for 32 bit.

64 bit user space will work with ABI v1 and v2 as they are the same,
but now with the new kernel headers userspace will require ABI v2
if built in 32 bit mode to be sure the kernel has a compatible
ABI layout.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 providers/rxe/rxe.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/providers/rxe/rxe.c b/providers/rxe/rxe.c
index 1ced15be45c928..b10868d3095e8a 100644
--- a/providers/rxe/rxe.c
+++ b/providers/rxe/rxe.c
@@ -910,8 +910,13 @@ static struct verbs_device *rxe_device_alloc(struct verbs_sysfs_dev *sysfs_dev)
 
 static const struct verbs_device_ops rxe_dev_ops = {
 	.name = "rxe",
-	.match_min_abi_version = 0,
-	.match_max_abi_version = INT_MAX,
+	/*
+	 * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
+	 * bit machines require ABI version 2 which guarentees the user and
+	 * kernel use the same ABI.
+	 */
+	.match_min_abi_version = sizeof(void *) == 8?1:2,
+	.match_max_abi_version = 2,
 	.match_table = hca_table,
 	.alloc_device = rxe_device_alloc,
 	.uninit_device = rxe_uninit_device,
-- 
2.16.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux