Whamcloud - gitweb
LU-17460 lnet: properly handle net_device referencing 82/55582/5
authorJames Simmons <jsimmons@infradead.org>
Mon, 8 Jul 2024 20:20:52 +0000 (16:20 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 13 Jul 2024 20:54:05 +0000 (20:54 +0000)
commit25ad71fa9e5be305b16948174240c1c50bf4d7e5
tree6d360b689c1483bca59647ecc1ed8afa322724fc
parent1c523c074aa35a082987c91d42082a85c312b9fb
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>
lnet/klnds/socklnd/socklnd.c
lnet/lnet/lib-socket.c
lustre/tests/sanity-lnet.sh