batman-adv: release station info tidstats
Sven Eckelmann
maintainerPATCH 1/1 batman-adv: release station info tidstats
From: Felix Fietkau <[email protected]>
With the addition of TXQ stats in the per-tid statistics the struct station_info grew significantly. This resulted in stack size warnings due to the structure itself being above the limit for the warnings.
To work around this, the TID array was allocated dynamically. Also a function to free this content was introduced with commit 7ea3e110f2f8 ("cfg80211: release station info tidstats where needed") but the necessary changes were not provided for batman-adv's B.A.T.M.A.N. V implementation.
---
Cc: Johannes Berg <[email protected]>
Cc: Arend van Spriel <[email protected]>
Felix Fietkau didn't really send this patch to us and thus also didn't signed it off. This is just a proposal how we could integrate it - please inform me how we want to deal with it.
Thanks to Martin Weinelt for discovering this change and forwarding it to us.
--- compat-include/net/cfg80211.h | 7 +++++++ net/batman-adv/bat_v_elp.c | 3 +++ 2 files changed, 10 insertions(+)
compat-include/net/cfg80211.h +7 -0
@@ -79,4 +79,11 @@ static inline int batadv_cfg80211_get_station(struct net_device *dev,#endif /* < KERNEL_VERSION(4, 18, 0) && IS_ENABLED(CONFIG_CFG80211) */ + +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,18 ,0 ) + +#define cfg80211_sinfo_release_content (sinfo) + +#endif /* < KERNEL_VERSION(4, 18, 0) */ +#endif /* _NET_BATMAN_ADV_COMPAT_NET_CFG80211_H_ */
net/batman-adv/bat_v_elp.c +3 -0
@@ -104,6 +104,9 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh) ret =cfg80211_get_station (real_netdev, neigh->addr, &sinfo); +/* free the TID stats immediately */ +cfg80211_sinfo_release_content (&sinfo); +dev_put (real_netdev);if (ret == -ENOENT ) {/* Node is not associated anymore! It would be
Signature · 1 line
2.11.0
Huh, sorry about that.
Quoted 1 line
From: Felix Fietkau <[email protected]>
If Felix had nothing to do with the patch, why would you pretend otherwise?
You need two patches - one for backports, this part:
Quoted 1 line
compat-include/net/cfg80211.h | 7 +++++++
And for mainline, this part:
Quoted 1 line
net/batman-adv/bat_v_elp.c | 3 +++
So send the two separate patches to the two separate projects, and that's it?
johannes
Signature · 7 lines
Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928
Sven Eckelmann
maintainerQuoted 5 lines · Johannes
Huh, sorry about that.
Quoted 1 line
From: Felix Fietkau <[email protected]>
If Felix had nothing to do with the patch, why would you pretend otherwise?
This is what he has dropped and Martin Weinelt forwarded to us:
http://nbd.name/batman-adv-memleak.patch
So just the net/batman-adv/bat_v_elp.c part without anything else.
Quoted 3 lines
You need two patches - one for backports, this part:
Quoted 1 line
compat-include/net/cfg80211.h | 7 +++++++
This is not for backports [0] - this is for batman-adv.git [1]
Quoted 5 lines
And for mainline, this part:
Quoted 1 line
net/batman-adv/bat_v_elp.c | 3 +++So send the two separate patches to the two separate projects, and that's it?
The upstream patch (for David) is just stripped from the compat-include part.
Kind regards,
Sven
[0] https://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git/
[1] https://git.open-mesh.org/batman-adv.git
[2] https://git.open-mesh.org/linux-merge.git/commit/7d652669b61d702c6e62a39579d17f6881670ab6