From: Jakub Kicinski <kuba@kernel.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, eric.dumazet@gmail.com,
Jakub Kicinski <kuba@kernel.org>
Subject: [RFC net-next 0/2] explicit netdev refs
Date: Wed, 17 Nov 2021 09:47:21 -0800 [thread overview]
Message-ID: <20211117174723.2305681-1-kuba@kernel.org> (raw)
syzbot keeps accumulating netdev ref leak errors. These are notoriously
hard to debug. We can't do much about all the old code at this point,
this set tries to provide an API for the new code to use.
It basically adds a explicitly reference counted pointer (there's probably
a better name for this). It's a structure which wraps the netdev pointer
and helps us doing sanity checking.
There isn't much that's netdev-specific here, but we probably still want
to keep our own wrappers even if the main struct gets generalized, so
that we can keep the helpers typed.
Sending as an RFC because vlan refcounting has a bug which needs to be
fixed first [1]. Explicit refs catch it and spew warnings appropriately.
[1] https://lore.kernel.org/all/87k0h9bb9x.fsf@nvidia.com/
Jakub Kicinski (2):
net: add netdev_refs debug
vlan: use new netdev_refs infra
MAINTAINERS | 1 +
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 3 +-
include/linux/if_vlan.h | 11 +-
include/linux/netdev_refs.h | 104 +++++++++++++++++++
lib/Kconfig.debug | 7 ++
net/8021q/vlan.c | 13 +--
net/8021q/vlan_core.c | 4 +-
net/8021q/vlan_dev.c | 63 +++++------
net/8021q/vlan_gvrp.c | 5 +-
net/8021q/vlan_mvrp.c | 5 +-
net/8021q/vlan_netlink.c | 4 +-
net/8021q/vlanproc.c | 6 +-
net/core/dev.c | 8 ++
13 files changed, 186 insertions(+), 48 deletions(-)
create mode 100644 include/linux/netdev_refs.h
--
2.31.1
next reply other threads:[~2021-11-17 17:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 17:47 Jakub Kicinski [this message]
2021-11-17 17:47 ` [RFC net-next 1/2] net: add netdev_refs debug Jakub Kicinski
2021-11-17 18:24 ` Leon Romanovsky
2021-11-17 18:35 ` Jakub Kicinski
2021-11-17 19:27 ` Leon Romanovsky
2021-11-17 19:13 ` Eric Dumazet
2021-11-17 17:47 ` [RFC net-next 2/2] vlan: use new netdev_refs infra 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=20211117174723.2305681-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/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).