Ticket #1039: 0001-trivial-FF-accounting-fix.txt

File 0001-trivial-FF-accounting-fix.txt, 1.3 kB (added by Žilvinas Valinskas, 5 years ago)

trivial patch

Line 
1 [PATCH] [PATCH] trivial FF accounting fix
2
3 In case FastFrames (FF) are enabled, 80211stats reports incorrect 'tx_data'
4 and 'tx_bytes' counters. Statistics are incremented only once, for a first
5 chained skb only.  So if FF enabled one should increment  statistics
6 accordingly for a second (if any) chained skb too.
7
8 Without this fix, during duplex tests it is clearly seen that 'rx_data' and
9 'rx_bytes' are about 2x larger then 'tx_data/tx_bytes' counters when these
10 counters should be about the same.
11
12 Signed-off-by: Åœilvinas Valinskas <zilvinas@wilibox.com>
13 ---
14  net80211/ieee80211_output.c |    9 +++++++++
15  1 files changed, 9 insertions(+), 0 deletions(-)
16
17 diff --git a/net80211/ieee80211_output.c b/net80211/ieee80211_output.c
18 index 33177ad..623358b 100644
19 --- a/net80211/ieee80211_output.c
20 +++ b/net80211/ieee80211_output.c
21 @@ -1190,6 +1190,15 @@ ieee80211_encap(struct ieee80211_node *ni, struct sk_buff *skb, int *framecnt)
22         } else {
23                 IEEE80211_NODE_STAT(ni, tx_data);
24                 IEEE80211_NODE_STAT_ADD(ni, tx_bytes, datalen);
25 +
26 +#ifdef ATH_SUPERG_FF
27 +               /* Account for a second skb in the same packet when FF is on */
28 +               if (skb->next) {
29 +                       datalen = skb->next->len;       
30 +                       IEEE80211_NODE_STAT(ni, tx_data);
31 +                       IEEE80211_NODE_STAT_ADD(ni, tx_bytes, datalen);
32 +               }
33 +#endif
34         }
35  
36         return skb;
37 --
38 1.4.4.2.gde51
39