Whamcloud - gitweb
LU-14288 lnet: Introduce nidmasks 22/55922/13
authorChris Horn <chris.horn@hpe.com>
Fri, 26 Jul 2024 20:36:51 +0000 (14:36 -0600)
committerOleg Drokin <green@whamcloud.com>
Sun, 24 Nov 2024 06:02:03 +0000 (06:02 +0000)
commit4b12a9dcaf7ef08ec37c9209c31e44623f57548c
treeb1b1a9246bac7d29209c51967ce70f3b1bf46ed4
parentfb55704fbd6e1a9b97c830ee8c51813b945fa778
LU-14288 lnet: Introduce nidmasks

A nidmask is like a netmask, except it applies to IPv4 or IPv6 LNet
NIDs.

Nidmasks use the existing nidlist infrastructure so any caller of
cfs_parse_nidlist() can include a nidmask in the argument and match
NIDs against it using cfs_match_nid(), or convert it back to a string
with cfs_print_nidlist().

For example, "192.168.1.1@tcp/24" is equivalent to the nidrange
"192.168.1.[1-254]@tcp", and "2001::1@tcp/126" is equivalent to
"2001::@tcp 2001::1@tcp 2001::2@tcp 2001::3@tcp".

cfs_parse_nidrange() is modified to treat an IPv6 address as
equivalent to a netmask with prefix length of /128. Thus,
cfs_parse_nidlist() can now be used with lists of IPv6 addresses.

The user and kernel space implementations of cfs_parse_nidlist(),
et. al. have been modified to more closely match each other. Namely,
char * is used instead of the struct cfs_lstr and a length argument
is added to the kernel space cfs_parse_nidlist. Callers are adjusted
accordingly.

conf-sanity.sh/test_43a is modified to generate nidmasks that contain
the client's NID and verify that this is handled correctly when
nosquash_nids is set to the nidmask.

lnetctl debug nidlist command is added to facilitate testing of the
userspace code.

Test-Parameters: trivial testlist=conf-sanity env=ONLY=43a
Test-Parameters: testlist=conf-sanity env=ONLY=43a,FORCE_LARGE_NID=true,LOAD_MODULES_REMOTE=true
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: Id9d0bc6f4f8b977591f0b6f88bda46ae03cb58d5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55922
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
14 files changed:
libcfs/include/libcfs/util/string.h
libcfs/libcfs/util/nidstrings.c
libcfs/libcfs/util/string.c
lnet/include/lnet/lib-types.h
lnet/include/uapi/linux/lnet/nidstr.h
lnet/lnet/nidstrings.c
lnet/utils/lnetconfig/liblnetconfig.c
lnet/utils/lnetconfig/liblnetconfig.h
lnet/utils/lnetctl.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/obd_mount.c
lustre/ptlrpc/nrs_tbf.c
lustre/tests/conf-sanity.sh
lustre/utils/obd.c