public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
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	[thread overview]
Message-ID: <20200821042001.23388-11-nbd@nbd.name> (raw)
In-Reply-To: <20200821042001.23388-1-nbd@nbd.name>

Store processed skbs ready to be freed in a list so the driver bulk free them

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 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


  parent reply	other threads:[~2020-08-21  4:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21  4:19 [PATCH v2 00/13] mac80211 encapsulation offload / performance patches Felix Fietkau
2020-08-21  4:19 ` [PATCH v2 01/13] mac80211: rework tx encapsulation offload API Felix Fietkau
2020-08-21  4:19 ` [PATCH v2 02/13] mac80211: reduce duplication in tx status functions Felix Fietkau
2020-08-21  4:19 ` [PATCH v2 03/13] mac80211: remove tx status call to ieee80211_sta_register_airtime Felix Fietkau
2020-08-21  4:19 ` [PATCH v2 04/13] mac80211: optimize station connection monitor Felix Fietkau
2020-08-21  4:19 ` [PATCH v2 05/13] mac80211: swap NEED_TXPROCESSING and HW_80211_ENCAP tx flags Felix Fietkau
2020-08-21  4:19 ` [PATCH v2 06/13] mac80211: unify 802.3 (offload) and 802.11 tx status codepath Felix Fietkau
2020-08-21  4:19 ` [PATCH v2 07/13] mac80211: add missing queue/hash initialization to 802.3 xmit Felix Fietkau
2020-08-21  4:19 ` [PATCH v2 08/13] mac80211: check and refresh aggregation session in encap offload tx Felix Fietkau
2020-08-21  4:19 ` [PATCH v2 09/13] mac80211: support using ieee80211_tx_status_ext to free skbs without status info Felix Fietkau
2020-08-21  6:40   ` Felix Fietkau
2020-08-21  4:19 ` Felix Fietkau [this message]
2020-08-21  4:19 ` [PATCH v2 11/13] mac80211: notify the driver when a sta uses 4-address mode Felix Fietkau
2020-08-21  4:20 ` [PATCH v2 12/13] mac80211: skip encap offload for tx multicast/control packets Felix Fietkau
2020-08-21  4:20 ` [PATCH v2 13/13] mac80211: set info->control.hw_key for encap offload packets Felix Fietkau

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=20200821042001.23388-11-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /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