Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp90942pxa; Fri, 21 Aug 2020 01:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+OTOPprWkhbnR48DWkxjeK5cbIWWPGvk7vEcZHvSdanTlLMeBNEfF5T2pl2l4+Mx/uB2z X-Received: by 2002:a05:6402:896:: with SMTP id e22mr1874922edy.210.1598000122232; Fri, 21 Aug 2020 01:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598000122; cv=none; d=google.com; s=arc-20160816; b=h0zHR7LBWWH+SfNnSfcqsXpTkVG/An8symUgakk2tJVWWXV7o5eTm1Rfhb0arnm1hc fkOE3e3AF4dTdtLmqQr90j8p2gdTtqH/vLo1aYLc/EYrQkMO/7Tyf5lRcd5/f1ZYch4R edPI9hLR4peIWIq7iBXuHaVn4a9E6gR6pDXe0KSqInJ8VbTLFQtIP5+6xzVtGL5Uvsx5 0dlxdayczS16y4Z0V2mr0dtEidRqtUeigYWWx1/Px6dOsbo42JQA8WczX/fc9RbJL1o8 9Ykb2DpB2dN6dWZYXWsh5F6Aageazis3cFW+P7REthUAWnClk4EeEzHMeOBVL8rHpPhV 2haQ== 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=tN4J3A28OqXx8tQlzfx7F02IaKOi3v/Nv2YrXhB/lYc=; b=yPehuBLW0bf5fhJmQKJlZ1eNdB5iq4QBMTMWyIhzoDjrBoRbAaZsiBbl9xREtWGmkZ aQHIV2nEERi2H+wsS6WJxY+7ogWxukcuBuN3kv2wxZDb08HWWV8d3QSRSXlqMKr6a6Qw UqvoTRxFVGGEd2ly/JV1sZP/Oqp2UFrMNVKCjg2Cr98L4Un23LjrcrgXQ8ppaErfqbRi sSRiiJwZctGk03wrPjxcAXeWtEOrR5B6UF2KEW5uS5koMo+n1YL4gWZtDo+MBA59LA1v soXEQ050ZciJIi89J1Z0+Qzd/E2b7P5CQ16ZUnCX6reJpfyLeFNxTtJH5d4AW0wxQkgG VS8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=G23hgFmr; 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 e15si771869ejd.255.2020.08.21.01.54.57; Fri, 21 Aug 2020 01:55:22 -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=G23hgFmr; 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 S1728056AbgHUIyz (ORCPT + 99 others); Fri, 21 Aug 2020 04:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbgHUIyz (ORCPT ); Fri, 21 Aug 2020 04:54:55 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01A5BC061385 for ; Fri, 21 Aug 2020 01:54:54 -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=tN4J3A28OqXx8tQlzfx7F02IaKOi3v/Nv2YrXhB/lYc=; b=G23hgFmrjADUYyX9+y2WOxIR57 d62Py+MK9aBdatPJdyHZoX/rD1GLrKfgdz1MACQLZ841896OXA6/nn70gi7uDV63SM5M2n4my6jeU wx9ds4RmjkjHHlomAzSVGV0jvF1/2p8F0V1nEyqCW5HvatEXxehdL2gEZm+X1Hh+Bwak=; 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 1k92jq-0005lO-VL; Fri, 21 Aug 2020 10:49:31 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v3 10/13] mac80211: extend ieee80211_tx_status_ext to support bulk free Date: Fri, 21 Aug 2020 10:49:23 +0200 Message-Id: <20200821084926.10650-11-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200821084926.10650-1-nbd@nbd.name> References: <20200821084926.10650-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 a3543c3dbd3d..a0dd926dceb3 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; } @@ -1169,7 +1172,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