batman-adv: store hard_iface as iflink private data
authorMatthias Schiffer <mschiffer@universe-factory.net>
Mon, 19 May 2025 20:46:28 +0000 (22:46 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Sat, 31 May 2025 08:41:11 +0000 (10:41 +0200)
commit7dc284702bcd065a822a4c0bdbca09a08de5a654
tree9d69a4d2b54ae05d61cf7637c43c5844c55f0512
parent2b05db6b8a10df423d5478b20cadb1e190fa136f
batman-adv: store hard_iface as iflink private data

By passing the hard_iface to netdev_master_upper_dev_link() as private
data, we can iterate over hardifs of a mesh interface more efficiently
using netdev_for_each_lower_private*() (instead of iterating over the
global hardif list). In addition, this will enable resolving a hardif
from its netdev using netdev_lower_dev_get_private() and getting rid of
the global list altogether in the following patches.

A similar approach can be seen in the bonding driver.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
13 files changed:
net/batman-adv/bat_algo.c
net/batman-adv/bat_algo.h
net/batman-adv/bat_iv_ogm.c
net/batman-adv/bat_v.c
net/batman-adv/bat_v_elp.c
net/batman-adv/bat_v_ogm.c
net/batman-adv/hard-interface.c
net/batman-adv/main.c
net/batman-adv/mesh-interface.c
net/batman-adv/multicast.c
net/batman-adv/netlink.c
net/batman-adv/originator.c
net/batman-adv/send.c