remove checks that are always true for supported OFEDs.
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I904dca06f3136334bb317de1288852e6ac4f92c7
Reviewed-on: http://review.whamcloud.com/15864
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
-EXTRA_DIST = ofed.m4 lustre-lnet.m4
+EXTRA_DIST = lustre-lnet.m4
]) # LN_CHECK_GCC_VERSION
#
-# LN_FUNC_DEV_GET_BY_NAME_2ARG
-#
-AC_DEFUN([LN_FUNC_DEV_GET_BY_NAME_2ARG], [
-LB_CHECK_COMPILE([if 'dev_get_by_name' has two args],
-dev_get_by_name_2args, [
- #include <linux/netdevice.h>
-],[
- dev_get_by_name(NULL, NULL);
-],[
- AC_DEFINE(HAVE_DEV_GET_BY_NAME_2ARG, 1,
- [dev_get_by_name has 2 args])
-])
-]) # LN_FUNC_DEV_GET_BY_NAME_2ARG
-
-#
# LN_CONFIG_AFFINITY
#
# check if cpu affinity is available/wanted
AC_MSG_ERROR([an external source tree was, either specified or detected, for o2iblnd however I could not find a $O2IBPATH/Module.symvers there])
fi
fi
-
- LN_CONFIG_OFED_SPEC
fi
])
AC_SUBST(EXTRA_OFED_INCLUDE)
AC_MSG_NOTICE([LNet kernel checks
==============================================================================])
-LN_FUNC_DEV_GET_BY_NAME_2ARG
LN_CONFIG_AFFINITY
LN_CONFIG_BACKOFF
LN_CONFIG_O2IB
+++ /dev/null
-dnl Checks for OFED
-AC_DEFUN([LN_CONFIG_OFED_SPEC], [
- AC_MSG_NOTICE([OFED checks
-==============================================================================])
-
- LB_CHECK_COMPILE([if OFED has 'ib_dma_map_single'],
- ib_dma_map_single, [
- #include <linux/version.h>
- #include <linux/pci.h>
- #include <linux/gfp.h>
- #include <rdma/ib_verbs.h>
- ],[
- ib_dma_map_single(NULL, NULL, 0, 0);
- return 0;
- ],[
- AC_DEFINE(HAVE_OFED_IB_DMA_MAP, 1,
- [ib_dma_map_single defined])
- ])
-
- LB_CHECK_COMPILE([if OFED 'ib_create_cq' wants 'comp_vector'],
- ib_create_cq_comp_vector, [
- #include <linux/version.h>
- #include <linux/pci.h>
- #include <linux/gfp.h>
- #include <rdma/ib_verbs.h>
- ],[
- ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
- return 0;
- ],[
- AC_DEFINE(HAVE_OFED_IB_COMP_VECTOR, 1,
- [has completion vector])
- ])
-
- LB_CHECK_COMPILE([if OFED has 'RDMA_CM_EVENT_ADDR_CHANGE'],
- RDMA_CM_EVENT_ADDR_CHANGE, [
- #include <linux/version.h>
- #include <linux/pci.h>
- #include <linux/gfp.h>
- #ifdef HAVE_COMPAT_RDMA
- #include <linux/compat-2.6.h>
- #endif
- #include <rdma/rdma_cm.h>
- ],[
- return (RDMA_CM_EVENT_ADDR_CHANGE == 0);
- ],[
- AC_DEFINE(HAVE_OFED_RDMA_CMEV_ADDRCHANGE, 1,
- [has completion vector])
- ])
-
- LB_CHECK_COMPILE([if OFED has 'RDMA_CM_EVENT_TIMEWAIT_EXIT'],
- RDMA_CM_EVENT_TIMEWAIT_EXIT, [
- #include <linux/version.h>
- #include <linux/pci.h>
- #include <linux/gfp.h>
- #ifdef HAVE_COMPAT_RDMA
- #include <linux/compat-2.6.h>
- #endif
- #include <rdma/rdma_cm.h>
- ],[
- return (RDMA_CM_EVENT_TIMEWAIT_EXIT == 0);
- ],[
- AC_DEFINE(HAVE_OFED_RDMA_CMEV_TIMEWAIT_EXIT, 1,
- [has completion vector])
- ])
-
- LB_CHECK_COMPILE([if OFED has 'rdma_set_reuseaddr'],
- rdma_set_reuseaddr, [
- #include <linux/version.h>
- #include <linux/pci.h>
- #include <linux/gfp.h>
- #ifdef HAVE_COMPAT_RDMA
- #include <linux/compat-2.6.h>
- #endif
- #include <rdma/rdma_cm.h>
- ],[
- rdma_set_reuseaddr(NULL, 1);
- return 0;
- ],[
- AC_DEFINE(HAVE_OFED_RDMA_SET_REUSEADDR, 1,
- [rdma_set_reuse defined])
- ])
-])
cmid->route.path_rec->mtu = mtu;
}
-#ifdef HAVE_OFED_IB_COMP_VECTOR
static int
kiblnd_get_completion_vector(kib_conn_t *conn, int cpt)
{
LBUG();
return 1;
}
-#endif
kib_conn_t *
kiblnd_create_conn(kib_peer_t *peer, struct rdma_cm_id *cmid,
kiblnd_map_rx_descs(conn);
-#ifdef HAVE_OFED_IB_COMP_VECTOR
cq = ib_create_cq(cmid->device,
kiblnd_cq_completion, kiblnd_cq_event, conn,
IBLND_CQ_ENTRIES(version),
kiblnd_get_completion_vector(conn, cpt));
-#else
- cq = ib_create_cq(cmid->device,
- kiblnd_cq_completion, kiblnd_cq_event, conn,
- IBLND_CQ_ENTRIES(version));
-#endif
if (IS_ERR(cq)) {
CERROR("Can't create CQ: %ld, cqe: %d\n",
PTR_ERR(cq), IBLND_CQ_ENTRIES(version));
return NULL;
memset(dev, 0, sizeof(*dev));
-#ifdef HAVE_DEV_GET_BY_NAME_2ARG
netdev = dev_get_by_name(&init_net, ifname);
-#else
- netdev = dev_get_by_name(ifname);
-#endif
if (netdev == NULL) {
dev->ibd_can_failover = 0;
} else {
offsetof(kib_putack_msg_t, ibpam_rd.rd_frags[n]);
}
-#ifdef HAVE_OFED_IB_DMA_MAP
-
static inline __u64
kiblnd_dma_mapping_error(struct ib_device *dev, u64 dma_addr)
{
#define KIBLND_CONN_PARAM(e) ((e)->param.conn.private_data)
#define KIBLND_CONN_PARAM_LEN(e) ((e)->param.conn.private_data_len)
-#else
-
-static inline __u64
-kiblnd_dma_mapping_error(struct ib_device *dev, dma_addr_t dma_addr)
-{
- return dma_mapping_error(dma_addr);
-}
-
-static inline dma_addr_t kiblnd_dma_map_single(struct ib_device *dev,
- void *msg, size_t size,
- enum dma_data_direction direction)
-{
- return dma_map_single(dev->dma_device, msg, size, direction);
-}
-
-static inline void kiblnd_dma_unmap_single(struct ib_device *dev,
- dma_addr_t addr, size_t size,
- enum dma_data_direction direction)
-{
- dma_unmap_single(dev->dma_device, addr, size, direction);
-}
-
-#define KIBLND_UNMAP_ADDR_SET(p, m, a) pci_unmap_addr_set(p, m, a)
-#define KIBLND_UNMAP_ADDR(p, m, a) pci_unmap_addr(p, m)
-
-static inline int kiblnd_dma_map_sg(struct ib_device *dev,
- struct scatterlist *sg, int nents,
- enum dma_data_direction direction)
-{
- return dma_map_sg(dev->dma_device, sg, nents, direction);
-}
-
-static inline void kiblnd_dma_unmap_sg(struct ib_device *dev,
- struct scatterlist *sg, int nents,
- enum dma_data_direction direction)
-{
- return dma_unmap_sg(dev->dma_device, sg, nents, direction);
-}
-
-
-static inline dma_addr_t kiblnd_sg_dma_address(struct ib_device *dev,
- struct scatterlist *sg)
-{
- return sg_dma_address(sg);
-}
-
-
-static inline unsigned int kiblnd_sg_dma_len(struct ib_device *dev,
- struct scatterlist *sg)
-{
- return sg_dma_len(sg);
-}
-
-#define KIBLND_CONN_PARAM(e) ((e)->private_data)
-#define KIBLND_CONN_PARAM_LEN(e) ((e)->private_data_len)
-
-#endif
-
struct ib_mr *kiblnd_find_rd_dma_mr(kib_hca_dev_t *hdev,
kib_rdma_desc_t *rd);
struct ib_mr *kiblnd_find_dma_mr(kib_hca_dev_t *hdev,
unsigned short port;
int rc;
-#ifdef HAVE_OFED_RDMA_SET_REUSEADDR
/* allow the port to be reused */
rc = rdma_set_reuseaddr(cmid, 1);
if (rc != 0) {
CERROR("Unable to set reuse on cmid: %d\n", rc);
return rc;
}
-#endif
/* look for a free privileged port */
for (port = PROT_SOCK-1; port > 0; port--) {
}
CERROR("Failed to bind to a free privileged port\n");
-#ifndef HAVE_OFED_RDMA_SET_REUSEADDR
- CERROR("You may need IB verbs that supports rdma_set_reuseaddr()\n");
-#endif
return rc;
}
/* net keeps its ref on conn! */
return 0;
-#ifdef HAVE_OFED_RDMA_CMEV_TIMEWAIT_EXIT
case RDMA_CM_EVENT_TIMEWAIT_EXIT:
CDEBUG(D_NET, "Ignore TIMEWAIT_EXIT event\n");
return 0;
-#endif
+
case RDMA_CM_EVENT_DISCONNECTED:
conn = (kib_conn_t *)cmid->context;
if (conn->ibc_state < IBLND_CONN_ESTABLISHED) {
* to ignore this */
return 0;
-#ifdef HAVE_OFED_RDMA_CMEV_ADDRCHANGE
case RDMA_CM_EVENT_ADDR_CHANGE:
LCONSOLE_INFO("Physical link changed (eg hca/port)\n");
return 0;
-#endif
}
}