Skip to contentSkip to conversation

mac80211: when using iTXQ, select the queue in ieee80211_subif_start_xmit

PATCH New Felix Fietkau 1 participant 1 message Mar 25, 2019 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: when using iTXQ, select the queue in ieee80211_subif_start_xmit

When using iTXQ, the network stack does not need the real queue number, since mac80211 is using its internal queues anyway. In that case we can defer selecting the queue and remove a redundant station lookup in the tx path to save some CPU cycles.

---
 net/mac80211/tx.c  | 11 ++++++-
 net/mac80211/wme.c | 82 +++++++++++++++++++++++++---------------------
 net/mac80211/wme.h |  2 ++
 3 files changed, 56 insertions(+), 39 deletions(-)
net/mac80211/tx.c +10 -1
index e22de40a7790..e9d4a811ddce 100644
@@ -3790,6 +3790,7 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
 				  u32 info_flags)
 {
 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	struct ieee80211_local *local = sdata->local;
 	struct sta_info *sta;
 	struct sk_buff *next;
 
@@ -3803,7 +3804,15 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
 	if (ieee80211_lookup_ra_sta(sdata, skb, &sta))
 		goto out_free;
 
-	if (!IS_ERR_OR_NULL(sta)) {
+	if (IS_ERR(sta))
+		sta = NULL;
+
+	if (local->ops->wake_tx_queue) {
+		u16 queue = __ieee80211_select_queue(sdata, sta, skb);
+		skb_set_queue_mapping(skb, queue);
+	}
+
+	if (sta) {
 		struct ieee80211_fast_tx *fast_tx;
 
 		sk_pacing_shift_update(skb->sk, sdata->local->hw.tx_sk_pacing_shift);
net/mac80211/wme.c +44 -38

126 lines not on this page · raw message

net/mac80211/wme.h +2 -0
index 80151edc5195..b1b1439cb91b 100644
@@ -16,6 +16,8 @@
 u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
 				 struct sk_buff *skb,
 				 struct ieee80211_hdr *hdr);
+u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
+			     struct sta_info *sta, struct sk_buff *skb);
 u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
 			   struct sk_buff *skb);
 void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
Signature · 1 line
2.17.0