From 053e76cc46f97ce0f2c8aba21e45c475fd40d9d7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 6 Jun 2019 09:22:15 +0200 Subject: [PATCH] mt76: mt76x02: fix tx reordering on rate control probing without a-mpdu To avoid aggregating rate control probing packets with other traffic, and to ensure that the probing rate gets used, probing packets get assigned a different internal queueing priority. This causes packets to be transmitted in a different order, which is compensated by the receiver side reordering. However, if A-MPDU is disabled, this reordering can become visible to upper layers on the receiver side. Disable the priority change if A-MPDU is disabled. Signed-off-by: Felix Fietkau --- mt76x02_txrx.c | 3 ++- mt76x02_usb_core.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mt76x02_txrx.c b/mt76x02_txrx.c index a842e0aa..391fcd9c 100644 --- a/mt76x02_txrx.c +++ b/mt76x02_txrx.c @@ -153,6 +153,7 @@ int mt76x02_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, { struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); struct mt76x02_txwi *txwi = txwi_ptr; + bool ampdu = IEEE80211_SKB_CB(skb)->flags & IEEE80211_TX_CTL_AMPDU; int qsel = MT_QSEL_EDCA; int pid; int ret; @@ -174,7 +175,7 @@ int mt76x02_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, if (ret < 0) return ret; - if (mt76_is_skb_pktid(pid)) + if (mt76_is_skb_pktid(pid) && ampdu) qsel = MT_QSEL_MGMT; *tx_info = FIELD_PREP(MT_TXD_INFO_QSEL, qsel) | diff --git a/mt76x02_usb_core.c b/mt76x02_usb_core.c index b5deecd1..cf0f2e44 100644 --- a/mt76x02_usb_core.c +++ b/mt76x02_usb_core.c @@ -77,6 +77,7 @@ int mt76x02u_tx_prepare_skb(struct mt76_dev *mdev, void *data, u32 *tx_info) { struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); + bool ampdu = IEEE80211_SKB_CB(skb)->flags & IEEE80211_TX_CTL_AMPDU; struct mt76x02_txwi *txwi; enum mt76_qsel qsel; int len = skb->len; @@ -97,7 +98,8 @@ int mt76x02u_tx_prepare_skb(struct mt76_dev *mdev, void *data, txwi->pktid = pid; - if (mt76_is_skb_pktid(pid) || q2ep(q->hw_idx) == MT_EP_OUT_HCCA) + if ((mt76_is_skb_pktid(pid) && ampdu) || + q2ep(q->hw_idx) == MT_EP_OUT_HCCA) qsel = MT_QSEL_MGMT; else qsel = MT_QSEL_EDCA;