netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] net: create device lookup API with reference tracking
@ 2023-06-12 21:49 Jakub Kicinski
  2023-06-12 21:49 ` [PATCH net-next v2 1/2] " Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jakub Kicinski @ 2023-06-12 21:49 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, dsahern, Jakub Kicinski

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/20230609183207.1466075-1-kuba@kernel.org/

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-06-17  0:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-12 21:49 [PATCH net-next v2 0/2] net: create device lookup API with reference tracking Jakub Kicinski
2023-06-12 21:49 ` [PATCH net-next v2 1/2] " Jakub Kicinski
2023-06-13  9:14   ` Eric Dumazet
2023-06-14  2:19   ` David Ahern
2023-06-16  8:21   ` Eric Dumazet
2023-06-17  0:10     ` David Ahern
2023-06-12 21:49 ` [PATCH net-next v2 2/2] netpoll: allocate netdev tracker right away Jakub Kicinski
2023-06-15  7:50 ` [PATCH net-next v2 0/2] net: create device lookup API with reference tracking patchwork-bot+netdevbpf
2023-06-15 17:00   ` Jakub Kicinski
2023-06-15 19:41     ` Konstantin Ryabitsev
2023-06-15 20:17       ` Jakub Kicinski
2023-06-15 20:22         ` Konstantin Ryabitsev
2023-06-15 21:56           ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).