From 9d9b8cbaa4123df708a072acd1a4f30120075418 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Fri, 31 May 2024 11:33:46 -0600 Subject: [PATCH] LU-16822 lnet: use proper Netlink flags for setup The Netlink flags sent to lnet_net_conf_cmd() were incorrect. You can't use both NLM_F_EXCL and NLM_F_REPLACE together. If you think about it these flags are opposites. Together this flags also equal NLM_F_DUMP which the kernel doesn't support for this operations so it failed with EOPNOTSUPP which tells user land to use the old API so the failure wasn't easily detected. We replace NLM_F_REPLACE with NLM_F_APPEND to avoid this issue. Also for some reason lct_version gets stomped on so we can't use it. Fixes: ab6c8bd18e1 ("LU-16822 lnet: always initialize IPv6 at start up") Test-Parameters: trivial testlist=sanity-lnet Change-Id: I6b9eb013f6fc10276e91848d7b5f17d406fbbdb4 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55129 Reviewed-by: Chris Horn Reviewed-by: Frank Sehr Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lnet/klnds/o2iblnd/o2iblnd.c | 3 ++- lnet/klnds/socklnd/socklnd.c | 2 +- lnet/lnet/api-ni.c | 2 +- lnet/lnet/config.c | 3 --- lnet/utils/lnetctl.c | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index f9c0a0d..56ae389 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -3734,7 +3734,8 @@ kiblnd_startup(struct lnet_ni *ni) goto failed; } - rc = lnet_inet_enumerate(&ifaces, ni->ni_net_ns, false); + rc = lnet_inet_enumerate(&ifaces, ni->ni_net_ns, + the_lnet.ln_nis_use_large_nids); if (rc < 0) goto failed; diff --git a/lnet/klnds/socklnd/socklnd.c b/lnet/klnds/socklnd/socklnd.c index 36f5104..164f534 100644 --- a/lnet/klnds/socklnd/socklnd.c +++ b/lnet/klnds/socklnd/socklnd.c @@ -2570,7 +2570,7 @@ ksocknal_startup(struct lnet_ni *ni) ksocknal_tunables_setup(ni); rc = lnet_inet_enumerate(&ifaces, ni->ni_net_ns, - ni->ni_net->net_tunables.lct_version); + the_lnet.ln_nis_use_large_nids); if (rc < 0) goto out_net; diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index e8307ce..c88e441 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -4820,7 +4820,7 @@ static int lnet_net_conf_cmd(struct sk_buff *skb, struct genl_info *info) if (info->nlhdr->nlmsg_flags & NLM_F_EXCL) the_lnet.ln_nis_from_mod_params = true; - if (info->nlhdr->nlmsg_flags & NLM_F_REPLACE) + if (info->nlhdr->nlmsg_flags & NLM_F_APPEND) the_lnet.ln_nis_use_large_nids = true; rc = lnet_configure(NULL); diff --git a/lnet/lnet/config.c b/lnet/lnet/config.c index 4f25683..3c52d46 100644 --- a/lnet/lnet/config.c +++ b/lnet/lnet/config.c @@ -683,9 +683,6 @@ lnet_parse_networks(struct list_head *netlist, const char *networks) if (IS_ERR_OR_NULL(net)) goto failed; - if (the_lnet.ln_nis_use_large_nids) - net->net_tunables.lct_version = 1; - if (!nistr) { /* * No interface list was specified, allocate a diff --git a/lnet/utils/lnetctl.c b/lnet/utils/lnetctl.c index 43b4d09..95d7c8e 100644 --- a/lnet/utils/lnetctl.c +++ b/lnet/utils/lnetctl.c @@ -1251,7 +1251,7 @@ static int jt_config_lnet(int argc, char **argv) load_mod_params = true; break; case 'l': - flags |= NLM_F_REPLACE; + flags |= NLM_F_APPEND; break; default: return 0; -- 1.8.3.1