[PATCH RFC batadv v4 0/7] batman-adv: drop global hard interface list
Sven Eckelmann <[email protected]> Sun, 07 Jun 2026 13:53:54 +0200
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <[email protected]> |
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. This RFC is on purpose not Signed-off-by because I just want to restart the discussion but didn't discuss this with the original author (nor documented the changes in each patch in detail). And it is also not meant to look like I've reviewed the changes and Ack it - this is unfortunately something which I have to do again with this rebased version. I will later post an range-diff which contains all the changes. Signed-off-by: Sven Eckelmann <[email protected]> --- 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/[email protected] 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/[email protected] 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 (4): batman-adv: only create hardif while a netdev is part of a mesh batman-adv: remove global hardif list batman-adv: remove BATADV_IF_NOT_IN_USE hardif state batman-adv: move hardif generation counter into batadv_priv Sven Eckelmann (3): batman-adv: drop NULL check for immutable hardif->mesh_iface Revert "batman-adv: v: stop OGMv2 on disabled interface" batman-adv: iv: drop migration check for batadv_hard_iface net/batman-adv/bat_iv_ogm.c | 8 +- net/batman-adv/bat_v_elp.c | 9 +- net/batman-adv/bat_v_ogm.c | 33 +++---- net/batman-adv/bridge_loop_avoidance.c | 9 +- net/batman-adv/hard-interface.c | 155 +++++++++++---------------------- net/batman-adv/hard-interface.h | 10 +-- net/batman-adv/main.c | 9 -- 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 +- 12 files changed, 75 insertions(+), 188 deletions(-) --- base-commit: 385b248dd4e46c4ce022adeb1b13e547d1954901 change-id: 20260531-drop-hardif-list-bcf812da69dd Best regards, -- Sven Eckelmann <[email protected]>