Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1761904pxa; Thu, 20 Aug 2020 21:25:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlQJ8ZkIkWYJZD5zcB2MAYn9QglJOHmUpVI09to6wZimjpQYXyiWbx5MBGRmz7sMChuJgP X-Received: by 2002:a17:906:fcdb:: with SMTP id qx27mr949256ejb.421.1597983933493; Thu, 20 Aug 2020 21:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597983933; cv=none; d=google.com; s=arc-20160816; b=ysO0QGjQwiJe45/L2ui87b2yb3oE5f7eKq5qonPJfXAMVTw4zqmpCqo3VRUYT6Ga5x R8MKQb6BriXZFqJ+KFlU9wgc/ZYFGEn1cqgiymqam0xIMEutTL9L0J+mWH26cUxzINlP EIS3StSWbyvJAP2x91kqvKJ21po4HlcL9fZK92y5Tp9kZp4wi5LAZwR41uYKjGP6LfJ+ SyvtL45J0buWO0foQMDlUoDOpEY8KiqrdHgD/w7gfjin1ydAr4kFd4h4HmNOPbHX/7ZK RlWhmGj0MlbB7IVlTsIRPr2RxkN7b/YGxRcH57DnJaFJQ1d1Zf6FcGyqvB71SZekAOlo OTgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gNTrA+Wd7KQ4l/sPK4M7yb3QtTmeFD5TbtOyQVNQUqE=; b=079zRiGmBEQqu8wFAANQ/oSRnNZUayclt5gNXuRXg2k2dMy4QYZknfki/0jCv5fX1N odJQfLYeR7WFtMafweqRXSKEczhHjZacn1nvsxyUi4WhR2TGuOUZX1VGQZgpXHm7SwJj h7OCPVfj/ZoMmsNJjF2retfltrLoDbR0A8Xd/aGDLr0LFUzTmbFsibwmsHPGmKwP8ERh vjlybyLXST+A8bbAcLCMYAKA+n2p/16zkYIxG9U34Ey9LGOdPfaIETpOOq5KM5HQ4WF4 WIvG4Eq4ZYOWoPDFNqxCSA9uA0jOpcaG2j1w5HwpC0FCnfXuTtQrItQSuRwv8SVOW6GP VjNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=LOXjyAGe; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay7si476958edb.183.2020.08.20.21.25.09; Thu, 20 Aug 2020 21:25:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=LOXjyAGe; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725268AbgHUEY5 (ORCPT + 99 others); Fri, 21 Aug 2020 00:24:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725270AbgHUEY4 (ORCPT ); Fri, 21 Aug 2020 00:24:56 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F080C061385 for ; Thu, 20 Aug 2020 21:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=gNTrA+Wd7KQ4l/sPK4M7yb3QtTmeFD5TbtOyQVNQUqE=; b=LOXjyAGefy+ePL4LJNJ+i08Y/J lXSPdkz9PQMm0ntOX5GiDFS8ITrNy21GJVpS0qDIgQ7ceoEP4NBte2rsOMp4131fAEpkoAXOXWPOA h3JShZp9v0pNvDEoMo/0uuR/awOCvdjbdX+POQ3pF6/+6ORc1wrFUuIY5uVaE6P2V94c=; Received: from p5b206497.dip0.t-ipconnect.de ([91.32.100.151] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1k8yX7-0005s7-N2; Fri, 21 Aug 2020 06:20:05 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v2 10/13] mac80211: extend ieee80211_tx_status_ext to support bulk free Date: Fri, 21 Aug 2020 06:19:58 +0200 Message-Id: <20200821042001.23388-11-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200821042001.23388-1-nbd@nbd.name> References: <20200821042001.23388-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Store processed skbs ready to be freed in a list so the driver bulk free them Signed-off-by: Felix Fietkau --- include/net/mac80211.h | 2 ++ net/mac80211/status.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 0cd8dbe4e688..aaec7688e965 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1095,12 +1095,14 @@ ieee80211_info_get_tx_time_est(struct ieee80211_tx_info *info) * @info: Basic tx status information * @skb: Packet skb (can be NULL if not provided by the driver) * @rate: The TX rate that was used when sending the packet + * @free_list: list where processed skbs are stored to be free'd by the driver */ struct ieee80211_tx_status { struct ieee80211_sta *sta; struct ieee80211_tx_info *info; struct sk_buff *skb; struct rate_info *rate; + struct list_head *free_list; }; /** diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 261bdda2ec08..4cfd569a5f55 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -1044,7 +1044,10 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw, * with this test... */ if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) { - dev_kfree_skb(skb); + if (status->free_list) + list_add_tail(&skb->list, status->free_list); + else + dev_kfree_skb(skb); return; } @@ -1168,7 +1171,10 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw, return; ieee80211_report_used_skb(local, skb, false); - dev_kfree_skb(skb); + if (status->free_list) + list_add_tail(&skb->list, status->free_list); + else + dev_kfree_skb(skb); } EXPORT_SYMBOL(ieee80211_tx_status_ext); -- 2.28.0