netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: edumazet@google.com
Cc: davem@davemloft.net, netdev@vger.kernel.org, pabeni@redhat.com,
	dsahern@gmail.com, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 0/2] net: create device lookup API with reference tracking
Date: Fri,  9 Jun 2023 11:32:05 -0700	[thread overview]
Message-ID: <20230609183207.1466075-1-kuba@kernel.org> (raw)

We still see dev_hold() / dev_put() calls without reference tracker
getting added in the 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.

Eric, LMK if you prefer to keep the current flow, maybe it's just me.

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     |  8 ++---
 net/ipv6/route.c          | 12 +++----
 5 files changed, 67 insertions(+), 37 deletions(-)

-- 
2.40.1


             reply	other threads:[~2023-06-09 18:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 18:32 Jakub Kicinski [this message]
2023-06-09 18:32 ` [PATCH net-next 1/2] net: create device lookup API with reference tracking Jakub Kicinski
2023-06-09 18:50   ` Eric Dumazet
2023-06-09 19:16     ` Jakub Kicinski
2023-06-09 18:57   ` Eric Dumazet
2023-06-09 18:59     ` Eric Dumazet
2023-06-09 18:32 ` [PATCH net-next 2/2] netpoll: allocate netdev tracker right away Jakub Kicinski
2023-06-09 18:46   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230609183207.1466075-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).