305-mac80211-fix-tx-status-for-no-ack-cases.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From: Markus Theil <markus.theil@tu-ilmenau.de>
  2. Date: Wed, 18 Dec 2019 15:27:36 +0100
  3. Subject: [PATCH] mac80211: fix tx status for no ack cases
  4. Before this patch, frames which where successfully transmitted without
  5. requiring acks where accounted as lost frames.
  6. Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
  7. Link: https://lore.kernel.org/r/20191218142736.15843-1-markus.theil@tu-ilmenau.de
  8. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  9. ---
  10. --- a/net/mac80211/status.c
  11. +++ b/net/mac80211/status.c
  12. @@ -719,6 +719,7 @@ static void __ieee80211_tx_status(struct
  13. int rates_idx;
  14. bool send_to_cooked;
  15. bool acked;
  16. + bool noack_success;
  17. struct ieee80211_bar *bar;
  18. int shift = 0;
  19. int tid = IEEE80211_NUM_TIDS;
  20. @@ -736,6 +737,8 @@ static void __ieee80211_tx_status(struct
  21. clear_sta_flag(sta, WLAN_STA_SP);
  22. acked = !!(info->flags & IEEE80211_TX_STAT_ACK);
  23. + noack_success = !!(info->flags &
  24. + IEEE80211_TX_STAT_NOACK_TRANSMITTED);
  25. /* mesh Peer Service Period support */
  26. if (ieee80211_vif_is_mesh(&sta->sdata->vif) &&
  27. @@ -800,12 +803,12 @@ static void __ieee80211_tx_status(struct
  28. ieee80211_handle_filtered_frame(local, sta, skb);
  29. return;
  30. } else {
  31. - if (!acked)
  32. + if (!acked && !noack_success)
  33. sta->status_stats.retry_failed++;
  34. sta->status_stats.retry_count += retry_count;
  35. if (ieee80211_is_data_present(fc)) {
  36. - if (!acked)
  37. + if (!acked && !noack_success)
  38. sta->status_stats.msdu_failed[tid]++;
  39. sta->status_stats.msdu_retries[tid] +=
  40. @@ -826,7 +829,7 @@ static void __ieee80211_tx_status(struct
  41. acked, info->status.tx_time);
  42. if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
  43. - if (info->flags & IEEE80211_TX_STAT_ACK) {
  44. + if (acked) {
  45. if (sta->status_stats.lost_packets)
  46. sta->status_stats.lost_packets = 0;
  47. @@ -834,6 +837,8 @@ static void __ieee80211_tx_status(struct
  48. if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH))
  49. sta->status_stats.last_tdls_pkt_time =
  50. jiffies;
  51. + } else if (noack_success) {
  52. + /* nothing to do here, do not account as lost */
  53. } else {
  54. ieee80211_lost_packet(sta, info);
  55. }
  56. @@ -959,7 +964,7 @@ void ieee80211_tx_status_ext(struct ieee
  57. sta = container_of(pubsta, struct sta_info, sta);
  58. - if (!acked)
  59. + if (!acked && !noack_success)
  60. sta->status_stats.retry_failed++;
  61. sta->status_stats.retry_count += retry_count;
  62. @@ -974,6 +979,8 @@ void ieee80211_tx_status_ext(struct ieee
  63. sta->status_stats.last_tdls_pkt_time = jiffies;
  64. } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) {
  65. return;
  66. + } else if (noack_success) {
  67. + /* nothing to do here, do not account as lost */
  68. } else {
  69. ieee80211_lost_packet(sta, info);
  70. }