+
+ #
+ # LN_IB_DEVICE_OPS_EXISTS
+ #
+ # kernel 5.0 commit 521ed0d92ab0db3edd17a5f4716b7f698f4fce61
+ # RDMA/core: Introduce ib_device_ops
+ # ... introduces the ib_device_ops structure that defines all the
+ # InfiniBand device operations in one place ...
+ #
+ AC_DEFUN([LN_SRC_O2IB_IB_DEVICE_OPS_EXISTS], [
+ LB2_OFED_TEST_SRC([ib_device_ops_test], [
+ #include <rdma/ib_verbs.h>
+ ],[
+ int x = offsetof(struct ib_device_ops, unmap_fmr);
+ x = x;
+ (void)x;
+ ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
+ ])
+ AC_DEFUN([LN_O2IB_IB_DEVICE_OPS_EXISTS], [
+ LB2_OFED_TEST_RESULTS(
+ [struct ib_device_ops is defined],
+ [ib_device_ops_test],
+ [HAVE_OFED_IB_DEVICE_OPS])
+ ]) # LN_IB_DEVICE_OPS_EXISTS
+
+ #
+ # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
+ #
+ # kernel 5.1 commit a163afc88556e099271a7b423295bc5176fcecce
+ # IB/core: Remove ib_sg_dma_address() and ib_sg_dma_len()
+ # ... when dma_ops existed (3.6) ib_sg_dma_address() was not trivial ...
+ #
+ AC_DEFUN([LN_SRC_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
+ LB2_OFED_TEST_SRC([ib_sg_dma_address_test], [
+ #include <rdma/ib_verbs.h>
+ ],[
+ u64 x = ib_sg_dma_address(NULL, NULL);
+ x = x;
+ (void)x;
+ ],[-Werror],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
+ ])
+ AC_DEFUN([LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS], [
+ LB2_OFED_TEST_RESULTS(
+ [ib_sg_dma_address wrapper exists],
+ [ib_sg_dma_address_test],
+ [HAVE_OFED_IB_SG_DMA_ADDRESS])
+ ]) # LN_O2IB_IB_SG_DMA_ADDRESS_EXISTS
+
+ #
+ # LN_O2IB_RDMA_REJECT
+ #
+ # A reason argument was added to rdma_reject() in Linux 5.8,
+ # commit 8094ba0ace7f6cd1e31ea8b151fba3594cadfa9a
+ AC_DEFUN([LN_SRC_O2IB_RDMA_REJECT], [
+ LB2_OFED_TEST_SRC([rdma_reject], [
+ #ifdef HAVE_OFED_COMPAT_RDMA
+ #undef PACKAGE_NAME
+ #undef PACKAGE_TARNAME
+ #undef PACKAGE_VERSION
+ #undef PACKAGE_STRING
+ #undef PACKAGE_BUGREPORT
+ #undef PACKAGE_URL
+ #include <linux/compat-2.6.h>
+ #endif
+ #include <rdma/ib_verbs.h>
+ #include <rdma/ib_cm.h>
+ #include <rdma/rdma_cm.h>
+ ],[
+ rdma_reject(NULL, NULL, 0, 0);
+ ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
+ ])
+ AC_DEFUN([LN_O2IB_RDMA_REJECT], [
+ LB2_OFED_TEST_RESULTS(
+ [4arg 'rdma_reject' exists],
+ [rdma_reject],
+ [HAVE_OFED_RDMA_REJECT_4ARGS])
+ ]) # LN_O2IB_RDMA_REJECT
+
+ #
+ # LN_O2IB_IB_FMR
+ #
+ # The FMR pool API was removed in Linux 5.8,
+ # commit 4e373d5417ecbb4f438a8500f0379a2fc29c2643
+ AC_DEFUN([LN_SRC_O2IB_IB_FMR], [
+ LB2_OFED_TEST_SRC([ib_fmr], [
+ #include <rdma/ib_verbs.h>
+ ],[
+ struct ib_fmr fmr = {};
+ ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
+ ])
+ AC_DEFUN([LN_O2IB_IB_FMR], [
+ LB2_OFED_TEST_RESULTS(
+ [FMR pools API available],
+ [ib_fmr],
+ [HAVE_OFED_FMR_POOL_API])
+ ]) # LN_O2IB_IB_FMR
+
+ #
+ # LN_O2IB_RDMA_CONNECT_LOCKED
+ #
+ # rdma_connect_locked() was added in Linux 5.10,
+ # commit 071ba4cc559de47160761b9500b72e8fa09d923d
+ # and in MOFED-5.2-2. rdma_connect_locked() must
+ # be called instead of rdma_connect() in
+ # RDMA_CM_EVENT_ROUTE_RESOLVED handler.
+ AC_DEFUN([LN_SRC_O2IB_RDMA_CONNECT_LOCKED], [
+ LB2_OFED_TEST_SRC([rdma_connect_locked], [
+ #include <rdma/rdma_cm.h>
+ ],[
+ rdma_connect_locked(NULL, NULL);
+ ],[],[$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE])
+ ])
+ AC_DEFUN([LN_O2IB_RDMA_CONNECT_LOCKED], [
+ LB2_OFED_TEST_RESULTS(
+ ['rdma_connect_locked' exists],
+ [rdma_connect_locked],
+ [HAVE_OFED_RDMA_CONNECT_LOCKED])
+ ]) # LN_O2IB_RDMA_CONNECT_LOCKED