LU-17460 lnet: properly handle net_device referencing
Most of the time LNet uses __in[6]_dev_get_xxx() which does no
reference changes. The one expection is the use of dev_get_by_index()
called in lnet_create_socket(). Replace dev_get_by_index() with
dev_get_by_index_rcu(). Also examined the code to make sure the
right type of locking was done. If we use rcu locking we should
use for_each_netdev_rcu() so update ksocknal_ip2index().
Test-Parameters: trivial testlist=sanity-lnet
Fixes:
e4fa181abf1 ("LU-10391 lnet: allow creation of IPv6 socket.")
Fixes:
09c6e2b8722 ("LU-16836 lnet: ensure dev notification on lnd startup")
Change-Id: I0c496652553318bd0e47fa1e03d6e631fd8421bb
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55582
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>