Whamcloud - gitweb
LU-18621 lnet: fix wrong stats for lnet_net_show_dump 85/57885/2
authorJames Simmons <jsimmons@infradead.org>
Fri, 24 Jan 2025 15:06:50 +0000 (10:06 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 28 Feb 2025 08:13:29 +0000 (08:13 +0000)
commit77fe236fbbd453d63a97b92bf07fc6068421ea88
tree25177e720d96c683644de94835dbbd103735ac10
parentb1a07c17b620e7ed6437d35b477f3b34c21f9200
LU-18621 lnet: fix wrong stats for lnet_net_show_dump

For the function lnet_get_ni_stats() the im_idx assumes the idx
is relative to all NIs. With lnet_net_show_dump() the idx we
use is realtive to our own NI list so it doesn't always match
the idx lnet_get_ni_stats() expects. This can lead to the wrong
stats being collected when a net_id is set. The only reason we
need an idx for lnet_get_ni_stats() is so the NI can be located
but we already know the NI. Just call lnet_usr_translate_stats()
directly instead of using lnet_get_ni_stats() to figure out the
NI to call lnet_user_translate_stats() internally with.

Test-Parameters: trivial testlist=sanity-lnet
Fixes: 8f8f6e2f36e ("LU-10003 lnet: use Netlink to support old and new NI APIs.")
Change-Id: Ie39e65146c21d976f9a7655eead8c46e9293ee27
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57885
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/api-ni.c