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
5 Before this patch, frames which where successfully transmitted without
6 requiring acks where accounted as lost frames.
8 Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
9 Link: https://lore.kernel.org/r/20191218142736.15843-1-markus.theil@tu-ilmenau.de
10 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 --- a/net/mac80211/status.c
14 +++ b/net/mac80211/status.c
15 @@ -881,6 +881,7 @@ static void __ieee80211_tx_status(struct
20 struct ieee80211_bar *bar;
22 int tid = IEEE80211_NUM_TIDS;
23 @@ -898,6 +899,8 @@ static void __ieee80211_tx_status(struct
24 clear_sta_flag(sta, WLAN_STA_SP);
26 acked = !!(info->flags & IEEE80211_TX_STAT_ACK);
27 + noack_success = !!(info->flags &
28 + IEEE80211_TX_STAT_NOACK_TRANSMITTED);
30 /* mesh Peer Service Period support */
31 if (ieee80211_vif_is_mesh(&sta->sdata->vif) &&
32 @@ -962,12 +965,12 @@ static void __ieee80211_tx_status(struct
33 ieee80211_handle_filtered_frame(local, sta, skb);
37 + if (!acked && !noack_success)
38 sta->status_stats.retry_failed++;
39 sta->status_stats.retry_count += retry_count;
41 if (ieee80211_is_data_present(fc)) {
43 + if (!acked && !noack_success)
44 sta->status_stats.msdu_failed[tid]++;
46 sta->status_stats.msdu_retries[tid] +=
47 @@ -994,7 +997,7 @@ static void __ieee80211_tx_status(struct
48 info->status.tx_time, 0);
50 if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
51 - if (info->flags & IEEE80211_TX_STAT_ACK) {
53 if (sta->status_stats.lost_packets)
54 sta->status_stats.lost_packets = 0;
56 @@ -1002,6 +1005,8 @@ static void __ieee80211_tx_status(struct
57 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH))
58 sta->status_stats.last_tdls_pkt_time =
60 + } else if (noack_success) {
61 + /* nothing to do here, do not account as lost */
63 ieee80211_lost_packet(sta, info);
65 @@ -1127,7 +1132,7 @@ void ieee80211_tx_status_ext(struct ieee
67 sta = container_of(pubsta, struct sta_info, sta);
70 + if (!acked && !noack_success)
71 sta->status_stats.retry_failed++;
72 sta->status_stats.retry_count += retry_count;
74 @@ -1142,6 +1147,8 @@ void ieee80211_tx_status_ext(struct ieee
75 sta->status_stats.last_tdls_pkt_time = jiffies;
76 } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) {
78 + } else if (noack_success) {
79 + /* nothing to do here, do not account as lost */
81 ieee80211_lost_packet(sta, info);