All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nora Schiffer <neocturne@universe-factory.net>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: sven@narfation.org, Nora Schiffer <neocturne@universe-factory.net>
Subject: [PATCH batadv v5 0/6] batman-adv: drop global hard interface list
Date: Sun, 28 Jun 2026 17:07:27 +0200	[thread overview]
Message-ID: <cover.1782658366.git.neocturne@universe-factory.net> (raw)

Cover letter from Sven's v4:

The global hard interface list was used in the past to provide and sysfs
(debugfs, procfs) based configuration interface. This requirement is gone
after it was switched to generic netlink and NETLINK_ROUTE. And after the
wifi-flags cache was introduced, it is also no longer used to get
non-batman-adv attached interface information (for ap_isolation and
re-broadcast configuration).

But this odd net_devices list (batadv_hardif_list) stayed and caused some
headaches:

* memory requirement increased (useless) for each network interface of the
  system
* massive increase of various ethernet operations due to the O(n) nature of
  this global list
* the code had to handle switch of a batadv_hard_iface from one mesh_iface
  to either NULL or a different mesh_iface

Just get rid of it now and start to simplify the code around it.

---

@Sven: Feel free to update the author of "make hard_iface->mesh_iface immutable"
to yourself, as I only pulled your change out into a separate patch.

---

Changes in v5:
- Rebase
- Improve commit description of patch 1
- Further simplify refcounting in enable/disable (holding only 1 ref instead of 3)
- Move immutable hard_iface->mesh_iface change to a separate change
- One new patch with a minor code cleanup
- Sven's follow-up cleanups are not included in this series


Revisions by Sven Eckelmann:

Changes in v4:
- rebase
- don't double-netdev_put in batadv_hardif_enable_interface() error path
  (just let batadv_hardif_put()/batadv_hardif_release() deal with it)
- add patches which cleanup the code after batadv_hard_iface->mesh_iface
  became immutable
- Link to v3: https://patch.msgid.link/20260604-drop-hardif-list-v3-0-e0dfa8c7d602@narfation.org

Changes in v3:
- fix return kernel-doc for batadv_hardif_enable_interface
- drop merged first patch
- really switch to RFC
- in merged batadv_hardif_enable_interface (as intermediate step), only add
  the hard_iface to the batadv_hardif_list when hard_iface is really
  initialized
  + this list is dropped anyway with the patch "remove global hardif list"
- stop setting "mesh_iface" to NULL on error. it is now only important that
  the hard_iface gets unlinked from the mesh_iface
- first drop the batadv_hardif_list before removing the "safety" state
  BATADV_IF_NOT_IN_USE
- Link to v2: https://patch.msgid.link/20260603-drop-hardif-list-v2-0-5f79821ca333@narfation.org

Changes in v2:
- rebased
- submit as RFC to get the discussion started again
- drop already merged "batman-adv: store hard_iface as iflink private data"
- switch from kzalloc to kzalloc_obj
- update author's mail and name
- fix reference counting for batman_adv_ptype
- Link to v1: https://patch.msgid.link/0b26554afea5203820faef1dfb498af7533a9b5d.1747687504.git.mschiffer@universe-factory.net


Nora Schiffer (6):
  batman-adv: create hardif only for netdevs that are part of a mesh
  batman-adv: remove global hardif list
  batman-adv: make hard_iface->mesh_iface immutable
  batman-adv: remove BATADV_IF_NOT_IN_USE hardif state
  batman-adv: move hardif generation counter into batadv_priv
  batman-adv: drop unneeded goto and initialization from
    batadv_hardif_disable_interface()

 net/batman-adv/bat_iv_ogm.c     |   3 +-
 net/batman-adv/bat_v_elp.c      |   3 +-
 net/batman-adv/hard-interface.c | 157 +++++++++++---------------------
 net/batman-adv/hard-interface.h |  10 +-
 net/batman-adv/main.c           |   6 --
 net/batman-adv/main.h           |   3 -
 net/batman-adv/mesh-interface.c |  13 +--
 net/batman-adv/netlink.c        |   4 +-
 net/batman-adv/originator.c     |   4 -
 net/batman-adv/types.h          |   6 +-
 10 files changed, 62 insertions(+), 147 deletions(-)

-- 
2.54.0


             reply	other threads:[~2026-06-28 15:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-28 15:07 Nora Schiffer [this message]
2026-06-28 15:07 ` [PATCH batadv v5 1/6] batman-adv: create hardif only for netdevs that are part of a mesh Nora Schiffer
2026-06-28 15:07 ` [PATCH batadv v5 2/6] batman-adv: remove global hardif list Nora Schiffer
2026-06-28 15:07 ` [PATCH batadv v5 3/6] batman-adv: make hard_iface->mesh_iface immutable Nora Schiffer
2026-06-28 15:07 ` [PATCH batadv v5 4/6] batman-adv: remove BATADV_IF_NOT_IN_USE hardif state Nora Schiffer
2026-06-28 15:07 ` [PATCH batadv v5 5/6] batman-adv: move hardif generation counter into batadv_priv Nora Schiffer
2026-06-28 15:07 ` [PATCH batadv v5 6/6] batman-adv: drop unneeded goto and initialization from batadv_hardif_disable_interface() Nora Schiffer
2026-06-28 19:48 ` [PATCH batadv v5 0/6] batman-adv: drop global hard interface list Sven Eckelmann

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=cover.1782658366.git.neocturne@universe-factory.net \
    --to=neocturne@universe-factory.net \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=sven@narfation.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 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.