b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Felix Fietkau <nbd@nbd.name>, Sven Eckelmann <sven@narfation.org>,
	Johannes Berg <johannes.berg@intel.com>,
	Arend van Spriel <aspriel@gmail.com>
Subject: [B.A.T.M.A.N.] [PATCH maint] batman-adv: release station info tidstats
Date: Fri, 25 Jan 2019 09:02:05 +0100	[thread overview]
Message-ID: <20190125080205.10594-1-sven@narfation.org> (raw)

From: Felix Fietkau <nbd@nbd.name>

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.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Fixes: 8689c051a201 ("cfg80211: dynamically allocate per-tid stats for station info")
[sven@narfation.org: add commit message, add compat code]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
Cc: Johannes Berg <johannes.berg@intel.com>
Cc: Arend van Spriel <aspriel@gmail.com>

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(+)

diff --git a/compat-include/net/cfg80211.h b/compat-include/net/cfg80211.h
index 79c028af..6b6a0287 100644
--- a/compat-include/net/cfg80211.h
+++ b/compat-include/net/cfg80211.h
@@ -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_ */
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index e8090f09..ef0dec20 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -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
-- 
2.11.0


             reply	other threads:[~2019-01-25  8:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25  8:02 Sven Eckelmann [this message]
2019-01-25  8:16 ` [B.A.T.M.A.N.] [PATCH maint] batman-adv: release station info tidstats Berg, Johannes
2019-01-25  8:23   ` 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=20190125080205.10594-1-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=aspriel@gmail.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=johannes.berg@intel.com \
    --cc=nbd@nbd.name \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).