Whamcloud - gitweb
LU-16991 kfilnd: Init LNet NI data in dev alloc 83/51783/2
authorIan Ziemba <ian.ziemba@hpe.com>
Wed, 22 Feb 2023 22:00:43 +0000 (16:00 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 22 Aug 2023 06:41:20 +0000 (06:41 +0000)
LNet ni_nid was being set outside of kfilnd_dev_alloc(). This was
causing the incorrect debugfs directories to be generated inside
kfilnd_dev_alloc().

Fix this by setting all LNet NI fields inside kfilnd_dev_alloc().

Test-Parameters: trivial
HPE-bug-id: LUS-11496
Signed-off-by: Ian Ziemba <ian.ziemba@hpe.com>
Change-Id: I4eecfa05966cb7793a01b92b0bc49ffca252976e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51783
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ron Gredvig <ron.gredvig@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/kfilnd/kfilnd.c
lnet/klnds/kfilnd/kfilnd_dev.c

index 1145de4..5854057 100644 (file)
@@ -456,9 +456,6 @@ static int kfilnd_startup(struct lnet_ni *ni)
                goto err;
        }
 
-       ni->ni_data = kfdev;
-       ni->ni_nid.nid_addr[0] = cpu_to_be32(LNET_NIDADDR(kfdev->nic_addr));
-
        /* Post a series of immediate receive buffers */
        rc = kfilnd_dev_post_imm_buffers(kfdev);
        if (rc) {
index 5113551..a1a3059 100644 (file)
@@ -251,6 +251,9 @@ struct kfilnd_dev *kfilnd_dev_alloc(struct lnet_ni *ni,
        /* Mark that the dev/NI has now been initialized */
        dev->kfd_state = KFILND_STATE_INITIALIZED;
 
+       ni->ni_data = dev;
+       ni->ni_nid.nid_addr[0] = cpu_to_be32(LNET_NIDADDR(dev->nic_addr));
+
        /* Initialize debugfs stats. */
        dev->dev_dir = debugfs_create_dir(libcfs_nidstr(&ni->ni_nid),
                                          kfilnd_debug_dir);