Whamcloud - gitweb
LU-7734 lnet: preferred NIs for non-Multi-Rail peers 34/21534/9
authorOlaf Weber <olaf@sgi.com>
Fri, 27 Jan 2017 15:24:40 +0000 (16:24 +0100)
committerOlaf Weber <olaf@sgi.com>
Fri, 27 Jan 2017 15:41:34 +0000 (16:41 +0100)
commitd1f76f3c0232e497cb40534726d6c61c9611e131
tree6c7b89fdfd96981b99ed304f4c17979127472f7b
parentdfc9e7c9a242e057d6cb5b1d00eae4d064f313d7
LU-7734 lnet: preferred NIs for non-Multi-Rail peers

When a node sends a message to a peer NI, there may be
a preferred local NI that should be the source of the
message. This is in particular the case for non-Multi-
Rail (NMR) peers, as an NMR peer depends in some cases
on the source address of a message to correctly identify
its origin. (This as opposed to using a UUID provided by
a higher protocol layer.)

Implement this by keeping an array of preferred local
NIDs in the lnet_peer_ni structure. The case where only
a single NID needs to be stored is optimized so that this
can be done without needing to allocate any memory.

A flag in the lnet_peer_ni, LNET_PEER_NI_NON_MR_PREF,
indicates that the preferred NI was automatically added
for an NMR peer. Note that a peer which has not been
explicitly configured as Multi-Rail will be treated as
non-Multi-Rail until proven otherwise. These automatic
preferences will be cleared if the peer is changed to
Multi-Rail.

- lnet_peer_ni_set_non_mr_pref_nid()
  set NMR preferred NI for peer_ni
- lnet_peer_ni_clr_non_mr_pref_nid()
  clear NMR preferred NI for peer_ni
- lnet_peer_clr_non_mr_pref_nids()
  clear NMR preferred NIs for all peer_ni

- lnet_peer_add_pref_nid()
  add a preferred NID
- lnet_peer_del_pref_nid()
  delete a preferred NID

Test-Parameters: trivial
Signed-off-by: Olaf Weber <olaf@sgi.com>
Change-Id: I99b891c28c09a1365ef47b4b7deb3eef7e0ad77d
lnet/include/lnet/lib-lnet.h
lnet/include/lnet/lib-types.h
lnet/lnet/lib-move.c
lnet/lnet/peer.c