315-mac80211-check-and-refresh-aggregation-session-in-en.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From: Felix Fietkau <[email protected]>
  2. Date: Mon, 17 Aug 2020 21:11:25 +0200
  3. Subject: [PATCH] mac80211: check and refresh aggregation session in
  4. encap offload tx
  5. Update the last_tx timestamp to avoid tearing down the aggregation session
  6. early. Fall back to the slow path if the session setup is still running
  7. Signed-off-by: Felix Fietkau <[email protected]>
  8. ---
  9. --- a/net/mac80211/tx.c
  10. +++ b/net/mac80211/tx.c
  11. @@ -4186,6 +4186,8 @@ static void ieee80211_8023_xmit(struct i
  12. bool authorized = false;
  13. bool multicast;
  14. unsigned char *ra = ehdr->h_dest;
  15. + struct tid_ampdu_tx *tid_tx;
  16. + u8 tid;
  17. if (IS_ERR(sta) || (sta && !sta->uploaded))
  18. sta = NULL;
  19. @@ -4223,6 +4225,22 @@ static void ieee80211_8023_xmit(struct i
  20. memset(info, 0, sizeof(*info));
  21. + if (sta) {
  22. + tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
  23. + tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
  24. + if (tid_tx) {
  25. + if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) {
  26. + /* fall back to non-offload slow path */
  27. + __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL);
  28. + return;
  29. + }
  30. +
  31. + info->flags |= IEEE80211_TX_CTL_AMPDU;
  32. + if (tid_tx->timeout)
  33. + tid_tx->last_tx = jiffies;
  34. + }
  35. + }
  36. +
  37. if (unlikely(!multicast && skb->sk &&
  38. skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS))
  39. info->ack_frame_id = ieee80211_store_ack_skb(local, skb,