[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230612214944.1837648-1-kuba@kernel.org>
Date: Mon, 12 Jun 2023 14:49:42 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
dsahern@...il.com,
Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH net-next v2 0/2] net: create device lookup API with reference tracking
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
Powered by blists - more mailing lists