Whamcloud - gitweb
LU-10391 socklnd: factor out key calculation for ksnd_peers
The hash_table library requires a "long" to be used as a key. We
currently provide the nid, which at 64bits is a suitable long on 64bit
hosts, but isn't really correct on 32bit hosts.
When we change to an extend nid (which is 160bits) it will be even
less appropriate.
So create a separate function to compute a 'long' key, and implement
by simply xoring 'long'-sized parts of the nid together. On a 64bit
machine, this is currently optimized away for lnet_nid_t, but that
will change when we convert to struct lnet_nid.
This new function is placed in lnet-types.h as it will be more
generally useful later.
The hash_table library calls hash_long() on the key, so we don't need
to do anything more interesting than xoring.
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: I22c59a87c9872bb59a2f47c2a8c57b287ed53ed3
Reviewed-on: https://review.whamcloud.com/42103
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>