From 52d1671d98c29bd54430718b6e41df136e596c74 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Fri, 19 Jul 2019 00:17:54 -0500 Subject: [PATCH] LU-12405 lnet: Oracle OFED extensions default to on Oracle UEK kernel ships with OFED extensions on by default. Enable building if Oracle OFED extensions are not suppressed. Introduce and use kib_fmr_pool_map wrapper for ib_fmr_pool_map_phys Test-Parameters: trivial Cray-bug-id: LUS-7440 Signed-off-by: Shaun Tancheff Change-Id: I2b15293454ce2e4f55ca0a47117c8072326e2d3a Reviewed-on: https://review.whamcloud.com/35292 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Petros Koutoupis Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lnet/autoconf/lustre-lnet.m4 | 22 ++++++++++++++++++++++ lnet/klnds/o2iblnd/o2iblnd.c | 4 ++-- lnet/klnds/o2iblnd/o2iblnd.h | 8 ++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 8494135..85125f2 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -743,6 +743,26 @@ EXTRA_KCFLAGS="$tmp_flags" ]) # LN_CONFIG_SOCK_ACCEPT # +# LN_HAVE_ORACLE_OFED_EXTENSIONS +# +# Oracle UEK 5 +# +AC_DEFUN([LN_HAVE_ORACLE_OFED_EXTENSIONS], [ +LB_CHECK_COMPILE([if Oracle OFED Extensions are enabled], +oracle_ofed_ext, [ + #include +],[ + struct ib_fmr_pool_param param = { + .relaxed = 0 + }; + (void)param; +],[ + AC_DEFINE(HAVE_ORACLE_OFED_EXTENSIONS, 1, + [if Oracle OFED Extensions are enabled]) +]) +]) # LN_HAVE_ORACLE_OFED_EXTENSIONS + +# # LN_CONFIG_SOCK_GETNAME # # 4.17 commit 9b2c45d479d0fb8647c9e83359df69162b5fbe5f getname() @@ -837,6 +857,8 @@ LN_CONFIG_SK_DATA_READY LN_CONFIG_SOCK_CREATE_KERN # 4.11 LN_CONFIG_SOCK_ACCEPT +# 4.14 +LN_HAVE_ORACLE_OFED_EXTENSIONS # 4.17 LN_CONFIG_SOCK_GETNAME # 5.0 diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index d37237a..eaf59fc 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -1863,8 +1863,8 @@ again: tx_pages_mapped = 1; } - pfmr = ib_fmr_pool_map_phys(fpo->fmr.fpo_fmr_pool, - pages, npages, iov); + pfmr = kib_fmr_pool_map(fpo->fmr.fpo_fmr_pool, + pages, npages, iov); if (likely(!IS_ERR(pfmr))) { fmr->fmr_key = is_rx ? pfmr->fmr->rkey : pfmr->fmr->lkey; diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index fd6f97c..b0ca501 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -354,6 +354,14 @@ struct kib_fmr { u32 fmr_key; }; +#ifdef HAVE_ORACLE_OFED_EXTENSIONS +#define kib_fmr_pool_map(pool, pgs, n, iov) \ + ib_fmr_pool_map_phys((pool), (pgs), (n), (iov), NULL) +#else +#define kib_fmr_pool_map(pool, pgs, n, iov) \ + ib_fmr_pool_map_phys((pool), (pgs), (n), (iov)) +#endif + struct kib_net { /* chain on struct kib_dev::ibd_nets */ struct list_head ibn_list; -- 1.8.3.1