Whamcloud - gitweb
LU-11838 lnet: change lnet_ipaddr_enumerate() to use for_each_netdev() 71/35171/2
authorNeilBrown <neilb@suse.com>
Tue, 11 Jun 2019 05:29:31 +0000 (22:29 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 27 Jun 2019 21:46:40 +0000 (21:46 +0000)
commit37c2a277d1497cf9fc1d5f913f29d7fd229bc499
tree44f4f9ed04bb3c327cd1a1dfb9e05575cb080509
parent16551104ccf583da9a888df9ce51e378c5e052ec
LU-11838 lnet: change lnet_ipaddr_enumerate() to use for_each_netdev()

for_each_netdev() is a more direct interface than
lnet_ipif_enumerate(), so use it instead.  Also get
address and 'up' status directly from the device.

This means we need to possible re-allocate the storage
space if there are lots of IP addresses.

However there is no need to resize the allocation down if we
over-allocated.  This is only used once, and is freed soon
after it is allocated, so that is a false optimization.

Linux-commit: 0400cf406c32ac3968241cd528747d922b6c55c3

This patch is back-ported from the following one:
Lustre-commit: f5991afd8779fe747778e28e998277a10242a57d
Lustre-change: https://review.whamcloud.com/33969

Change-Id: I1c1e7722c7b2b267dcb8134ae295a54f976d96ad
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: Doug Oucharek <dougso@me.com>
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/35171
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/config.c