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>