Skip to content

Commit 1a79155

Browse files
nbd168jmberg-intel
authored andcommitted
mac80211: fix starting aggregation sessions on mesh interfaces
The logic for starting aggregation sessions was recently moved from minstrel_ht to mac80211, into the subif tx handler just after the sta lookup. Unfortunately this didn't work for mesh interfaces, since the sta lookup is deferred until a much later point in time on those. Fix this by also calling the aggregation check right after the deferred sta lookup. Fixes: 08a46c6 ("mac80211: move A-MPDU session check from minstrel_ht to mac80211") Signed-off-by: Felix Fietkau <nbd@nbd.name> Link: https://lore.kernel.org/r/20210629112853.29785-1-nbd@nbd.name Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent ec61cd4 commit 1a79155

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

net/mac80211/tx.c

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,29 @@ static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx,
11471147
return queued;
11481148
}
11491149

1150+
static void
1151+
ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata,
1152+
struct sta_info *sta,
1153+
struct sk_buff *skb)
1154+
{
1155+
struct rate_control_ref *ref = sdata->local->rate_ctrl;
1156+
u16 tid;
1157+
1158+
if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER))
1159+
return;
1160+
1161+
if (!sta || !sta->sta.ht_cap.ht_supported ||
1162+
!sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO ||
1163+
skb->protocol == sdata->control_port_protocol)
1164+
return;
1165+
1166+
tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
1167+
if (likely(sta->ampdu_mlme.tid_tx[tid]))
1168+
return;
1169+
1170+
ieee80211_start_tx_ba_session(&sta->sta, tid, 0);
1171+
}
1172+
11501173
/*
11511174
* initialises @tx
11521175
* pass %NULL for the station if unknown, a valid pointer if known
@@ -1160,6 +1183,7 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
11601183
struct ieee80211_local *local = sdata->local;
11611184
struct ieee80211_hdr *hdr;
11621185
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1186+
bool aggr_check = false;
11631187
int tid;
11641188

11651189
memset(tx, 0, sizeof(*tx));
@@ -1188,8 +1212,10 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
11881212
} else if (tx->sdata->control_port_protocol == tx->skb->protocol) {
11891213
tx->sta = sta_info_get_bss(sdata, hdr->addr1);
11901214
}
1191-
if (!tx->sta && !is_multicast_ether_addr(hdr->addr1))
1215+
if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) {
11921216
tx->sta = sta_info_get(sdata, hdr->addr1);
1217+
aggr_check = true;
1218+
}
11931219
}
11941220

11951221
if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
@@ -1199,8 +1225,12 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
11991225
struct tid_ampdu_tx *tid_tx;
12001226

12011227
tid = ieee80211_get_tid(hdr);
1202-
12031228
tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]);
1229+
if (!tid_tx && aggr_check) {
1230+
ieee80211_aggr_check(sdata, tx->sta, skb);
1231+
tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]);
1232+
}
1233+
12041234
if (tid_tx) {
12051235
bool queued;
12061236

@@ -4120,29 +4150,6 @@ void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)
41204150
}
41214151
EXPORT_SYMBOL(ieee80211_txq_schedule_start);
41224152

4123-
static void
4124-
ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata,
4125-
struct sta_info *sta,
4126-
struct sk_buff *skb)
4127-
{
4128-
struct rate_control_ref *ref = sdata->local->rate_ctrl;
4129-
u16 tid;
4130-
4131-
if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER))
4132-
return;
4133-
4134-
if (!sta || !sta->sta.ht_cap.ht_supported ||
4135-
!sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO ||
4136-
skb->protocol == sdata->control_port_protocol)
4137-
return;
4138-
4139-
tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
4140-
if (likely(sta->ampdu_mlme.tid_tx[tid]))
4141-
return;
4142-
4143-
ieee80211_start_tx_ba_session(&sta->sta, tid, 0);
4144-
}
4145-
41464153
void __ieee80211_subif_start_xmit(struct sk_buff *skb,
41474154
struct net_device *dev,
41484155
u32 info_flags,

0 commit comments

Comments
 (0)