Skip to contentSkip to conversation

mt76: fix rx amsdu subframe processing

PATCH Superseded Felix Fietkau 2 participants 2 messages Apr 6, 2021 – Apr 7, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Felix Fietkau

author maintainer
#0 lore raw

PATCH 1/1 mt76: fix rx amsdu subframe processing

When receiving an A-MSDU containing only a single subframe, status->last_amsdu is set, but no previous head is present in the rx A-MSDU queue. In this case, the A-MSDU subframe will be held until the next one is received, potentially causing significant extra latency.
Fix this by releasing the frame instead of creating a new queue head if last_amsdu is set.

Fixes c7fd4a5d3f75 ("mt76: mt7915: enable hw rx-amsdu de-aggregation")
---
 drivers/net/wireless/mediatek/mt76/mac80211.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mac80211.c +5 -2
index 7684a8cf00fb..0d92b658b6a6 100644
@@ -517,10 +517,14 @@ static void mt76_rx_release_burst(struct mt76_phy *phy, enum mt76_rxq_id q,
 
 	/* first amsdu subframe */
 	if (status->amsdu && !phy->rx_amsdu[q].head) {
+		if (status->last_amsdu) {
+			nskb = skb;
+			goto reset_burst;
+		}
 		phy->rx_amsdu[q].tail = &skb_shinfo(skb)->frag_list;
 		phy->rx_amsdu[q].seqno = status->seqno;
 		phy->rx_amsdu[q].head = skb;
-		goto enqueue;
+		return;
 	}
 
 	/* ampdu or out-of-order amsdu subframes */
@@ -543,7 +547,6 @@ static void mt76_rx_release_burst(struct mt76_phy *phy, enum mt76_rxq_id q,
 reset_burst:
 	phy->rx_amsdu[q].head = NULL;
 	phy->rx_amsdu[q].tail = NULL;
-enqueue:
 	if (nskb)
 		__skb_queue_tail(&dev->rx_skb[q], nskb);
 }
Signature · 1 line
2.30.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines

When receiving an A-MSDU containing only a single subframe, status->last_amsdu is set, but no previous head is present in the rx A-MSDU queue. In this case, the A-MSDU subframe will be held until the next one is received, potentially causing significant extra latency.
Fix this by releasing the frame instead of creating a new queue head if last_amsdu is set.

Quoted 38 lines
Fixes c7fd4a5d3f75 ("mt76: mt7915: enable hw rx-amsdu de-aggregation")
---
 drivers/net/wireless/mediatek/mt76/mac80211.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mac80211.c +5 -2
index 7684a8cf00fb..0d92b658b6a6 100644
@@ -517,10 +517,14 @@ static void mt76_rx_release_burst(struct mt76_phy *phy, enum mt76_rxq_id q,
 
 	/* first amsdu subframe */
 	if (status->amsdu && !phy->rx_amsdu[q].head) {
+		if (status->last_amsdu) {
+			nskb = skb;
+			goto reset_burst;
+		}
 		phy->rx_amsdu[q].tail = &skb_shinfo(skb)->frag_list;
 		phy->rx_amsdu[q].seqno = status->seqno;
 		phy->rx_amsdu[q].head = skb;
-		goto enqueue;
+		return;
 	}
 
 	/* ampdu or out-of-order amsdu subframes */
@@ -543,7 +547,6 @@ static void mt76_rx_release_burst(struct mt76_phy *phy, enum mt76_rxq_id q,
 reset_burst:
 	phy->rx_amsdu[q].head = NULL;
 	phy->rx_amsdu[q].tail = NULL;
-enqueue:
 	if (nskb)
 		__skb_queue_tail(&dev->rx_skb[q], nskb);
 }
Signature · 1 line
2.30.1