All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	dsahern@gmail.com, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v2 0/2] net: create device lookup API with reference tracking
Date: Mon, 12 Jun 2023 14:49:42 -0700	[thread overview]
Message-ID: <20230612214944.1837648-1-kuba@kernel.org> (raw)

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


             reply	other threads:[~2023-06-12 21:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 21:49 Jakub Kicinski [this message]
2023-06-12 21:49 ` [PATCH net-next v2 1/2] net: create device lookup API with reference tracking 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

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=20230612214944.1837648-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.