Whamcloud - gitweb
LU-13621 lnet: utility to print cpt number 13/39113/9
authorAmir Shehata <ashehata@whamcloud.com>
Fri, 19 Jun 2020 23:31:36 +0000 (16:31 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 31 Jan 2022 01:25:25 +0000 (01:25 +0000)
commitdf6f17ee97ac47c949c1963ff8d57fb2d4becd06
treed3cc39ee44ab0fc9b7851c63224515f5d0fd84bf
parent3f8fb726881ff7447817d5dc1ea840b0d9029ddf
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.

Test-parameters: trivial testlist=sanity-lnet

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