From bbff57c3e89134b70068b0b2a5b48ba4dacca41a Mon Sep 17 00:00:00 2001 From: James Simmons Date: Sat, 17 Sep 2022 11:45:12 -0400 Subject: [PATCH] LU-12511 utils: make kfilnd support a soft requirement The new kfilnd driver doesn't exist upstream and looks like it will be missing upstream for sometime. Make building the code for this new LND optional which is needed for the native Linux Lustre client. Test-Parameters: trivial Change-Id: Ib17f78b12ffed95e4198d4524f5ca44aab01c010 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48518 Reviewed-by: Frank Sehr Reviewed-by: Chris Horn Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lnet/autoconf/lustre-lnet.m4 | 1 + lnet/utils/lnetconfig/liblnetconfig_lnd.c | 9 ++++++++- lnet/utils/lnetctl.c | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 3727cc5..2c207f1 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -714,6 +714,7 @@ AC_ARG_WITH([kfi], AC_MSG_ERROR(["$with_kfi/Module.symvers does not exist"]) ]) ],[]) +AC_DEFINE(HAVE_KFILND, 1, [support kfabric LND]) AC_SUBST(KFICPPFLAGS) AC_SUBST(KFILND) AC_SUBST(EXTRA_SYMBOLS) diff --git a/lnet/utils/lnetconfig/liblnetconfig_lnd.c b/lnet/utils/lnetconfig/liblnetconfig_lnd.c index 644a81c..23c0815 100644 --- a/lnet/utils/lnetconfig/liblnetconfig_lnd.c +++ b/lnet/utils/lnetconfig/liblnetconfig_lnd.c @@ -85,6 +85,7 @@ lustre_socklnd_show_tun(struct cYAML *lndparams, return LUSTRE_CFG_RC_NO_ERR; } +#ifdef HAVE_KFILND static int lustre_kfilnd_show_tun(struct cYAML *lndparams, struct lnet_ioctl_config_kfilnd_tunables *lnd_cfg) @@ -103,6 +104,7 @@ lustre_kfilnd_show_tun(struct cYAML *lndparams, return LUSTRE_CFG_RC_NO_ERR; } +#endif int lustre_net_show_tunables(struct cYAML *tunables, @@ -148,10 +150,11 @@ lustre_ni_show_tunables(struct cYAML *lnd_tunables, else if (net_type == SOCKLND) rc = lustre_socklnd_show_tun(lnd_tunables, &lnd->lnd_tun_u.lnd_sock); +#ifdef HAVE_KFILND else if (net_type == KFILND) rc = lustre_kfilnd_show_tun(lnd_tunables, &lnd->lnd_tun_u.lnd_kfi); - +#endif return rc; } @@ -198,6 +201,7 @@ yaml_extract_o2ib_tun(struct cYAML *tree, } +#ifdef HAVE_KFILND static void yaml_extract_kfi_tun(struct cYAML *tree, struct lnet_ioctl_config_kfilnd_tunables *lnd_cfg) @@ -225,6 +229,7 @@ yaml_extract_kfi_tun(struct cYAML *tree, lnd_cfg->lnd_auth_key = (auth_key) ? auth_key->cy_valueint : 0; } +#endif static void yaml_extract_sock_tun(struct cYAML *tree, @@ -252,8 +257,10 @@ lustre_yaml_extract_lnd_tunables(struct cYAML *tree, else if (net_type == SOCKLND) yaml_extract_sock_tun(tree, &tun->lnd_tun_u.lnd_sock); +#ifdef HAVE_KFILND else if (net_type == KFILND) yaml_extract_kfi_tun(tree, &tun->lnd_tun_u.lnd_kfi); +#endif } diff --git a/lnet/utils/lnetctl.c b/lnet/utils/lnetctl.c index 94ce53a..8d09520 100644 --- a/lnet/utils/lnetctl.c +++ b/lnet/utils/lnetctl.c @@ -1172,12 +1172,12 @@ static int jt_add_ni(int argc, char **argv) return 0; } } - +#ifdef HAVE_KFILND if (auth_key > 0 && LNET_NETTYP(nw_descr.nw_id) == KFILND) { tunables.lt_tun.lnd_tun_u.lnd_kfi.lnd_auth_key = auth_key; found = true; } - +#endif if (pto >= 0 || pc > 0 || pbc > 0 || cre > 0 || cpp > -1) { tunables.lt_cmn.lct_peer_timeout = pto; tunables.lt_cmn.lct_peer_tx_credits = pc; -- 1.8.3.1