Whamcloud - gitweb
LU-16462 utils: handle lack of newer nla_attrs 08/49608/10
authorJames Simmons <jsimmons@infradead.org>
Tue, 18 Apr 2023 01:07:47 +0000 (21:07 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 1 May 2023 04:08:54 +0000 (04:08 +0000)
commitae1ee11cea0a90631e14d670883528d6ac6e86b7
treea676df2ca9b8e49e51fff09339125eece34129bf
parentca992899d55fd13e65b75ace02931daaa29c18bd
LU-16462 utils: handle lack of newer nla_attrs

Some platforms like SUSE12SP5 have an older version of libnl3.
Those versions lack proper support for newer nlattrs like NLA_S64.
Without proper support of these newer nlattrs this means
nla_validate() will see newer nlattrs as invalid. We need to
fill in this missing support on older platforms.

The "lctl ping" command will loop forever in jt_ptl_ping() if the
netlink yaml parser doesn't work, instead of falling back to the
"old_api" interface.  However, because IOC_LIBCFS_PING was also
deleted, this doesn't work either.  Use lustre_lnet_ping_nid() to
fallback to IOC_LIBCFS_PING_PEER (since v2_10_52_0-21-g7a36afd9df).

Also, jt_ptl_ping() was passing argv[1] directly to the kernel as
the NID to ping, without doing name resolution on it first, which
broke using "lctl ping HOSTNAME" instead of only numeric IP NIDs.
Ensure it returns a non-zero error code in case of failure.

Restore IOC_LIBCFS_GET_NI for compatibility until there have been
some releases with netlink support, so that "lctl list_nids" works.

Also, sanity test_217 that was testing "lctl ping" was always being
skipped, because "lctl list_nids" is never returning the hostname
with embedded '-', only numeric IP addresses.  Change it to prefer
testing the hostname if it resolves to a NID, otherwise ping the
numeric NID anyway, to confirm that "lctl ping" is still working.

Test-Parameters: trivial clientdistro=sles12sp5 testlist=sanity
Test-Parameters: clientdistro=sles12sp5 testlist=conf-sanity env=ONLY=43+50+70+91+115+130
Fixes: 86ba46c244 ("LU-9680 obdclass: user netlink to collect devices info")
Fixes: d137e9823c ("LU-10003 lnet: use Netlink to support LNet ping commands")
Fixes: 3e4061862e ("LU-864 test: Hostname name doesn't equal NID")
Change-Id: Ia2dfd84c2d1782578ceff1c2dc6f74d7aa9b458b
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49608
Reviewed-by: Andreas Dilger <adilger@whamcloud.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/include/uapi/linux/lnet/libcfs_ioctl.h
lnet/lnet/api-ni.c
lnet/utils/lnetconfig/liblnetconfig_netlink.c
lustre/tests/sanity.sh
lustre/utils/lctl.c
lustre/utils/lustre_cfg.c
lustre/utils/portals.c