Whamcloud - gitweb
LU-13621 lnet: utility to print cpt number
authorAmir Shehata <ashehata@whamcloud.com>
Fri, 19 Jun 2020 23:31:36 +0000 (16:31 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 9 Mar 2022 17:14:47 +0000 (17:14 +0000)
commit24a6ab44b074b067e320ed6b32fc375d00a95cc2
tree2c8640cd2291bdb0a1352fa58352376ae4d78c07
parent2f1b06d21cd41f21ace3d80b4f7044ed74222663
LU-13621 lnet: utility to print cpt number

Added a command to lnetctl to print the cpt of the NID.
lnetctl cpt-of-nid --nid <nid> --ncpt <number of cpts>
ex:
lnetctl cpt-of-nid --nid 192.28.12.35@tcp9 --ncpt 7
This will return what cpt the NID will hash to within the 0-6 range.
If the NI is bound to specific set of CPTs, then the ncpts refers
to the number of CPTs the NI is bound to. The cpt value returned
will be an index into the list of bound CPTs.

For example if an NI is bound to [0,4,5,7], then the ncpt should be
4. And the returned value will be an index in the array:
ex:
lnetctl cpt-of-nid --nid 192.28.12.35@tcp9 --ncpt 4
cpt:
    value: 1
therefore, the actual CPT the NID will be bound to is 4.

Lustre-change: https://review.whamcloud.com/39113
Lustre-commit: df6f17ee97ac47c949c1963ff8d57fb2d4becd06

Test-parameters: trivial testlist=sanity-lnet

Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: I3cb562842448bfb663c2d41007be65299a919300
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46397
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/utils/lnetconfig/liblnetconfig.c
lnet/utils/lnetconfig/liblnetconfig.h
lnet/utils/lnetctl.c