On kernels 2.6.9 an older, class/misc does not exist. To support kernel
backports, if we are unable to locate rdma_cm/abi_version, assume the
latest version. If we're wrong, we'll fail later in the code calling into
the ABI.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
if (ibv_read_sysfs_file(ibv_get_sysfs_path(),
"class/misc/rdma_cm/abi_version",
value, sizeof value) < 0) {
+ /*
+ * Older version of Linux do not have class/misc. To support
+ * backports, assume the most recent version of the ABI. If
+ * we're wrong, we'll simply fail later when calling the ABI.
+ */
fprintf(stderr, "librdmacm: couldn't read ABI version.\n");
- return -1;
+ fprintf(stderr, "librdmacm: assuming: %d\n", abi_ver);
+ return 0;
}
abi_ver = strtol(value, NULL, 10);