Whamcloud - gitweb
LU-6962 lnet: remove old unsupported OFEDs checks 64/15864/4
authorDmitry Eremin <dmitry.eremin@intel.com>
Wed, 5 Aug 2015 15:41:50 +0000 (18:41 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 26 Aug 2015 15:52:08 +0000 (15:52 +0000)
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>
lnet/autoconf/Makefile.am
lnet/autoconf/lustre-lnet.m4
lnet/autoconf/ofed.m4 [deleted file]
lnet/klnds/o2iblnd/o2iblnd.c
lnet/klnds/o2iblnd/o2iblnd.h
lnet/klnds/o2iblnd/o2iblnd_cb.c

index 426c3ce..98dcf51 100644 (file)
@@ -1 +1 @@
-EXTRA_DIST = ofed.m4 lustre-lnet.m4
+EXTRA_DIST = lustre-lnet.m4
index 926d4c9..518dc2e 100644 (file)
@@ -42,21 +42,6 @@ fi
 ]) # 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
@@ -325,8 +310,6 @@ directory which is likely in ${O2IBPATH%-*}
                                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)
@@ -482,7 +465,6 @@ AC_DEFUN([LN_PROG_LINUX], [
 AC_MSG_NOTICE([LNet kernel checks
 ==============================================================================])
 
-LN_FUNC_DEV_GET_BY_NAME_2ARG
 LN_CONFIG_AFFINITY
 LN_CONFIG_BACKOFF
 LN_CONFIG_O2IB
diff --git a/lnet/autoconf/ofed.m4 b/lnet/autoconf/ofed.m4
deleted file mode 100644 (file)
index d4fba98..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-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])
-       ])
-])
index c02b733..6986f2d 100644 (file)
@@ -677,7 +677,6 @@ kiblnd_setup_mtu_locked(struct rdma_cm_id *cmid)
                 cmid->route.path_rec->mtu = mtu;
 }
 
-#ifdef HAVE_OFED_IB_COMP_VECTOR
 static int
 kiblnd_get_completion_vector(kib_conn_t *conn, int cpt)
 {
@@ -702,7 +701,6 @@ 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,
@@ -815,16 +813,10 @@ 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));
@@ -2763,11 +2755,7 @@ kiblnd_create_dev(char *ifname)
                 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 {
index 2fe40c9..c30aa21 100644 (file)
@@ -1023,8 +1023,6 @@ kiblnd_rd_msg_size(kib_rdma_desc_t *rd, int msgtype, int n)
                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)
 {
@@ -1081,64 +1079,6 @@ static inline unsigned int kiblnd_sg_dma_len(struct ib_device *dev,
 #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,
index 8f61006..ce7c601 100644 (file)
@@ -1255,14 +1255,12 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
         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--) {
@@ -1283,9 +1281,6 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
         }
 
         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;
 }
 
@@ -2980,11 +2975,10 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
                 /* 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) {
@@ -3006,11 +3000,9 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
                  * 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
         }
 }