net: create device lookup API with reference tracking
authorJakub Kicinski <kuba@kernel.org>
Mon, 12 Jun 2023 21:49:43 +0000 (14:49 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Jun 2023 07:21:11 +0000 (08:21 +0100)
commit70f7457ad6d655e65f1b93cbba2a519e4b11c946
tree7bcb9abaa510860f230cdefe3e40417e8ed938ba
parent89da780aa4c7667c8b1a144959206262aebdeabe
net: create device lookup API with reference tracking

New users of dev_get_by_index() and dev_get_by_name() keep
getting added and it would be nice to steer them towards
the APIs with reference tracking.

Add variants of those calls which allocate the reference
tracker and use them in a couple of places.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/dev.c
net/ethtool/netlink.c
net/ipv6/route.c