In my testing of IPv6 I was always seeing the NI state as "down".
This is incorrect and I found this was due to reading ni->ni_status
directly. Using lnet_ni_get_status_locked() fixes the issue.
Test-Parameters: trivial testlist=sanity-lnet
Fixes:
8f8f6e2f36e ("LU-10003 lnet: use Netlink to support old and new NI APIs.")
Change-Id: I490144ceae4a5c1cdd7c920661f8220033df8cd5
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53016
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
nla_put_string(msg, LNET_NET_LOCAL_NI_ATTR_NID,
libcfs_nidstr(&ni->ni_nid));
if (!nid_is_lo0(&ni->ni_nid) &&
- *ni->ni_status != LNET_NI_STATUS_UP)
+ lnet_ni_get_status_locked(ni) != LNET_NI_STATUS_UP)
status = "down";
nla_put_string(msg, LNET_NET_LOCAL_NI_ATTR_STATUS,
status);