From patchwork Fri Jan 25 08:02:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17751 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id D784C8163C; Fri, 25 Jan 2019 09:03:10 +0100 (CET) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="0j3ZDUGb"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 50FEB8064A for ; Fri, 25 Jan 2019 09:03:09 +0100 (CET) Received: from sven-desktop.home.narfation.org (unknown [92.117.111.44]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 848C91100D8; Fri, 25 Jan 2019 09:03:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1548403388; bh=M2h6KZVKsXv2YMpzSiNCxtcqb8hwQ+GFSjUWgVBMR+w=; h=From:To:Cc:Subject:Date:From; b=0j3ZDUGbaKVivUlaJwHa7nMZkwiizvxmHoCIoqLNbIY9UY2z4/QsOlgOx8kqq2YIR iiasa2n61X/HqRqqLVATfaNK2rHucUaPnC2X65R2RiO2kpnbxae+fLu/Vg01UZUZM5 0LxIwuBkC4Nw/nbvm3/VwfMWADuBYu8Bgis8mcSQ= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 25 Jan 2019 09:02:05 +0100 Message-Id: <20190125080205.10594-1-sven@narfation.org> X-Mailer: git-send-email 2.11.0 Subject: [B.A.T.M.A.N.] [PATCH maint] batman-adv: release station info tidstats X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Cc: Arend van Spriel , Johannes Berg , Felix Fietkau Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" From: Felix Fietkau 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 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 --- Cc: Johannes Berg Cc: Arend van Spriel 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