@@ -1,12 +1,6 @@
#ifndef CONFIG_H_IN
#define CONFIG_H_IN
-// FIXME: Remove this, ibverbs is included so we don't need to detect
-#define HAVE_IBV_DOFORK_RANGE 1
-#define HAVE_IBV_DONTFORK_RANGE 1
-#define HAVE_IBV_REGISTER_DRIVER 1
-#define HAVE_IBV_READ_SYSFS_FILE 1
-
#define HAVE_STATEMENT_EXPR 1
#define HAVE_BUILTIN_TYPES_COMPATIBLE_P 1
#define HAVE_TYPEOF 1
@@ -217,25 +217,7 @@ found:
return &dev->ibv_dev;
}
-#ifdef HAVE_IBV_REGISTER_DRIVER
static __attribute__((constructor)) void hfi1_register_driver(void)
{
ibv_register_driver("hfi1verbs", hfi1_driver_init);
}
-#else
-/*
- * Export the old libsysfs sysfs_class_device-based driver entry point
- * if libibverbs does not export an ibv_register_driver() function.
- */
-struct ibv_device *openib_driver_init(struct sysfs_class_device *sysdev)
-{
- int abi_ver = 0;
- char value[8];
-
- if (ibv_read_sysfs_file(sysdev->path, "abi_version",
- value, sizeof value) > 0)
- abi_ver = strtol(value, NULL, 10);
-
- return hfi1_driver_init(sysdev->path, abi_ver);
-}
-#endif /* HAVE_IBV_REGISTER_DRIVER */
@@ -216,25 +216,7 @@ found:
return &dev->ibv_dev;
}
-#ifdef HAVE_IBV_REGISTER_DRIVER
static __attribute__((constructor)) void ipath_register_driver(void)
{
ibv_register_driver("ipathverbs", ipath_driver_init);
}
-#else
-/*
- * Export the old libsysfs sysfs_class_device-based driver entry point
- * if libibverbs does not export an ibv_register_driver() function.
- */
-struct ibv_device *openib_driver_init(struct sysfs_class_device *sysdev)
-{
- int abi_ver = 0;
- char value[8];
-
- if (ibv_read_sysfs_file(sysdev->path, "abi_version",
- value, sizeof value) > 0)
- abi_ver = strtol(value, NULL, 10);
-
- return ipath_driver_init(sysdev->path, abi_ver);
-}
-#endif /* HAVE_IBV_REGISTER_DRIVER */
@@ -42,25 +42,6 @@
#include "mlx5.h"
#include "bitmap.h"
-#if !(defined(HAVE_IBV_DONTFORK_RANGE) && defined(HAVE_IBV_DOFORK_RANGE))
-
-/*
- * If libibverbs isn't exporting these functions, then there's no
- * point in doing it here, because the rest of libibverbs isn't going
- * to be fork-safe anyway.
- */
-static int ibv_dontfork_range(void *base, size_t size)
-{
- return 0;
-}
-
-static int ibv_dofork_range(void *base, size_t size)
-{
- return 0;
-}
-
-#endif /* HAVE_IBV_DONTFORK_RANGE && HAVE_IBV_DOFORK_RANGE */
-
static int mlx5_bitmap_init(struct mlx5_bitmap *bitmap, uint32_t num,
uint32_t mask)
{
@@ -42,10 +42,6 @@
#include <sched.h>
#include <sys/param.h>
-#ifndef HAVE_IBV_REGISTER_DRIVER
-#include <sysfs/libsysfs.h>
-#endif
-
#include "mlx5.h"
#include "mlx5-abi.h"
@@ -993,9 +993,7 @@ static const char *qptype2key(enum ibv_qp_type type)
case IBV_QPT_RC: return "HUGE_RC";
case IBV_QPT_UC: return "HUGE_UC";
case IBV_QPT_UD: return "HUGE_UD";
-#ifdef _NOT_EXISTS_IN_OFED_2_0
case IBV_QPT_RAW_PACKET: return "HUGE_RAW_ETH";
-#endif
default: return "HUGE_NA";
}
}
@@ -38,25 +38,6 @@
#include "mthca.h"
-#if !(defined(HAVE_IBV_DONTFORK_RANGE) && defined(HAVE_IBV_DOFORK_RANGE))
-
-/*
- * If libibverbs isn't exporting these functions, then there's no
- * point in doing it here, because the rest of libibverbs isn't going
- * to be fork-safe anyway.
- */
-static int ibv_dontfork_range(void *base, size_t size)
-{
- return 0;
-}
-
-static int ibv_dofork_range(void *base, size_t size)
-{
- return 0;
-}
-
-#endif /* HAVE_IBV_DONTFORK_RANGE && HAVE_IBV_DOFORK_RANGE */
-
int mthca_alloc_buf(struct mthca_buf *buf, size_t size, int page_size)
{
int ret;
@@ -41,16 +41,6 @@
#include <pthread.h>
#include <string.h>
-#ifndef HAVE_IBV_REGISTER_DRIVER
-#include <sysfs/libsysfs.h>
-#endif
-
-#ifndef HAVE_IBV_READ_SYSFS_FILE
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#endif
-
#include "mthca.h"
#include "mthca-abi.h"
@@ -224,36 +214,6 @@ static struct ibv_device_ops mthca_dev_ops = {
.free_context = mthca_free_context
};
-/*
- * Keep a private implementation of HAVE_IBV_READ_SYSFS_FILE to handle
- * old versions of libibverbs that didn't implement it. This can be
- * removed when libibverbs 1.0.3 or newer is available "everywhere."
- */
-#ifndef HAVE_IBV_READ_SYSFS_FILE
-static int ibv_read_sysfs_file(const char *dir, const char *file,
- char *buf, size_t size)
-{
- char path[256];
- int fd;
- int len;
-
- snprintf(path, sizeof path, "%s/%s", dir, file);
-
- fd = open(path, O_RDONLY);
- if (fd < 0)
- return -1;
-
- len = read(fd, buf, size);
-
- close(fd);
-
- if (len > 0 && buf[len - 1] == '\n')
- buf[--len] = '\0';
-
- return len;
-}
-#endif /* HAVE_IBV_READ_SYSFS_FILE */
-
static struct ibv_device *mthca_driver_init(const char *uverbs_sys_path,
int abi_version)
{
@@ -300,25 +260,7 @@ found:
return &dev->ibv_dev;
}
-#ifdef HAVE_IBV_REGISTER_DRIVER
static __attribute__((constructor)) void mthca_register_driver(void)
{
ibv_register_driver("mthca", mthca_driver_init);
}
-#else
-/*
- * Export the old libsysfs sysfs_class_device-based driver entry point
- * if libibverbs does not export an ibv_register_driver() function.
- */
-struct ibv_device *openib_driver_init(struct sysfs_class_device *sysdev)
-{
- int abi_ver = 0;
- char value[8];
-
- if (ibv_read_sysfs_file(sysdev->path, "abi_version",
- value, sizeof value) > 0)
- abi_ver = strtol(value, NULL, 10);
-
- return mthca_driver_init(sysdev->path, abi_ver);
-}
-#endif /* HAVE_IBV_REGISTER_DRIVER */
@@ -935,22 +935,8 @@ static struct ibv_device *rxe_driver_init(const char *uverbs_sys_path,
return &dev->ibv_dev;
}
-#ifdef HAVE_IBV_REGISTER_DRIVER
static __attribute__ ((constructor))
void rxe_register_driver(void)
{
ibv_register_driver("rxe", rxe_driver_init);
}
-#else
-struct ibv_device *openib_driver_init(struct sysfs_class_device *sysdev)
-{
- int abi_ver = 0;
- char value[8];
-
- if (ibv_read_sysfs_file(sysdev->path, "abi_version",
- value, sizeof value) > 0)
- abi_ver = strtol(value, NULL, 10);
-
- return rxe_driver_init(sysdev->path, abi_ver);
-}
-#endif /* HAVE_IBV_REGISTER_DRIVER */
These were used to support building provider plugins against old versions of libibverbs. Since libibverbs is now included together with the provider that is no longer possible or supported. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> --- buildlib/config.h.in | 6 ----- libhfi1verbs/src/hfiverbs.c | 18 ------------- libipathverbs/src/ipathverbs.c | 18 ------------- libmlx5/src/buf.c | 19 -------------- libmlx5/src/mlx5.c | 4 --- libmlx5/src/verbs.c | 2 -- libmthca/src/buf.c | 19 -------------- libmthca/src/mthca.c | 58 ------------------------------------------ librxe/src/rxe.c | 14 ---------- 9 files changed, 158 deletions(-)