From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 8/8] mt76: mt7915: use napi_consume_skb to bulk-free tx skbs
Date: Sun, 27 Sep 2020 19:18:52 +0200 [thread overview]
Message-ID: <20200927171852.48669-8-nbd@nbd.name> (raw)
In-Reply-To: <20200927171852.48669-1-nbd@nbd.name>
Slightly improves performance
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
.../net/wireless/mediatek/mt76/mt7915/mac.c | 52 ++++++++-----------
1 file changed, 21 insertions(+), 31 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index 3456d9532f29..a7118df7b93f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -858,17 +858,19 @@ mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
ieee80211_start_tx_ba_session(sta, tid, 0);
}
-static inline void
-mt7915_tx_status(struct ieee80211_sta *sta, struct ieee80211_hw *hw,
- struct ieee80211_tx_info *info, struct sk_buff *skb)
+static void
+mt7915_tx_complete_status(struct mt76_dev *mdev, struct sk_buff *skb,
+ struct ieee80211_sta *sta, u8 stat,
+ struct list_head *free_list)
{
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_tx_status status = {
.sta = sta,
.info = info,
+ .skb = skb,
+ .free_list = free_list,
};
-
- if (skb)
- status.skb = skb;
+ struct ieee80211_hw *hw;
if (sta) {
struct mt7915_sta *msta;
@@ -877,17 +879,6 @@ mt7915_tx_status(struct ieee80211_sta *sta, struct ieee80211_hw *hw,
status.rate = &msta->stats.tx_rate;
}
- /* use status_ext to report HE rate */
- ieee80211_tx_status_ext(hw, &status);
-}
-
-static void
-mt7915_tx_complete_status(struct mt76_dev *mdev, struct sk_buff *skb,
- struct ieee80211_sta *sta, u8 stat)
-{
- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
- struct ieee80211_hw *hw;
-
hw = mt76_tx_status_get_hw(mdev, skb);
if (info->flags & IEEE80211_TX_CTL_AMPDU)
@@ -900,17 +891,7 @@ mt7915_tx_complete_status(struct mt76_dev *mdev, struct sk_buff *skb,
info->flags |= IEEE80211_TX_STAT_ACK;
info->status.tx_time = 0;
-
- if (info->flags & (IEEE80211_TX_CTL_REQ_TX_STATUS |
- IEEE80211_TX_CTL_HW_80211_ENCAP)) {
- mt7915_tx_status(sta, hw, info, skb);
- return;
- }
-
- if (sta || !(info->flags & IEEE80211_TX_CTL_NO_ACK))
- mt7915_tx_status(sta, hw, info, NULL);
-
- ieee80211_free_txskb(hw, skb);
+ ieee80211_tx_status_ext(hw, &status);
}
void mt7915_txp_skb_unmap(struct mt76_dev *dev,
@@ -931,6 +912,8 @@ void mt7915_mac_tx_free(struct mt7915_dev *dev, struct sk_buff *skb)
struct mt76_dev *mdev = &dev->mt76;
struct mt76_txwi_cache *txwi;
struct ieee80211_sta *sta = NULL;
+ LIST_HEAD(free_list);
+ struct sk_buff *tmp;
u8 i, count;
/* clean DMA queues and unmap buffers first */
@@ -1002,16 +985,22 @@ void mt7915_mac_tx_free(struct mt7915_dev *dev, struct sk_buff *skb)
atomic_cmpxchg(&wcid->non_aql_packets, pending, 0);
}
- mt7915_tx_complete_status(mdev, txwi->skb, sta, stat);
+ mt7915_tx_complete_status(mdev, txwi->skb, sta, stat, &free_list);
txwi->skb = NULL;
}
mt76_put_txwi(mdev, txwi);
}
- dev_kfree_skb(skb);
mt7915_mac_sta_poll(dev);
mt76_worker_schedule(&dev->mt76.tx_worker);
+
+ napi_consume_skb(skb, 1);
+
+ list_for_each_entry_safe(skb, tmp, &free_list, list) {
+ skb_list_del_init(skb);
+ napi_consume_skb(skb, 1);
+ }
}
void mt7915_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue_entry *e)
@@ -1044,7 +1033,8 @@ void mt7915_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue_entry *e)
wcid = rcu_dereference(dev->mt76.wcid[cb->wcid]);
- mt7915_tx_complete_status(mdev, e->skb, wcid_to_sta(wcid), 0);
+ mt7915_tx_complete_status(mdev, e->skb, wcid_to_sta(wcid), 0,
+ NULL);
}
}
--
2.28.0
prev parent reply other threads:[~2020-09-27 17:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-27 17:18 [PATCH 1/8] mt76: mt7915: add 802.11 encap offload support Felix Fietkau
2020-09-27 17:18 ` [PATCH 2/8] mt76: mt7915: add encap offload for 4-address mode stations Felix Fietkau
2020-09-27 17:18 ` [PATCH 3/8] mt76: use ieee80211_rx_list to pass frames to the network stack as a batch Felix Fietkau
2020-09-27 17:18 ` [PATCH 4/8] mt76: mt7615: add debugfs knob for setting extended local mac addresses Felix Fietkau
2020-09-27 17:18 ` [PATCH 5/8] mt76: do not set NEEDS_UNIQUE_STA_ADDR for 7615 and 7915 Felix Fietkau
2020-09-27 17:18 ` [PATCH 6/8] mt76: mt7915: support 32 station interfaces Felix Fietkau
2020-09-27 17:18 ` [PATCH 7/8] mt76: mt7915: fix processing txfree events Felix Fietkau
2020-09-27 17:18 ` Felix Fietkau [this message]
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=20200927171852.48669-8-nbd@nbd.name \
--to=nbd@nbd.name \
--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