[lustre-discuss] error compiling Lustre on new Mellanox OFED 4.7

Hebenstreit, Michael michael.hebenstreit at intel.com
Thu Oct 3 11:00:05 PDT 2019


Running new Mellanox OFED 4.7 on CentOS 7.7 kernel I tried to compile Lustre and got the following error

make[3]: Entering directory `/global/panfs01/admin/src/3.10.0-1062.1.2.el7.crt1.x86_64'
  CC [M]  /tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.o
In file included from /tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.c:38:0:
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.h: In function 'kiblnd_sg_dma_address':
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.h:1162:9: error: implicit declaration of function 'ib_sg_dma_address' [-Werror=implicit-function-declaration]
         return ib_sg_dma_address(dev, sg);
         ^
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.h: In function 'kiblnd_sg_dma_len':
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.h:1168:9: error: implicit declaration of function 'ib_sg_dma_len' [-Werror=implicit-function-declaration]
         return ib_sg_dma_len(dev, sg);
         ^
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.c: In function 'kiblnd_create_fmr_pool':
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.c:1676:30: error: 'struct ib_device' has no member named 'alloc_fmr'
  if (fpo->fpo_hdev->ibh_ibdev->alloc_fmr &&
                              ^
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.c:1677:30: error: 'struct ib_device' has no member named 'dealloc_fmr'
      fpo->fpo_hdev->ibh_ibdev->dealloc_fmr &&
                              ^
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.c:1678:30: error: 'struct ib_device' has no member named 'map_phys_fmr'
      fpo->fpo_hdev->ibh_ibdev->map_phys_fmr &&
                              ^
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.c:1679:30: error: 'struct ib_device' has no member named 'unmap_fmr'
      fpo->fpo_hdev->ibh_ibdev->unmap_fmr) {
                              ^
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.c: In function 'kiblnd_fmr_pool_unmap':
/tmp/lustre-2.10.8/lnet/klnds/o2iblnd/o2iblnd.c:1825:7: error: void value not ignored as it ought to be
    rc = ib_fmr_pool_unmap(fmr->fmr_pfmr);
       ^
cc1: all warnings being treated as errors

looks like Mallenaox changed some names, and also the ib_device declaration. Using these patches I got it to work, but it would be nice if someone could check if I did something completely stupid 😊

--- lnet/klnds/o2iblnd/o2iblnd.c.orig   2019-10-03 11:11:43.000000000 -0600
+++ lnet/klnds/o2iblnd/o2iblnd.c        2019-10-03 11:32:33.000000000 -0600
@@ -1673,10 +1673,10 @@

        /* Check for FMR or FastReg support */
        fpo->fpo_is_fmr = 0;
-       if (fpo->fpo_hdev->ibh_ibdev->alloc_fmr &&
-           fpo->fpo_hdev->ibh_ibdev->dealloc_fmr &&
-           fpo->fpo_hdev->ibh_ibdev->map_phys_fmr &&
-           fpo->fpo_hdev->ibh_ibdev->unmap_fmr) {
+       if (fpo->fpo_hdev->ibh_ibdev->ops.alloc_fmr &&
+           fpo->fpo_hdev->ibh_ibdev->ops.dealloc_fmr &&
+           fpo->fpo_hdev->ibh_ibdev->ops.map_phys_fmr &&
+           fpo->fpo_hdev->ibh_ibdev->ops.unmap_fmr) {
                LCONSOLE_INFO("Using FMR for registration\n");
                fpo->fpo_is_fmr = 1;
        } else if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) {
@@ -1822,8 +1822,8 @@
        fps = fpo->fpo_owner;
        if (fpo->fpo_is_fmr) {
                if (fmr->fmr_pfmr) {
-                       rc = ib_fmr_pool_unmap(fmr->fmr_pfmr);
-                       LASSERT(!rc);
+                       ib_fmr_pool_unmap(fmr->fmr_pfmr);
+//                     LASSERT(!rc);
                        fmr->fmr_pfmr = NULL;
                }

--- lnet/klnds/o2iblnd/o2iblnd.h.orig   2019-10-03 11:13:30.000000000 -0600
+++ lnet/klnds/o2iblnd/o2iblnd.h        2019-10-03 11:20:32.000000000 -0600
@@ -1159,13 +1159,13 @@
static inline __u64 kiblnd_sg_dma_address(struct ib_device *dev,
                                           struct scatterlist *sg)
{
-        return ib_sg_dma_address(dev, sg);
+        return sg_dma_address(sg);
}

static inline unsigned int kiblnd_sg_dma_len(struct ib_device *dev,
                                              struct scatterlist *sg)
{
-        return ib_sg_dma_len(dev, sg);
+        return sg_dma_len(sg);
}

/* XXX We use KIBLND_CONN_PARAM(e) as writable buffer, it's not strictly

------------------------------------------------------------------------
Michael Hebenstreit                 Senior Cluster Architect
Intel Corporation, MS: RR1-105/H14  TSACG
1600 Rio Rancho Blvd SE             Tel.:   +1 505-794-3144
Rio Rancho, NM 87124
UNITED STATES                       E-mail: michael.hebenstreit at intel.com<mailto:michael.hebenstreit at intel.com>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-discuss-lustre.org/attachments/20191003/4b010c88/attachment-0001.html>


More information about the lustre-discuss mailing list