Whamcloud - gitweb
LU-10391 lnet: introduce struct lnet_nid
LNet nids are currently limited to 4-bytes for addresses.
This excludes the use of IPv6.
In order to support IPv6, introduce 'struct lnet_nid' which can hold
up to 128bit address and is extensible, and deprecate 'lnet_nid_t'.
lnet_nid_it will eventually be removed. Where lnet_nid_t is often
passed around by value, 'struct lnet_nid' will normally be passed
around by reference as it is over twice as large.
The net_type field, which currently has value up to 16, is now limited
to 0-254 with 255 being used as a wildcard. The most significant byte
is now a size field which gives the size of the whole nid minus 8. So
zero is correct for current nids with 4-byte addresses.
Where we still need to use 4-byte-address nids, we will use names
containing "nid4". So "nid4" is a lnet_nid_t when "nid" is a struct
lnet_nid. lnet_nid_to_nid4 converts a 'struct lnet_nid' to an
lnet_nid_t.
While lnet_nid_t is stored and often transmitted in host-endian format
(and possibly byte-swapped on receipt), 'struct lnet_nid' is always
stored in network-byte-order (i.e. big-endian). This is more common
approach for network addresses.
In this first instance, 'struct lnet_nid' is used for ni_nid in
'struct lnet_ni', and related support functions.
In particular libcfs_nidstr() is introduced which parallels
libcfs_nid2str(), but takes 'struct lnet_nid'.
In cases were we need to have similar functions for old and new style
nid, the new function is introduced with a slightly different name,
such as libcfs_nid2str above, or LNET_NID_NET (like LNET_NIDNET).
It will be confusing having both, but the plan is to remove the old
names as soon as practical.
Test-Parameters: trivial
Test-Parameters: serverversion=2.12 serverdistro=el7.9 testlist=runtests
Test-Parameters: clientversion=2.12 testlist=runtests
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I4dcf1bab856621915b6535958d77cdde89105d96
Reviewed-on: https://review.whamcloud.com/42100
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
25 files changed: