Whamcloud - gitweb
LU-16822 lnet: use proper Netlink flags for setup 29/55129/5
authorJames Simmons <jsimmons@infradead.org>
Fri, 31 May 2024 17:33:46 +0000 (11:33 -0600)
committerOleg Drokin <green@whamcloud.com>
Mon, 10 Jun 2024 06:08:07 +0000 (06:08 +0000)
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55129
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/klnds/o2iblnd/o2iblnd.c
lnet/klnds/socklnd/socklnd.c
lnet/lnet/api-ni.c
lnet/lnet/config.c
lnet/utils/lnetctl.c

index f9c0a0d..56ae389 100644 (file)
@@ -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;
 
index 36f5104..164f534 100644 (file)
@@ -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;
 
index e8307ce..c88e441 100644 (file)
@@ -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);
index 4f25683..3c52d46 100644 (file)
@@ -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
index 43b4d09..95d7c8e 100644 (file)
@@ -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;