From: Chris Horn Date: Sat, 5 Feb 2022 23:15:30 +0000 (+0000) Subject: LU-15538 lnet: DLC sets map_on_demand incorrectly X-Git-Tag: 2.15.51~162 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=896f4a082b93453f5e7168f685faff4fba594ff3;p=fs%2Flustre-release.git LU-15538 lnet: DLC sets map_on_demand incorrectly When any NET or LND tunable is specified via CLI or yaml, then the whole tunables struct gets memset to 0, or in the case of yaml config, 0 gets assigned to any tunable that isn't specified in the yaml. This causes a problem for map_on_demand because 0 is a valid value for that parameter, and ko2iblnd cannot know whether the user specified that 0 should be used or if DLC is specifying that the parameter was unset. Rather than setting this parameter to 0 in the LND tunables struct, have DLC set it to UINT_MAX to indicate that ko2iblnd should use the value of the kernel module parameter. Test-Parameters: trivial HPE-bug-id: LUS-10740 Signed-off-by: Chris Horn Change-Id: I303e64d4d402ba61b5ae3e3910873f192a4a2845 Reviewed-on: https://review.whamcloud.com/46492 Reviewed-by: James Simmons Tested-by: jenkins Tested-by: Maloo Reviewed-by: Serguei Smirnov Reviewed-by: Cyril Bordage Reviewed-by: Oleg Drokin --- diff --git a/lnet/klnds/o2iblnd/o2iblnd_modparams.c b/lnet/klnds/o2iblnd/o2iblnd_modparams.c index 95e7200..9643fcb 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_modparams.c +++ b/lnet/klnds/o2iblnd/o2iblnd_modparams.c @@ -266,6 +266,9 @@ kiblnd_tunables_setup(struct lnet_ni *ni) net_tunables->lct_peer_tx_credits = net_tunables->lct_max_tx_credits; + if (tunables->lnd_map_on_demand == UINT_MAX) + tunables->lnd_map_on_demand = map_on_demand; + #ifndef HAVE_IB_GET_DMA_MR /* * For kernels which do not support global memory regions, always diff --git a/lnet/utils/lnetconfig/liblnetconfig_lnd.c b/lnet/utils/lnetconfig/liblnetconfig_lnd.c index 6207a86..878a184 100644 --- a/lnet/utils/lnetconfig/liblnetconfig_lnd.c +++ b/lnet/utils/lnetconfig/liblnetconfig_lnd.c @@ -148,7 +148,7 @@ yaml_extract_o2ib_tun(struct cYAML *tree, map_on_demand = cYAML_get_object_item(lndparams, "map_on_demand"); lnd_cfg->lnd_map_on_demand = - (map_on_demand) ? map_on_demand->cy_valueint : 0; + (map_on_demand) ? map_on_demand->cy_valueint : UINT_MAX; concurrent_sends = cYAML_get_object_item(lndparams, "concurrent_sends"); lnd_cfg->lnd_concurrent_sends = diff --git a/lnet/utils/lnetctl.c b/lnet/utils/lnetctl.c index f9bc8d3..0024b16 100644 --- a/lnet/utils/lnetctl.c +++ b/lnet/utils/lnetctl.c @@ -1171,6 +1171,9 @@ static int jt_add_ni(int argc, char **argv) found = true; } + if (found && LNET_NETTYP(nw_descr.nw_id) == O2IBLND) + tunables.lt_tun.lnd_tun_u.lnd_o2ib.lnd_map_on_demand = UINT_MAX; + rc = lustre_lnet_config_ni(&nw_descr, (cpt_rc == 0) ? global_cpts: NULL, ip2net, (found) ? &tunables : NULL,