From 73ff9cb8de7a7515f98694deab4afc7df1f8d3b2 Mon Sep 17 00:00:00 2001 From: Martin Schroeder Date: Wed, 17 Jan 2018 11:19:09 +0100 Subject: [PATCH] LU-10526 build: Ubuntu Kernel 4.4.0 lacks symbols used by o2iblnd.c Recently, a change has been merged to "lnet/klnds/o2iblnd/o2iblnd.c" which introduces the usage of IB_DEVICE_SG_GAPS_REG and IB_MR_TYPE_SG_GAPS. Unfortunately, these symbols are not available in the 4.4.0 Kernels as used by Ubuntu 14/16. Additionally, there seems to be general warning against their use: - https://patchwork.kernel.org/patch/9573483/ - https://lkml.org/lkml/2017/3/13/206 Also, there is a related performance issue as reported in LU-10394. The solution is to create a preprocessor guard around their use, so that Kernels lacking these symbols will not use them and revert to using the older IB_MR_TYPE_MEM_REG, instead. Test-Parameters: trivial Signed-off-by: Martin Schroeder Change-Id: Ie835d6e04f3859634ba508c24dff1f27f1b24cf6 Reviewed-on: https://review.whamcloud.com/30893 Tested-by: Jenkins Reviewed-by: Bob Glossman Reviewed-by: James Simmons Reviewed-by: Amir Shehata Tested-by: Maloo Reviewed-by: Oleg Drokin --- lnet/klnds/o2iblnd/o2iblnd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 247b3c1..798132d 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -1591,10 +1591,14 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo, * gaps. So we will need to track them here. */ frd->frd_mr = ib_alloc_mr(fpo->fpo_hdev->ibh_pd, +#ifdef IB_MR_TYPE_SG_GAPS (dev_caps & IBLND_DEV_CAPS_FASTREG_GAPS_SUPPORT) ? IB_MR_TYPE_SG_GAPS : IB_MR_TYPE_MEM_REG, +#else + IB_MR_TYPE_MEM_REG, +#endif LNET_MAX_PAYLOAD/PAGE_SIZE); #endif if (IS_ERR(frd->frd_mr)) { @@ -2556,9 +2560,11 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev) LCONSOLE_INFO("Using FastReg for registration\n"); hdev->ibh_dev->ibd_dev_caps |= IBLND_DEV_CAPS_FASTREG_ENABLED; #ifndef HAVE_IB_ALLOC_FAST_REG_MR +#ifdef IB_DEVICE_SG_GAPS_REG if (dev_attr->device_cap_flags & IB_DEVICE_SG_GAPS_REG) hdev->ibh_dev->ibd_dev_caps |= IBLND_DEV_CAPS_FASTREG_GAPS_SUPPORT; #endif +#endif } else { rc = -ENOSYS; } -- 1.8.3.1