Subject: [PATCH net-next v2 0/2] net: create device lookup API with reference tracking

From: Jakub Kicinski <[email-masked]>
Date: Mon, 12 Jun 2023 14:49:42 -0700

We still see dev_hold() / dev_put() calls without reference tracker
getting added in new code. dev_get_by_name() / dev_get_by_index()
seem to be one of the sources of those. Provide appropriate helpers.
Allocating the tracker can obviously be done with an additional call
to netdev_tracker_alloc(), but a single API feels cleaner.

v2:
 - fix a dev_put() in ethtool
v1: https://lore.kernel.org/all/[email-masked]/

Jakub Kicinski (2):
  net: create device lookup API with reference tracking
  netpoll: allocate netdev tracker right away

 include/linux/netdevice.h |  4 +++
 net/core/dev.c            | 75 ++++++++++++++++++++++++++-------------
 net/core/netpoll.c        |  5 ++-
 net/ethtool/netlink.c     | 10 +++---
 net/ipv6/route.c          | 12 +++----
 5 files changed, 68 insertions(+), 38 deletions(-)

-- 
2.40.1