Whamcloud - gitweb
LU-18083 utils: handle more than one peer NI per peer 44/55944/4
authorJames Simmons <jsimmons@infradead.org>
Wed, 7 Aug 2024 13:43:01 +0000 (07:43 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 16 Aug 2024 23:50:51 +0000 (23:50 +0000)
commit9d78f397986ebeeb6c2b6905e39a2ee4204c9bce
treef4856ff10bea19a5cd10e4c6f3c65d89684005eb
parent8b422d1c80f9ecae49a5a9a8389de1a9017989a3
LU-18083 utils: handle more than one peer NI per peer

For lnetctl peer list command the loop to parse the returned data
from the kernel ended its loop on the first mapping end event.
This fails since we can have multiple peer ni nids and each one
contains a mapping start and end event. Instead we need to skip
everything until we get an sequence end event which has the
effect of filtering everything but the primary nids which we
want.

Second smaller issue is that yaml_lnet_peer_display() can have
either an emitter or parser error. If it was a emitter error
the code would return back yaml_lnet_peer() would still treat
it as an parse error as well which is incorrect. Make
yaml_lnet_peere_display() return 0 if its a parser error or
-EINVAL if its an emitter error. This way we can handle error
reporting in each case separately.

Test-Parameters: trivial testlist=sanity-lnet
Change-Id: I71372a5b243c5907022a09fb080781d60180dd41
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55944
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/utils/lnetctl.c
lustre/tests/sanity-lnet.sh