netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next 0/2] explicit netdev refs
@ 2021-11-17 17:47 Jakub Kicinski
  2021-11-17 17:47 ` [RFC net-next 1/2] net: add netdev_refs debug Jakub Kicinski
  2021-11-17 17:47 ` [RFC net-next 2/2] vlan: use new netdev_refs infra Jakub Kicinski
  0 siblings, 2 replies; 7+ messages in thread
From: Jakub Kicinski @ 2021-11-17 17:47 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, Jakub Kicinski

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


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

end of thread, other threads:[~2021-11-17 19:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-17 17:47 [RFC net-next 0/2] explicit netdev refs Jakub Kicinski
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

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).