pull request for net-next: batman-adv 2025-03-13
Subsystems (4)
Simon Wunderlich
maintainercover pull request for net-next: batman-adv 2025-03-13
Hi Jakub, hi David,
here is a feature/cleanup pull request of batman-adv to go into net-next.
Please pull or let me know of any problem!
Thank you,
Simon
The following changes since commit b66e19dcf684b21b6d3a1844807bd1df97ad197a:
Merge branch 'mctp-add-mctp-over-usb-hardware-transport-binding' (2025-02-21 16:45:26 -0800)
are available in the Git repository at:
git://git.open-mesh.org/linux-merge.git tags/batadv-next-pullrequest-20250313
for you to fetch changes up to 7cfb32456ed82cd548114234ec275d57d4f7554e:
batman-adv: add missing newlines for log macros (2025-02-23 11:18:36 +0100)
----------------------------------------------------------------
This feature/cleanup patchset includes the following patches:
- bump version strings, by Simon Wunderlich
- drop batadv_priv_debug_log struct, by Sven Eckelmann
- adopt netdev_hold() / netdev_put(), by Eric Dumazet
- add support for jumbo frames, by Sven Eckelmann
- use consistent name for mesh interface, by Sven Eckelmann
- cleanup B.A.T.M.A.N. IV OGM aggregation handling, by Sven Eckelmann (4 patches)
- add missing newlines for log macros, by Sven Eckelmann
----------------------------------------------------------------
Eric Dumazet (1):
batman-adv: adopt netdev_hold() / netdev_put()
Simon Wunderlich (1):
batman-adv: Start new development cycle
Sven Eckelmann (8):
batman-adv: Drop batadv_priv_debug_log struct
batman-adv: Add support for jumbo frames
batman-adv: Use consistent name for mesh interface
batman-adv: Limit number of aggregated packets directly
batman-adv: Switch to bitmap helper for aggregation handling
batman-adv: Use actual packet count for aggregated packets
batman-adv: Limit aggregation size to outgoing MTU
batman-adv: add missing newlines for log macros
Documentation/networking/batman-adv.rst | 2 +-
include/uapi/linux/batman_adv.h | 18 +-
net/batman-adv/Makefile | 2 +-
net/batman-adv/bat_algo.c | 8 +-
net/batman-adv/bat_iv_ogm.c | 105 ++++++-----
net/batman-adv/bat_v.c | 28 +--
net/batman-adv/bat_v_elp.c | 16 +-
net/batman-adv/bat_v_ogm.c | 42 ++---
net/batman-adv/bitarray.c | 2 +-
net/batman-adv/bridge_loop_avoidance.c | 106 +++++------
net/batman-adv/distributed-arp-table.c | 68 +++----
net/batman-adv/distributed-arp-table.h | 4 +-
net/batman-adv/fragmentation.c | 2 +-
net/batman-adv/gateway_client.c | 38 ++--
net/batman-adv/gateway_common.c | 8 +-
net/batman-adv/hard-interface.c | 158 ++++++++--------
net/batman-adv/hard-interface.h | 12 +-
net/batman-adv/log.c | 2 +-
net/batman-adv/log.h | 10 +-
net/batman-adv/main.c | 42 ++---
net/batman-adv/main.h | 24 +--
.../{soft-interface.c => mesh-interface.c} | 197 ++++++++++----------
.../{soft-interface.h => mesh-interface.h} | 22 +--
net/batman-adv/multicast.c | 182 +++++++++----------
net/batman-adv/multicast_forw.c | 30 ++--
net/batman-adv/netlink.c | 180 +++++++++----------
net/batman-adv/netlink.h | 2 +-
net/batman-adv/network-coding.c | 64 +++----
net/batman-adv/originator.c | 58 +++---
net/batman-adv/routing.c | 42 ++---
net/batman-adv/send.c | 36 ++--
net/batman-adv/send.h | 4 +-
net/batman-adv/tp_meter.c | 30 ++--
net/batman-adv/trace.h | 2 +-
net/batman-adv/translation-table.c | 198 ++++++++++-----------
net/batman-adv/translation-table.h | 4 +-
net/batman-adv/tvlv.c | 26 +--
net/batman-adv/types.h | 78 +++-----
38 files changed, 917 insertions(+), 935 deletions(-)
rename net/batman-adv/{soft-interface.c => mesh-interface.c} (84%)
rename net/batman-adv/{soft-interface.h => mesh-interface.h} (50%)Simon Wunderlich
maintainerPATCH 1/10 batman-adv: Start new development cycle
This version will contain all the (major or even only minor) changes for Linux 6.15.
The version number isn't a semantic version number with major and minor information. It is just encoding the year of the expected publishing as Linux -rc1 and the number of published versions this year (starting at 0).
--- net/batman-adv/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/main.h +1 -1
@@ -13,7 +13,7 @@#define BATADV_DRIVER_DEVICE "batman-adv"#ifndef BATADV_SOURCE_VERSION -#define BATADV_SOURCE_VERSION "2025.0" +#define BATADV_SOURCE_VERSION "2025.1"#endif /* B.A.T.M.A.N. parameters */
Signature · 1 line
2.39.5
Re: [PATCH 01/10] batman-adv: Start new development cycle
This series was applied to netdev/net-next.git (main) by Simon Wunderlich <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Simon Wunderlich <[email protected]>:
Quoted 8 lines · On Thu, 13 Mar 2025 17:45:10 +0100 you wrote:
This version will contain all the (major or even only minor) changes for Linux 6.15.
The version number isn't a semantic version number with major and minor information. It is just encoding the year of the expected publishing as Linux -rc1 and the number of published versions this year (starting at 0).
[...]
Here is the summary with links:
- [01/10] batman-adv: Start new development cycle
https://git.kernel.org/netdev/net-next/c/b195d60408d4 - [02/10] batman-adv: Drop batadv_priv_debug_log struct https://git.kernel.org/netdev/net-next/c/9a006e72d30c - [03/10] batman-adv: adopt netdev_hold() / netdev_put() https://git.kernel.org/netdev/net-next/c/00b35530811f - [04/10] batman-adv: Add support for jumbo frames https://git.kernel.org/netdev/net-next/c/1666951c4424 - [05/10] batman-adv: Use consistent name for mesh interface https://git.kernel.org/netdev/net-next/c/94433355027d - [06/10] batman-adv: Limit number of aggregated packets directly https://git.kernel.org/netdev/net-next/c/434becf57bdc - [07/10] batman-adv: Switch to bitmap helper for aggregation handling https://git.kernel.org/netdev/net-next/c/77405977f187 - [08/10] batman-adv: Use actual packet count for aggregated packets https://git.kernel.org/netdev/net-next/c/0db110059e79 - [09/10] batman-adv: Limit aggregation size to outgoing MTU https://git.kernel.org/netdev/net-next/c/e4aa3412f632 - [10/10] batman-adv: add missing newlines for log macros https://git.kernel.org/netdev/net-next/c/7cfb32456ed8
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Simon Wunderlich
maintainerPATCH 2/10 batman-adv: Drop batadv_priv_debug_log struct
In reply to Simon WunderlichFrom: Sven Eckelmann <[email protected]>
The support for the batman-adv ring buffer for debug logs was dropped with the removal of the debugfs filesystem. The structure storing this ring buffer is therefore no longer needed since commit aff6f5a68b92 ("batman-adv: Drop deprecated debugfs support")
--- net/batman-adv/types.h | 28 ---------------------------- 1 file changed, 28 deletions(-)
net/batman-adv/types.h +0 -28
@@ -1137,29 +1137,6 @@ struct batadv_priv_bla { };#endif -#ifdef CONFIG_BATMAN_ADV_DEBUG - -/** -* struct batadv_priv_debug_log - debug logging data -*/ -struct batadv_priv_debug_log { -/** @log_buff: buffer holding the logs (ring buffer) */ -char log_buff[BATADV_LOG_BUF_LEN ]; - -/** @log_start: index of next character to read */ -unsigned long log_start; - -/** @log_end: index of next character to write */ -unsigned long log_end; - -/** @lock: lock protecting log_buff, log_start & log_end */ -spinlock_t lock; - -/** @queue_wait: log reader's wait queue */ -wait_queue_head_t queue_wait; -}; -#endif -/** * struct batadv_priv_gw - per mesh interface gateway data */
@@ -1773,11 +1750,6 @@ struct batadv_priv {struct batadv_priv_bla bla;#endif -#ifdef CONFIG_BATMAN_ADV_DEBUG -/** @debug_log: holding debug logging relevant data */ -struct batadv_priv_debug_log *debug_log; -#endif -/** @gw: gateway data */ struct batadv_priv_gw gw;
Signature · 1 line
2.39.5
Simon Wunderlich
maintainerPATCH 3/10 batman-adv: adopt netdev_hold() / netdev_put()
In reply to Simon WunderlichFrom: Eric Dumazet <[email protected]>
Add a device tracker to struct batadv_hard_iface to help debugging of network device refcount imbalances.
--- net/batman-adv/hard-interface.c | 20 ++++++++------------ net/batman-adv/types.h | 6 ++++++ 2 files changed, 14 insertions(+), 12 deletions(-)
net/batman-adv/hard-interface.c +8 -12
@@ -51,7 +51,7 @@ void batadv_hardif_release(struct kref *ref)struct batadv_hard_iface *hard_iface; hard_iface = container_of(ref, struct batadv_hard_iface, refcount); -dev_put (hard_iface->net_dev); +netdev_put (hard_iface->net_dev, &hard_iface->dev_tracker);kfree_rcu (hard_iface, rcu); }
@@ -728,6 +728,7 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,kref_get (&hard_iface->refcount);dev_hold (soft_iface); +netdev_hold (soft_iface, &hard_iface->softif_dev_tracker,GFP_ATOMIC ); hard_iface->soft_iface = soft_iface; bat_priv =netdev_priv (hard_iface->soft_iface);
@@ -784,7 +785,7 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,netdev_upper_dev_unlink (hard_iface->net_dev, soft_iface); err_dev: hard_iface->soft_iface =NULL ; -dev_put (soft_iface); +netdev_put (soft_iface, &hard_iface->softif_dev_tracker);batadv_hardif_put (hard_iface);return ret; }
@@ -851,7 +852,7 @@ void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface)/* delete all references to this hard_iface */ batadv_purge_orig_ref (bat_priv);batadv_purge_outstanding_packets (bat_priv, hard_iface); -dev_put (hard_iface->soft_iface); +netdev_put (hard_iface->soft_iface, &hard_iface->softif_dev_tracker);netdev_upper_dev_unlink (hard_iface->net_dev, hard_iface->soft_iface);batadv_hardif_recalc_extra_skbroom (hard_iface->soft_iface);
@@ -875,15 +876,15 @@ batadv_hardif_add_interface(struct net_device *net_dev)ASSERT_RTNL ();if (!batadv_is_valid_iface (net_dev)) - goto out; - -dev_hold (net_dev); +return NULL ; hard_iface =kzalloc (sizeof (*hard_iface),GFP_ATOMIC );if (!hard_iface) - goto release_dev; +return NULL ; +netdev_hold (net_dev, &hard_iface->dev_tracker,GFP_ATOMIC ); hard_iface->net_dev = net_dev; + hard_iface->soft_iface =NULL ; hard_iface->if_status =BATADV_IF_NOT_IN_USE ;
@@ -909,11 +910,6 @@ batadv_hardif_add_interface(struct net_device *net_dev) batadv_hardif_generation++;return hard_iface; - -release_dev: -dev_put (net_dev); -out: -return NULL ; }static void batadv_hardif_remove_interface (struct batadv_hard_iface *hard_iface)
net/batman-adv/types.h +6 -0
@@ -186,6 +186,9 @@ struct batadv_hard_iface {/** @net_dev: pointer to the net_device */ struct net_device *net_dev; +/** @dev_tracker: device tracker for @net_dev */ +netdevice_tracker dev_tracker; +/** @refcount: number of contexts the object is used */ struct kref refcount;
@@ -201,6 +204,9 @@ struct batadv_hard_iface {*/ struct net_device *soft_iface; +/** @softif_dev_tracker: device tracker for @soft_iface */ +netdevice_tracker softif_dev_tracker; +/** @rcu: struct used for freeing in an RCU-safe manner */ struct rcu_head rcu;
Signature · 1 line
2.39.5
Simon Wunderlich
maintainerPATCH 4/10 batman-adv: Add support for jumbo frames
In reply to Simon WunderlichFrom: Sven Eckelmann <[email protected]>
Since batman-adv is not actually depending on hardware capabilities, it has no limit on the MTU. Only the lower hard interfaces can limit it. In case these have an high enough MTU or fragmentation is enabled, a higher MTU than 1500 can be enabled.
--- net/batman-adv/hard-interface.c | 4 +--- net/batman-adv/main.h | 2 ++ net/batman-adv/soft-interface.c | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-)
net/batman-adv/hard-interface.c +1 -3
@@ -618,10 +618,8 @@ int batadv_hardif_min_mtu(struct net_device *soft_iface)/* the real soft-interface MTU is computed by removing the payload * overhead from the maximum amount of bytes that was just computed. -* -* However batman-adv does not support MTUs bigger than ETH_DATA_LEN */ -return min_t (int, min_mtu -batadv_max_header_len (),ETH_DATA_LEN ); +return min_t (int, min_mtu -batadv_max_header_len (),BATADV_MAX_MTU ); }/**
net/batman-adv/main.h +2 -0
@@ -22,6 +22,8 @@#define BATADV_THROUGHPUT_MAX_VALUE 0xFFFFFFFF#define BATADV_JITTER 20 +#define BATADV_MAX_MTU (ETH_MAX_MTU - batadv_max_header_len()) +/* Time To Live of broadcast messages */ #define BATADV_TTL 50
net/batman-adv/soft-interface.c +2 -1
@@ -790,7 +790,7 @@ static int batadv_softif_init_late(struct net_device *dev)atomic_set (&bat_priv->log_level,0 );#endif atomic_set (&bat_priv->fragmentation,1 ); -atomic_set (&bat_priv->packet_size_max,ETH_DATA_LEN ); +atomic_set (&bat_priv->packet_size_max,BATADV_MAX_MTU );atomic_set (&bat_priv->bcast_queue_left,BATADV_BCAST_QUEUE_LEN );atomic_set (&bat_priv->batman_queue_left,BATADV_BATMAN_QUEUE_LEN );
@@ -1043,6 +1043,7 @@ static void batadv_softif_init_early(struct net_device *dev)* have not been initialized yet */ dev->mtu =ETH_DATA_LEN ; + dev->max_mtu =BATADV_MAX_MTU ;/* generate random address */ eth_hw_addr_random (dev);
Signature · 1 line
2.39.5
Simon Wunderlich
maintainerPATCH 5/10 batman-adv: Use consistent name for mesh interface
In reply to Simon WunderlichFrom: Sven Eckelmann <[email protected]>
The way how the virtual interface is called inside the batman-adv source code is not consistent. The genl headers call it meshif and the rest of the code calls is (mostly) softif.
The genl definitions cannot be touched because they are part of the UAPI. But the rest of the batman-adv code can be touched to have a consistent name again.
The bulk of the renaming was done using
sed -i -e 's/soft\(-\|\_\| \|\)i\([nf]\)/mesh\1i\2/g' \
-e 's/SOFT\(-\|\_\| \|\)I\([NF]\)/MESH\1I\2/g'and then it was adjusted slightly when proofreading the changes.
---
Documentation/networking/batman-adv.rst | 2 +-
include/uapi/linux/batman_adv.h | 18 +-
net/batman-adv/Makefile | 2 +-
net/batman-adv/bat_algo.c | 8 +-
net/batman-adv/bat_iv_ogm.c | 64 +++---
net/batman-adv/bat_v.c | 28 +--
net/batman-adv/bat_v_elp.c | 16 +-
net/batman-adv/bat_v_ogm.c | 42 ++--
net/batman-adv/bitarray.c | 2 +-
net/batman-adv/bridge_loop_avoidance.c | 106 +++++-----
net/batman-adv/distributed-arp-table.c | 68 +++---
net/batman-adv/distributed-arp-table.h | 4 +-
net/batman-adv/fragmentation.c | 2 +-
net/batman-adv/gateway_client.c | 38 ++--
net/batman-adv/gateway_common.c | 8 +-
net/batman-adv/hard-interface.c | 140 ++++++-------
net/batman-adv/hard-interface.h | 12 +-
net/batman-adv/log.c | 2 +-
net/batman-adv/log.h | 10 +-
net/batman-adv/main.c | 42 ++--
net/batman-adv/main.h | 16 +-
.../{soft-interface.c => mesh-interface.c} | 194 ++++++++---------
.../{soft-interface.h => mesh-interface.h} | 22 +-
net/batman-adv/multicast.c | 182 ++++++++--------
net/batman-adv/multicast_forw.c | 30 +--
net/batman-adv/netlink.c | 178 ++++++++--------
net/batman-adv/netlink.h | 2 +-
net/batman-adv/network-coding.c | 64 +++---
net/batman-adv/originator.c | 58 ++---
net/batman-adv/routing.c | 42 ++--
net/batman-adv/send.c | 34 +--
net/batman-adv/send.h | 4 +-
net/batman-adv/tp_meter.c | 30 +--
net/batman-adv/trace.h | 2 +-
net/batman-adv/translation-table.c | 198 +++++++++---------
net/batman-adv/translation-table.h | 4 +-
net/batman-adv/tvlv.c | 26 +--
net/batman-adv/types.h | 46 ++--
38 files changed, 873 insertions(+), 873 deletions(-)
rename net/batman-adv/{soft-interface.c => mesh-interface.c} (84%)
rename net/batman-adv/{soft-interface.h => mesh-interface.h} (50%)Documentation/networking/batman-adv.rst +1 -1
@@ -27,7 +27,7 @@ Load the batman-adv module into your kernel:: $ insmod batman-adv.ko The module is now waiting for activation. You must add some interfaces on which -batman-adv can operate. The batman-adv soft-interface can be created using the +batman-adv can operate. The batman-adv mesh-interface can be created using the iproute2 tool ``ip``:: $ ip link add name bat0 type batadv
include/uapi/linux/batman_adv.h +9 -9
@@ -342,7 +342,7 @@ enum batadv_nl_attrs {BATADV_ATTR_MCAST_FLAGS_PRIV ,/** -* @BATADV_ATTR_VLANID: VLAN id on top of soft interface +* @BATADV_ATTR_VLANID: VLAN id on top of mesh interface */ BATADV_ATTR_VLANID,
@@ -380,7 +380,7 @@ enum batadv_nl_attrs {/** * @BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED: whether the bridge loop * avoidance feature is enabled. This feature detects and avoids loops -* between the mesh and devices bridged with the soft interface +* between the mesh and devices bridged with the mesh interface */ BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED,
@@ -509,7 +509,7 @@ enum batadv_nl_commands {BATADV_CMD_UNSPEC ,/** -* @BATADV_CMD_GET_MESH: Get attributes from softif/mesh +* @BATADV_CMD_GET_MESH: Get attributes from mesh(if) */ BATADV_CMD_GET_MESH,
@@ -535,7 +535,7 @@ enum batadv_nl_commands {/** * @BATADV_CMD_GET_HARDIF: Get attributes from a hardif of the -* current softif +* current mesh(if) */ BATADV_CMD_GET_HARDIF,
@@ -591,25 +591,25 @@ enum batadv_nl_commands {BATADV_CMD_GET_MCAST_FLAGS ,/** -* @BATADV_CMD_SET_MESH: Set attributes for softif/mesh +* @BATADV_CMD_SET_MESH: Set attributes for mesh(if) */ BATADV_CMD_SET_MESH ,/** * @BATADV_CMD_SET_HARDIF: Set attributes for hardif of the -* current softif +* current mesh(if) */ BATADV_CMD_SET_HARDIF ,/** * @BATADV_CMD_GET_VLAN: Get attributes from a VLAN of the -* current softif +* current mesh(if) */ BATADV_CMD_GET_VLAN ,/** * @BATADV_CMD_SET_VLAN: Set attributes for VLAN of the -* current softif +* current mesh(if) */ BATADV_CMD_SET_VLAN,
@@ -691,7 +691,7 @@ enum batadv_ifla_attrs {*/ IFLA_BATADV_ALGO_NAME, -/* add attributes above here, update the policy in soft-interface.c */ +/* add attributes above here, update the policy in mesh-interface.c */ /** * @__IFLA_BATADV_MAX: internal use
net/batman-adv/Makefile +1 -1
@@ -19,6 +19,7 @@ batman-adv-y += hard-interface.o batman-adv-y += hash.o batman-adv-$(CONFIG_BATMAN_ADV_DEBUG) += log.o batman-adv-y += main.o +batman-adv-y += mesh-interface.o batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast.o batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast_forw.o batman-adv-y += netlink.o
@@ -26,7 +27,6 @@ batman-adv-$(CONFIG_BATMAN_ADV_NC) += network-coding.o batman-adv-y += originator.o batman-adv-y += routing.o batman-adv-y += send.o -batman-adv-y += soft-interface.o batman-adv-$(CONFIG_BATMAN_ADV_TRACING) += trace.o batman-adv-y += tp_meter.o batman-adv-y += translation-table.o
net/batman-adv/bat_algo.c +4 -4
@@ -90,15 +90,15 @@ int batadv_algo_register(struct batadv_algo_ops *bat_algo_ops) }/** -* batadv_algo_select() - Select algorithm of soft interface -* @bat_priv: the bat priv with all the soft interface information +* batadv_algo_select() - Select algorithm of mesh interface +* @bat_priv: the bat priv with all the mesh interface information * @name: name of the algorithm to select * -* The algorithm callbacks for the soft interface will be set when the algorithm +* The algorithm callbacks for the mesh interface will be set when the algorithm * with the correct name was found. Any previous selected algorithm will not be * deinitialized and the new selected algorithm will also not be initialized. * It is therefore not allowed to call batadv_algo_select outside the creation -* function of the soft interface. +* function of the mesh interface. * * Return: 0 on success or negative error number in case of failure */
net/batman-adv/bat_iv_ogm.c +32 -32
248 lines not on this page · raw message
net/batman-adv/bat_v.c +14 -14
@@ -43,7 +43,7 @@static void batadv_v_iface_activate (struct batadv_hard_iface *hard_iface) { -struct batadv_priv *bat_priv =netdev_priv (hard_iface->soft_iface); +struct batadv_priv *bat_priv =netdev_priv (hard_iface->mesh_iface);struct batadv_hard_iface *primary_if; primary_if =batadv_primary_if_get_selected (bat_priv);
@@ -97,7 +97,7 @@ static void batadv_v_primary_iface_set(struct batadv_hard_iface *hard_iface)*/ static void batadv_v_iface_update_mac (struct batadv_hard_iface *hard_iface) { -struct batadv_priv *bat_priv =netdev_priv (hard_iface->soft_iface); +struct batadv_priv *bat_priv =netdev_priv (hard_iface->mesh_iface);struct batadv_hard_iface *primary_if; primary_if =batadv_primary_if_get_selected (bat_priv);
@@ -166,7 +166,7 @@ batadv_v_neigh_dump_neigh(struct sk_buff *msg, u32 portid, u32 seq,* @msg: Netlink message to dump into * @portid: Port making netlink request * @seq: Sequence number of netlink message -* @bat_priv: The bat priv with all the soft interface information +* @bat_priv: The bat priv with all the mesh interface information * @hard_iface: The hard interface to be dumped * @idx_s: Entries to be skipped *
@@ -203,7 +203,7 @@ batadv_v_neigh_dump_hardif(struct sk_buff *msg, u32 portid, u32 seq,* message * @msg: Netlink message to dump into * @cb: Control block containing additional options -* @bat_priv: The bat priv with all the soft interface information +* @bat_priv: The bat priv with all the mesh interface information * @single_hardif: Limit dumping to this hard interface */ static void
@@ -228,7 +228,7 @@ batadv_v_neigh_dump(struct sk_buff *msg, struct netlink_callback *cb, } }else {list_for_each_entry_rcu (hard_iface, &batadv_hardif_list, list) { -if (hard_iface->soft_iface != bat_priv->soft_iface) +if (hard_iface->mesh_iface != bat_priv->mesh_iface)continue ;if (i_hardif++ < i_hardif_s)
@@ -254,7 +254,7 @@ batadv_v_neigh_dump(struct sk_buff *msg, struct netlink_callback *cb,* @msg: Netlink message to dump into * @portid: Port making netlink request * @seq: Sequence number of netlink message -* @bat_priv: The bat priv with all the soft interface information +* @bat_priv: The bat priv with all the mesh interface information * @if_outgoing: Limit dump to entries with this outgoing interface * @orig_node: Originator to dump * @neigh_node: Single hops neighbour
@@ -322,7 +322,7 @@ batadv_v_orig_dump_subentry(struct sk_buff *msg, u32 portid, u32 seq,* @msg: Netlink message to dump into * @portid: Port making netlink request * @seq: Sequence number of netlink message -* @bat_priv: The bat priv with all the soft interface information +* @bat_priv: The bat priv with all the mesh interface information * @if_outgoing: Limit dump to entries with this outgoing interface * @orig_node: Originator to dump * @sub_s: Number of sub entries to skip
@@ -374,7 +374,7 @@ batadv_v_orig_dump_entry(struct sk_buff *msg, u32 portid, u32 seq,* @msg: Netlink message to dump into * @portid: Port making netlink request * @seq: Sequence number of netlink message -* @bat_priv: The bat priv with all the soft interface information +* @bat_priv: The bat priv with all the mesh interface information * @if_outgoing: Limit dump to entries with this outgoing interface * @head: Bucket to be dumped * @idx_s: Number of entries to be skipped
@@ -414,7 +414,7 @@ batadv_v_orig_dump_bucket(struct sk_buff *msg, u32 portid, u32 seq,* batadv_v_orig_dump() - Dump the originators into a message * @msg: Netlink message to dump into * @cb: Control block containing additional options -* @bat_priv: The bat priv with all the soft interface information +* @bat_priv: The bat priv with all the mesh interface information * @if_outgoing: Limit dump to entries with this outgoing interface */ static void
@@ -502,7 +502,7 @@ static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1,/** * batadv_v_init_sel_class() - initialize GW selection class -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information */ static void batadv_v_init_sel_class (struct batadv_priv *bat_priv) {
@@ -553,7 +553,7 @@ static int batadv_v_gw_throughput_get(struct batadv_gw_node *gw_node, u32 *bw)/** * batadv_v_gw_get_best_gw_node() - retrieve the best GW node -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * * Return: the GW node having the best GW-metric, NULL if no GW is known */
@@ -590,7 +590,7 @@ batadv_v_gw_get_best_gw_node(struct batadv_priv *bat_priv)/** * batadv_v_gw_is_eligible() - check if a originator would be selected as GW -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @curr_gw_orig: originator representing the currently selected GW * @orig_node: the originator representing the new candidate *
@@ -647,7 +647,7 @@ static bool batadv_v_gw_is_eligible(struct batadv_priv *bat_priv,* @msg: Netlink message to dump into * @portid: Port making netlink request * @cb: Control block containing additional options -* @bat_priv: The bat priv with all the soft interface information +* @bat_priv: The bat priv with all the mesh interface information * @gw_node: Gateway to be dumped * * Return: Error code, or 0 on success
@@ -746,7 +746,7 @@ static int batadv_v_gw_dump_entry(struct sk_buff *msg, u32 portid,* batadv_v_gw_dump() - Dump gateways into a message * @msg: Netlink message to dump into * @cb: Control block containing additional options -* @bat_priv: The bat priv with all the soft interface information +* @bat_priv: The bat priv with all the mesh interface information */ static void batadv_v_gw_dump (struct sk_buff *msg,struct netlink_callback *cb,struct batadv_priv *bat_priv)
net/batman-adv/bat_v_elp.c +8 -8
@@ -82,7 +82,7 @@ static bool batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh, u32 *pthroughput) {struct batadv_hard_iface *hard_iface = neigh->if_incoming; -struct net_device *soft_iface = hard_iface->soft_iface; +struct net_device *mesh_iface = hard_iface->mesh_iface;struct ethtool_link_ksettings link_settings;struct net_device *real_netdev;struct station_info sinfo;
@@ -92,7 +92,7 @@ static bool batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh,/* don't query throughput when no longer associated with any * batman-adv interface */ -if (!soft_iface) +if (!mesh_iface)return false;/* if the user specified a customised value for this interface, then
@@ -180,7 +180,7 @@ static bool batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh, default_throughput:if (!(hard_iface->bat_v.flags &BATADV_WARNING_DEFAULT )) { - batadv_info(soft_iface, + batadv_info(mesh_iface, "WiFi driver or ethtool info does not provide information about link speeds on interface %s, therefore defaulting to hardcoded throughput values of %u.%1u Mbps. Consider overriding the throughput manually or checking your driver.\n", hard_iface->net_dev->name, BATADV_THROUGHPUT_DEFAULT_VALUE / 10,
@@ -226,7 +226,7 @@ static bool batadv_v_elp_wifi_neigh_probe(struct batadv_hardif_neigh_node *neigh) {struct batadv_hard_iface *hard_iface = neigh->if_incoming; -struct batadv_priv *bat_priv =netdev_priv (hard_iface->soft_iface); +struct batadv_priv *bat_priv =netdev_priv (hard_iface->mesh_iface);unsigned long last_tx_diff;struct sk_buff *skb;int probe_len, i;
@@ -295,7 +295,7 @@ static void batadv_v_elp_periodic_work(struct work_struct *work) bat_v = container_of(work, struct batadv_hard_iface_bat_v, elp_wq.work); hard_iface = container_of(bat_v, struct batadv_hard_iface, bat_v); - bat_priv =netdev_priv (hard_iface->soft_iface); + bat_priv =netdev_priv (hard_iface->mesh_iface);if (atomic_read (&bat_priv->mesh_state) ==BATADV_MESH_DEACTIVATING ) goto out;
@@ -476,7 +476,7 @@ void batadv_v_elp_primary_iface_set(struct batadv_hard_iface *primary_iface)/* update orig field of every elp iface belonging to this mesh */ rcu_read_lock ();list_for_each_entry_rcu (hard_iface, &batadv_hardif_list, list) { -if (primary_iface->soft_iface != hard_iface->soft_iface) +if (primary_iface->mesh_iface != hard_iface->mesh_iface)continue ;batadv_v_elp_iface_activate (primary_iface, hard_iface);
@@ -486,7 +486,7 @@ void batadv_v_elp_primary_iface_set(struct batadv_hard_iface *primary_iface)/** * batadv_v_elp_neigh_update() - update an ELP neighbour node -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @neigh_addr: the neighbour interface address * @if_incoming: the interface the packet was received through * @elp_packet: the received ELP packet
@@ -552,7 +552,7 @@ static void batadv_v_elp_neigh_update(struct batadv_priv *bat_priv,int batadv_v_elp_packet_recv (struct sk_buff *skb,struct batadv_hard_iface *if_incoming) { -struct batadv_priv *bat_priv =netdev_priv (if_incoming->soft_iface); +struct batadv_priv *bat_priv =netdev_priv (if_incoming->mesh_iface);struct batadv_elp_packet *elp_packet;struct batadv_hard_iface *primary_if;struct ethhdr *ethhdr;
net/batman-adv/bat_v_ogm.c +21 -21
157 lines not on this page · raw message
net/batman-adv/bitarray.c +1 -1
@@ -23,7 +23,7 @@ static void batadv_bitmap_shift_left(unsigned long *seq_bits, s32 n)/** * batadv_bit_get_packet() - receive and process one packet within the sequence * number window -* @priv: the bat priv with all the soft interface information +* @priv: the bat priv with all the mesh interface information * @seq_bits: pointer to the sequence number receive packet * @seq_num_diff: difference between the current/received sequence number and * the last sequence number
net/batman-adv/bridge_loop_avoidance.c +53 -53
359 lines not on this page · raw message
net/batman-adv/distributed-arp-table.c +34 -34
255 lines not on this page · raw message
net/batman-adv/distributed-arp-table.h +2 -2
@@ -56,7 +56,7 @@ batadv_dat_init_orig_node_addr(struct batadv_orig_node *orig_node)/** * batadv_dat_init_own_addr() - assign a DAT address to the node itself -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @primary_if: a pointer to the primary interface */ static inline void
@@ -77,7 +77,7 @@ int batadv_dat_cache_dump(struct sk_buff *msg, struct netlink_callback *cb);/** * batadv_dat_inc_counter() - increment the correct DAT packet counter -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @subtype: the 4addr subtype of the packet to be counted * * Updates the ethtool statistics for the received packet if it is a DAT subtype
net/batman-adv/fragmentation.c +1 -1
@@ -349,7 +349,7 @@ bool batadv_frag_skb_fwd(struct sk_buff *skb,struct batadv_hard_iface *recv_if, struct batadv_orig_node *orig_node_src) { - struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); + struct batadv_priv *bat_priv = netdev_priv(recv_if->mesh_iface);struct batadv_neigh_node *neigh_node =NULL ;struct batadv_frag_packet *packet;u16 total_size;
net/batman-adv/gateway_client.c +19 -19
@@ -71,7 +71,7 @@ void batadv_gw_node_release(struct kref *ref)/** * batadv_gw_get_selected_gw_node() - Get currently selected gateway -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * * Return: selected gateway (with increased refcnt), NULL on errors */
@@ -95,7 +95,7 @@ batadv_gw_get_selected_gw_node(struct batadv_priv *bat_priv)/** * batadv_gw_get_selected_orig() - Get originator of currently selected gateway -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * * Return: orig_node of selected gateway (with increased refcnt), NULL on errors */
@@ -144,7 +144,7 @@ static void batadv_gw_select(struct batadv_priv *bat_priv,/** * batadv_gw_reselect() - force a gateway reselection -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * * Set a flag to remind the GW component to perform a new gateway reselection. * However this function does not ensure that the current gateway is going to be
@@ -160,7 +160,7 @@ void batadv_gw_reselect(struct batadv_priv *bat_priv)/** * batadv_gw_check_client_stop() - check if client mode has been switched off -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * * This function assumes the caller has checked that the gw state *is actually * changing*. This function is not supposed to be called when there is no state
@@ -192,7 +192,7 @@ void batadv_gw_check_client_stop(struct batadv_priv *bat_priv)/** * batadv_gw_election() - Elect the best gateway -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information */ void batadv_gw_election (struct batadv_priv *bat_priv) {
@@ -280,7 +280,7 @@ void batadv_gw_election(struct batadv_priv *bat_priv)/** * batadv_gw_check_election() - Elect orig node as best gateway when eligible -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @orig_node: orig node which is to be checked */ void batadv_gw_check_election(struct batadv_priv *bat_priv,
@@ -314,7 +314,7 @@ void batadv_gw_check_election(struct batadv_priv *bat_priv,/** * batadv_gw_node_add() - add gateway node to list of available gateways -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @orig_node: originator announcing gateway capabilities * @gateway: announced bandwidth information *
@@ -361,7 +361,7 @@ static void batadv_gw_node_add(struct batadv_priv *bat_priv,/** * batadv_gw_node_get() - retrieve gateway node from list of available gateways -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @orig_node: originator announcing gateway capabilities * * Return: gateway node if found or NULL otherwise.
@@ -391,7 +391,7 @@ struct batadv_gw_node *batadv_gw_node_get(struct batadv_priv *bat_priv,/** * batadv_gw_node_update() - update list of available gateways with changed * bandwidth information -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @orig_node: originator announcing gateway capabilities * @gateway: announced bandwidth information */
@@ -458,7 +458,7 @@ void batadv_gw_node_update(struct batadv_priv *bat_priv,/** * batadv_gw_node_delete() - Remove orig_node from gateway list -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @orig_node: orig node which is currently in process of being removed */ void batadv_gw_node_delete(struct batadv_priv *bat_priv,
@@ -473,8 +473,8 @@ void batadv_gw_node_delete(struct batadv_priv *bat_priv, }/** -* batadv_gw_node_free() - Free gateway information from soft interface -* @bat_priv: the bat priv with all the soft interface information +* batadv_gw_node_free() - Free gateway information from mesh interface +* @bat_priv: the bat priv with all the mesh interface information */ void batadv_gw_node_free (struct batadv_priv *bat_priv) {
@@ -501,15 +501,15 @@ void batadv_gw_node_free(struct batadv_priv *bat_priv)int batadv_gw_dump (struct sk_buff *msg,struct netlink_callback *cb) {struct batadv_hard_iface *primary_if =NULL ; -struct net_device *soft_iface; +struct net_device *mesh_iface;struct batadv_priv *bat_priv;int ret; - soft_iface =batadv_netlink_get_softif (cb); -if (IS_ERR (soft_iface)) -return PTR_ERR (soft_iface); + mesh_iface =batadv_netlink_get_meshif (cb); +if (IS_ERR (mesh_iface)) +return PTR_ERR (mesh_iface); - bat_priv =netdev_priv (soft_iface); + bat_priv =netdev_priv (mesh_iface); primary_if =batadv_primary_if_get_selected (bat_priv);if (!primary_if || primary_if->if_status !=BATADV_IF_ACTIVE ) {
@@ -528,7 +528,7 @@ int batadv_gw_dump(struct sk_buff *msg, struct netlink_callback *cb) out:batadv_hardif_put (primary_if); -dev_put (soft_iface); +dev_put (mesh_iface);return ret; }
@@ -657,7 +657,7 @@ batadv_gw_dhcp_recipient_get(struct sk_buff *skb, unsigned int *header_len,/** * batadv_gw_out_of_range() - check if the dhcp request destination is the best * gateway -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @skb: the outgoing packet * * Check if the skb is a DHCP request and if it is sent to the current best GW
net/batman-adv/gateway_common.c +4 -4
@@ -20,7 +20,7 @@/** * batadv_gw_tvlv_container_update() - update the gw tvlv container after * gateway setting change -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information */ void batadv_gw_tvlv_container_update (struct batadv_priv *bat_priv) {
@@ -48,7 +48,7 @@ void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv)/** * batadv_gw_tvlv_ogm_handler_v1() - process incoming gateway tvlv container -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @orig: the orig_node of the ogm * @flags: flags indicating the tvlv state (see batadv_tvlv_handler_flags) * @tvlv_value: tvlv buffer containing the gateway data
@@ -89,7 +89,7 @@ static void batadv_gw_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,/** * batadv_gw_init() - initialise the gateway handling internals -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information */ void batadv_gw_init (struct batadv_priv *bat_priv) {
@@ -105,7 +105,7 @@ void batadv_gw_init(struct batadv_priv *bat_priv)/** * batadv_gw_free() - free the gateway handling internals -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information */ void batadv_gw_free (struct batadv_priv *bat_priv) {
net/batman-adv/hard-interface.c +70 -70
404 lines not on this page · raw message
net/batman-adv/hard-interface.h +6 -6
@@ -23,12 +23,12 @@enum batadv_hard_if_state {/** * @BATADV_IF_NOT_IN_USE: interface is not used as slave interface of a -* batman-adv soft interface +* batman-adv mesh interface */ BATADV_IF_NOT_IN_USE ,/** -* @BATADV_IF_TO_BE_REMOVED: interface will be removed from soft +* @BATADV_IF_TO_BE_REMOVED: interface will be removed from mesh * interface */ BATADV_IF_TO_BE_REMOVED ,
@@ -74,10 +74,10 @@ bool batadv_is_wifi_hardif(struct batadv_hard_iface *hard_iface);struct batadv_hard_iface *batadv_hardif_get_by_netdev (const struct net_device *net_dev);int batadv_hardif_enable_interface (struct batadv_hard_iface *hard_iface, -struct net_device *soft_iface); +struct net_device *mesh_iface);void batadv_hardif_disable_interface (struct batadv_hard_iface *hard_iface); -int batadv_hardif_min_mtu (struct net_device *soft_iface); -void batadv_update_min_mtu (struct net_device *soft_iface); +int batadv_hardif_min_mtu (struct net_device *mesh_iface); +void batadv_update_min_mtu (struct net_device *mesh_iface);void batadv_hardif_release (struct kref *ref);int batadv_hardif_no_broadcast (struct batadv_hard_iface *if_outgoing,u8 *orig_addr,u8 *orig_neigh);
@@ -97,7 +97,7 @@ static inline void batadv_hardif_put(struct batadv_hard_iface *hard_iface)/** * batadv_primary_if_get_selected() - Get reference to primary interface -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * * Return: primary interface (with increased refcnt), otherwise NULL */
net/batman-adv/log.c +1 -1
@@ -13,7 +13,7 @@/** * batadv_debug_log() - Add debug log entry -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @fmt: format string * * Return: 0 on success or negative error number in case of failure
net/batman-adv/log.h +5 -5
@@ -71,7 +71,7 @@ __printf(2, 3);/** * _batadv_dbg() - Store debug output with(out) rate limiting * @type: type of debug message -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @ratelimited: whether output should be rate limited * @fmt: format string * @arg: variable arguments
@@ -97,7 +97,7 @@ static inline void _batadv_dbg(int type __always_unused,/** * batadv_dbg() - Store debug output without rate limiting * @type: type of debug message -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @arg: format string and variable arguments */ #define batadv_dbg(type, bat_priv, arg...) \
@@ -106,7 +106,7 @@ static inline void _batadv_dbg(int type __always_unused,/** * batadv_dbg_ratelimited() - Store debug output with rate limiting * @type: type of debug message -* @bat_priv: the bat priv with all the soft interface information +* @bat_priv: the bat priv with all the mesh interface information * @arg: format string and variable arguments */ #define batadv_dbg_ratelimited(type, bat_priv, arg...) \
@@ -114,7 +114,7 @@ static inline void _batadv_dbg(int type __always_unused,/** * batadv_info() - Store message in debug buffer and print it to kmsg buffer -* @net_dev: the soft interface net device +* @net_dev: the mesh interface net device * @fmt: format string * @arg: variable arguments */
@@ -128,7 +128,7 @@ static inline void _batadv_dbg(int type __always_unused,/** * batadv_err() - Store error in debug buffer and print it to kmsg buffer -* @net_dev: the soft interface net device +* @net_dev: the mesh interface net device * @fmt: format string * @arg: variable arguments */
net/batman-adv/main.c +21 -21
134 lines not on this page · raw message
net/batman-adv/main.h +8 -8
@@ -131,10 +131,10 @@#define BATADV_TP_MAX_NUM 5/** -* enum batadv_mesh_state - State of a soft interface +* enum batadv_mesh_state - State of a mesh interface */ enum batadv_mesh_state { -/** @BATADV_MESH_INACTIVE: soft interface is not yet running */ +/** @BATADV_MESH_INACTIVE: mesh interface is not yet running */ BATADV_MESH_INACTIVE ,/** @BATADV_MESH_ACTIVE: interface is up and running */
@@ -240,8 +240,8 @@ extern unsigned int batadv_hardif_generation;extern unsigned char batadv_broadcast_addr[];extern struct workqueue_struct *batadv_event_workqueue; -int batadv_mesh_init (struct net_device *soft_iface); -void batadv_mesh_free (struct net_device *soft_iface); +int batadv_mesh_init (struct net_device *mesh_iface); +void batadv_mesh_free (struct net_device *mesh_iface);bool batadv_is_my_mac (struct batadv_priv *bat_priv,const u8 *addr);int batadv_max_header_len (void );void batadv_skb_set_priority (struct sk_buff *skb,int offset);
@@ -347,8 +347,8 @@ static inline bool batadv_has_timed_out(unsigned long timestamp,#define batadv_seq_after (x, y) batadv_seq_before(y, x)/** -* batadv_add_counter() - Add to per cpu statistics counter of soft interface -* @bat_priv: the bat priv with all the soft interface information +* batadv_add_counter() - Add to per cpu statistics counter of mesh interface +* @bat_priv: the bat priv with all the mesh interface information * @idx: counter index which should be modified * @count: value to increase counter by *
@@ -361,8 +361,8 @@ static inline void batadv_add_counter(struct batadv_priv *bat_priv, size_t idx, }/** -* batadv_inc_counter() - Increase per cpu statistics counter of soft interface -* @b: the bat priv with all the soft interface information +* batadv_inc_counter() - Increase per cpu statistics counter of mesh interface +* @b: the bat priv with all the mesh interface information * @i: counter index which should be modified */ #define batadv_inc_counter (b, i) batadv_add_counter(b, i, 1)
net/batman-adv/mesh-interface.c renamed from net/batman-adv/soft-interface.c +97 -97
523 lines not on this page · raw message
net/batman-adv/mesh-interface.h renamed from net/batman-adv/soft-interface.h +11 -11
@@ -4,8 +4,8 @@* Marek Lindner */ -#ifndef _NET_BATMAN_ADV_SOFT_INTERFACE_H_ -#define _NET_BATMAN_ADV_SOFT_INTERFACE_H_ +#ifndef _NET_BATMAN_ADV_MESH_INTERFACE_H_ +#define _NET_BATMAN_ADV_MESH_INTERFACE_H_#include "main.h"
@@ -16,27 +16,27 @@#include <net/rtnetlink.h> int batadv_skb_head_push (struct sk_buff *skb,unsigned int len); -void batadv_interface_rx (struct net_device *soft_iface, +void batadv_interface_rx (struct net_device *mesh_iface,struct sk_buff *skb,int hdr_size,struct batadv_orig_node *orig_node); -bool batadv_softif_is_valid (const struct net_device *net_dev); +bool batadv_meshif_is_valid (const struct net_device *net_dev);extern struct rtnl_link_ops batadv_link_ops; -int batadv_softif_create_vlan (struct batadv_priv *bat_priv,unsigned short vid); -void batadv_softif_vlan_release (struct kref *ref); -struct batadv_softif_vlan *batadv_softif_vlan_get (struct batadv_priv *bat_priv, +int batadv_meshif_create_vlan (struct batadv_priv *bat_priv,unsigned short vid); +void batadv_meshif_vlan_release (struct kref *ref); +struct batadv_meshif_vlan *batadv_meshif_vlan_get (struct batadv_priv *bat_priv,unsigned short vid);/** -* batadv_softif_vlan_put() - decrease the vlan object refcounter and +* batadv_meshif_vlan_put() - decrease the vlan object refcounter and * possibly release it * @vlan: the vlan object to release */ -static inline void batadv_softif_vlan_put (struct batadv_softif_vlan *vlan) +static inline void batadv_meshif_vlan_put (struct batadv_meshif_vlan *vlan) {if (!vlan)return ; -kref_put (&vlan->refcount, batadv_softif_vlan_release); +kref_put (&vlan->refcount, batadv_meshif_vlan_release); } -#endif /* _NET_BATMAN_ADV_SOFT_INTERFACE_H_ */ +#endif /* _NET_BATMAN_ADV_MESH_INTERFACE_H_ */
net/batman-adv/multicast.c +91 -91
273 lines not on this page · raw message
net/batman-adv/netlink.c +89 -89
178 lines not on this page · raw message
net/batman-adv/network-coding.c +32 -32
64 lines not on this page · raw message
net/batman-adv/originator.c +29 -29
58 lines not on this page · raw message
net/batman-adv/routing.c +21 -21
42 lines not on this page · raw message
net/batman-adv/translation-table.c +99 -99
198 lines not on this page · raw message
net/batman-adv/types.h +23 -23
46 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.39.5
Part of the diff is not shown here. View the raw message.
Simon Wunderlich
maintainerPATCH 6/10 batman-adv: Limit number of aggregated packets directly
In reply to Simon WunderlichFrom: Sven Eckelmann <[email protected]>
The currently selected size in BATADV_MAX_AGGREGATION_BYTES (512) is chosen such that the number of possible aggregated packets is lower than 32. This number must be limited so that the type of batadv_forw_packet->direct_link_flags has enough bits to represent each packet (with the size of at least 24 bytes).
This requirement is better implemented in code instead of having it inside a comment.
--- net/batman-adv/bat_iv_ogm.c | 4 ++++ net/batman-adv/main.h | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-)
net/batman-adv/bat_iv_ogm.c +4 -0
@@ -446,6 +446,7 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet,struct batadv_ogm_packet *batadv_ogm_packet;int aggregated_bytes = forw_packet->packet_len + packet_len;struct batadv_hard_iface *primary_if =NULL ; +u8 packet_num = forw_packet->num_packets +1 ;bool res = false;unsigned long aggregation_end_time;
@@ -468,6 +469,9 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet,if (aggregated_bytes >BATADV_MAX_AGGREGATION_BYTES )return false; +if (packet_num >=BITS_PER_TYPE (forw_packet->direct_link_flags)) +return false; +/* packet is not leaving on the same interface. */ if (forw_packet->if_outgoing != if_outgoing)return false;
net/batman-adv/main.h +0 -3
@@ -104,9 +104,6 @@*/ #define BATADV_TQ_SIMILARITY_THRESHOLD 50 -/* should not be bigger than 512 bytes or change the size of -* forw_packet->direct_link_flags -*/ #define BATADV_MAX_AGGREGATION_BYTES 512#define BATADV_MAX_AGGREGATION_MS 100
Signature · 1 line
2.39.5
Simon Wunderlich
maintainerPATCH 7/10 batman-adv: Switch to bitmap helper for aggregation handling
In reply to Simon WunderlichFrom: Sven Eckelmann <[email protected]>
The aggregation code duplicates code which already exists in the the bitops and bitmap helper. By switching to the bitmap helpers, operating on larger aggregations becomes possible without touching the different portions of the code which read/modify direct_link_flags.
--- net/batman-adv/bat_iv_ogm.c | 19 +++++++++---------- net/batman-adv/main.h | 1 + net/batman-adv/types.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-)
net/batman-adv/bat_iv_ogm.c +9 -10
@@ -355,7 +355,7 @@ static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet,/* we might have aggregated direct link packets with an * ordinary base packet */ -if (forw_packet->direct_link_flags &BIT (packet_num) && +if (test_bit (packet_num, forw_packet->direct_link_flags) && forw_packet->if_incoming == hard_iface) batadv_ogm_packet->flags |=BATADV_DIRECTLINK ;else
@@ -460,6 +460,7 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet,* - the send time is within our MAX_AGGREGATION_MS time * - the resulting packet won't be bigger than * MAX_AGGREGATION_BYTES +* - the number of packets is lower than MAX_AGGREGATION_PACKETS * otherwise aggregation is not possible */ if (!time_before(send_time, forw_packet->send_time) ||
@@ -469,7 +470,7 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet,if (aggregated_bytes >BATADV_MAX_AGGREGATION_BYTES )return false; -if (packet_num >=BITS_PER_TYPE (forw_packet->direct_link_flags)) +if (packet_num >=BATADV_MAX_AGGREGATION_PACKETS )return false;/* packet is not leaving on the same interface. */
@@ -578,12 +579,13 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,memcpy (skb_buff, packet_buff, packet_len); forw_packet_aggr->own = own_packet; - forw_packet_aggr->direct_link_flags =BATADV_NO_FLAGS ; +bitmap_zero (forw_packet_aggr->direct_link_flags, +BATADV_MAX_AGGREGATION_PACKETS ); forw_packet_aggr->send_time = send_time;/* save packet direct link flag status */ if (direct_link) - forw_packet_aggr->direct_link_flags |=1 ; +set_bit (0 , forw_packet_aggr->direct_link_flags);INIT_DELAYED_WORK (&forw_packet_aggr->delayed_work, batadv_iv_send_outstanding_bat_ogm_packet);
@@ -596,17 +598,14 @@ static void batadv_iv_ogm_aggregate(struct batadv_forw_packet *forw_packet_aggr,const unsigned char *packet_buff, int packet_len, bool direct_link) { - unsigned long new_direct_link_flag; - skb_put_data(forw_packet_aggr->skb, packet_buff, packet_len); forw_packet_aggr->packet_len += packet_len; forw_packet_aggr->num_packets++;/* save packet direct link flag status */ -if (direct_link) { - new_direct_link_flag =BIT (forw_packet_aggr->num_packets); - forw_packet_aggr->direct_link_flags |= new_direct_link_flag; - } +if (direct_link) +set_bit (forw_packet_aggr->num_packets, + forw_packet_aggr->direct_link_flags); }/**
net/batman-adv/main.h +1 -0
@@ -104,6 +104,7 @@*/ #define BATADV_TQ_SIMILARITY_THRESHOLD 50 +#define BATADV_MAX_AGGREGATION_PACKETS 32#define BATADV_MAX_AGGREGATION_BYTES 512#define BATADV_MAX_AGGREGATION_MS 100
net/batman-adv/types.h +1 -1
@@ -2139,7 +2139,7 @@ struct batadv_forw_packet {u16 packet_len;/** @direct_link_flags: direct link flags for aggregated OGM packets */ -u32 direct_link_flags; +DECLARE_BITMAP (direct_link_flags,BATADV_MAX_AGGREGATION_PACKETS );/** @num_packets: counter for aggregated OGMv1 packets */ u8 num_packets;
Signature · 1 line
2.39.5
Simon Wunderlich
maintainerPATCH 8/10 batman-adv: Use actual packet count for aggregated packets
In reply to Simon WunderlichFrom: Sven Eckelmann <[email protected]>
The batadv_forw_packet->num_packets didn't store the number of packets but the the number of packets - 1. This didn't had any effects on the actual handling of aggregates but can easily be a source of confusion when reading the code.
--- net/batman-adv/bat_iv_ogm.c | 5 +++-- net/batman-adv/send.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
net/batman-adv/bat_iv_ogm.c +3 -2
@@ -446,7 +446,7 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet,struct batadv_ogm_packet *batadv_ogm_packet;int aggregated_bytes = forw_packet->packet_len + packet_len;struct batadv_hard_iface *primary_if =NULL ; -u8 packet_num = forw_packet->num_packets +1 ; +u8 packet_num = forw_packet->num_packets;bool res = false;unsigned long aggregation_end_time;
@@ -600,12 +600,13 @@ static void batadv_iv_ogm_aggregate(struct batadv_forw_packet *forw_packet_aggr, {skb_put_data (forw_packet_aggr->skb, packet_buff, packet_len); forw_packet_aggr->packet_len += packet_len; - forw_packet_aggr->num_packets++;/* save packet direct link flag status */ if (direct_link)set_bit (forw_packet_aggr->num_packets, forw_packet_aggr->direct_link_flags); + + forw_packet_aggr->num_packets++; }/**
net/batman-adv/send.c +1 -1
@@ -532,7 +532,7 @@ batadv_forw_packet_alloc(struct batadv_hard_iface *if_incoming, forw_packet->queue_left = queue_left; forw_packet->if_incoming = if_incoming; forw_packet->if_outgoing = if_outgoing; - forw_packet->num_packets =0 ; + forw_packet->num_packets =1 ;return forw_packet;
Signature · 1 line
2.39.5
Simon Wunderlich
maintainerPATCH 9/10 batman-adv: Limit aggregation size to outgoing MTU
In reply to Simon WunderlichFrom: Sven Eckelmann <[email protected]>
If a B.A.T.M.A.N. IV aggregated OGM was prepared, it was always assumed that 512 bytes (BATADV_MAX_AGGREGATION_BYTES) can be transmitted. But the outgoing MTU might be too small for these 512 bytes and the aggregation size must be adjusted in this case. Otherwise, the aggregates will cause unnecessary packet loss.
For now, the non-aggregated packet length is not touched.
--- net/batman-adv/bat_iv_ogm.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
net/batman-adv/bat_iv_ogm.c +11 -6
@@ -23,6 +23,7 @@#include <linux/kref.h> #include <linux/list.h> #include <linux/lockdep.h> +#include <linux/minmax.h> #include <linux/mutex.h> #include <linux/netdevice.h> #include <linux/netlink.h>
@@ -444,22 +445,26 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet, const struct batadv_forw_packet *forw_packet) {struct batadv_ogm_packet *batadv_ogm_packet; -int aggregated_bytes = forw_packet->packet_len + packet_len; +unsigned int aggregated_bytes = forw_packet->packet_len + packet_len;struct batadv_hard_iface *primary_if =NULL ;u8 packet_num = forw_packet->num_packets;bool res = false;unsigned long aggregation_end_time; +unsigned int max_bytes; batadv_ogm_packet = (struct batadv_ogm_packet *)forw_packet->skb->data; aggregation_end_time = send_time; aggregation_end_time +=msecs_to_jiffies (BATADV_MAX_AGGREGATION_MS ); + max_bytes = min_t(unsigned int, if_outgoing->net_dev->mtu, +BATADV_MAX_AGGREGATION_BYTES ); +/* we can aggregate the current packet to this aggregated packet * if: * * - the send time is within our MAX_AGGREGATION_MS time * - the resulting packet won't be bigger than -* MAX_AGGREGATION_BYTES +* MAX_AGGREGATION_BYTES and MTU of the outgoing interface * - the number of packets is lower than MAX_AGGREGATION_PACKETS * otherwise aggregation is not possible */
@@ -467,7 +472,7 @@ batadv_iv_ogm_can_aggregate(const struct batadv_ogm_packet *new_bat_ogm_packet, !time_after_eq(aggregation_end_time, forw_packet->send_time))return false; -if (aggregated_bytes >BATADV_MAX_AGGREGATION_BYTES ) +if (aggregated_bytes > max_bytes)return false;if (packet_num >=BATADV_MAX_AGGREGATION_PACKETS )
@@ -552,9 +557,9 @@ static void batadv_iv_ogm_aggregate_new(const unsigned char *packet_buff,unsigned int skb_size;atomic_t *queue_left = own_packet ?NULL : &bat_priv->batman_queue_left; -if (atomic_read (&bat_priv->aggregated_ogms) && - packet_len <BATADV_MAX_AGGREGATION_BYTES ) - skb_size =BATADV_MAX_AGGREGATION_BYTES ; +if (atomic_read (&bat_priv->aggregated_ogms)) + skb_size = max_t(unsigned int, BATADV_MAX_AGGREGATION_BYTES, + packet_len);else skb_size = packet_len;
Signature · 1 line
2.39.5
Simon Wunderlich
maintainerPATCH 10/10 batman-adv: add missing newlines for log macros
In reply to Simon WunderlichFrom: Sven Eckelmann <[email protected]>
Missing trailing newlines can lead to incomplete log lines that do not appear properly in dmesg or in console output.
--- net/batman-adv/netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/netlink.c +1 -1
@@ -1567,7 +1567,7 @@ void __init batadv_netlink_register(void) ret =genl_register_family (&batadv_netlink_family);if (ret) -pr_warn ("unable to register netlink family" ); +pr_warn ("unable to register netlink family\n" ); }/**
Signature · 1 line
2.39.5