From: Chris Horn <chris.horn@xxxxxxx> 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. HPE-bug-id: LUS-10740 WC-bug-id: https://jira.whamcloud.com/browse/LU-15538 Lustre-commit: 896f4a082b93453f5 ("LU-15538 lnet: DLC sets map_on_demand incorrectly") Signed-off-by: Chris Horn <chris.horn@xxxxxxx> Reviewed-on: https://review.whamcloud.com/46492 Reviewed-by: James Simmons <jsimmons@xxxxxxxxxxxxx> Reviewed-by: Serguei Smirnov <ssmirnov@xxxxxxxxxxxxx> Reviewed-by: Cyril Bordage <cbordage@xxxxxxxxxxxxx> Reviewed-by: Oleg Drokin <green@xxxxxxxxxxxxx> Signed-off-by: James Simmons <jsimmons@xxxxxxxxxxxxx> --- net/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c b/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c index 022ed02..04286e1 100644 --- a/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c +++ b/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c @@ -261,6 +261,9 @@ int 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; + /* * For kernels which do not support global memory regions, always * enable map_on_demand -- 1.8.3.1