OSDN Git Service

wil6210: detailed statistics for Rx reorder drop
authorVladimir Kondratiev <QCA_vkondrat@QCA.qualcomm.com>
Thu, 30 Jul 2015 10:52:01 +0000 (13:52 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 6 Aug 2015 06:43:30 +0000 (09:43 +0300)
Rx drops may be for 2 reasons: frame is old,
or it is duplicate. On the debugfs "stations" entry,
provide counters per reorder buffer for total
frames processed, drops for these 2 reasons.
Also add debug print for dropped frames.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/debugfs.c
drivers/net/wireless/ath/wil6210/rx_reorder.c
drivers/net/wireless/ath/wil6210/wil6210.h

index 2651ec4..05b550f 100644 (file)
@@ -1344,6 +1344,7 @@ static void wil_print_rxtid(struct seq_file *s, struct wil_tid_ampdu_rx *r)
 {
        int i;
        u16 index = ((r->head_seq_num - r->ssn) & 0xfff) % r->buf_size;
+       unsigned long long drop_dup = r->drop_dup, drop_old = r->drop_old;
 
        seq_printf(s, "([%2d] %3d TU) 0x%03x [", r->buf_size, r->timeout,
                   r->head_seq_num);
@@ -1353,7 +1354,10 @@ static void wil_print_rxtid(struct seq_file *s, struct wil_tid_ampdu_rx *r)
                else
                        seq_printf(s, "%c", r->reorder_buf[i] ? '*' : '_');
        }
-       seq_printf(s, "] drop %llu last 0x%03x\n", r->drop, r->ssn_last_drop);
+       seq_printf(s,
+                  "] total %llu drop %llu (dup %llu + old %llu) last 0x%03x\n",
+                  r->total, drop_dup + drop_old, drop_dup, drop_old,
+                  r->ssn_last_drop);
 }
 
 static int wil_sta_debugfs_show(struct seq_file *s, void *data)
index e4ac11c..9238c1a 100644 (file)
@@ -121,6 +121,7 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
                goto out;
        }
 
+       r->total++;
        hseq = r->head_seq_num;
 
        /** Due to the race between WMI events, where BACK establishment
@@ -153,7 +154,9 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
        /* frame with out of date sequence number */
        if (seq_less(seq, r->head_seq_num)) {
                r->ssn_last_drop = seq;
-               r->drop++;
+               r->drop_old++;
+               wil_dbg_txrx(wil, "Rx drop: old seq 0x%03x head 0x%03x\n",
+                            seq, r->head_seq_num);
                dev_kfree_skb(skb);
                goto out;
        }
@@ -174,7 +177,8 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
 
        /* check if we already stored this frame */
        if (r->reorder_buf[index]) {
-               r->drop++;
+               r->drop_dup++;
+               wil_dbg_txrx(wil, "Rx drop: dup seq 0x%03x\n", seq);
                dev_kfree_skb(skb);
                goto out;
        }
index 54f1673..c722724 100644 (file)
@@ -424,13 +424,12 @@ struct pci_dev;
  * @ssn: Starting Sequence Number expected to be aggregated.
  * @buf_size: buffer size for incoming A-MPDUs
  * @timeout: reset timer value (in TUs).
+ * @ssn_last_drop: SSN of the last dropped frame
+ * @total: total number of processed incoming frames
+ * @drop_dup: duplicate frames dropped for this reorder buffer
+ * @drop_old: old frames dropped for this reorder buffer
  * @dialog_token: dialog token for aggregation session
- * @rcu_head: RCU head used for freeing this struct
- * @drop: total frames dropped for this reorder buffer
- *
- * This structure's lifetime is managed by RCU, assignments to
- * the array holding it must hold the aggregation mutex.
- *
+ * @first_time: true when this buffer used 1-st time
  */
 struct wil_tid_ampdu_rx {
        struct sk_buff **reorder_buf;
@@ -444,7 +443,9 @@ struct wil_tid_ampdu_rx {
        u16 buf_size;
        u16 timeout;
        u16 ssn_last_drop;
-       unsigned long long drop;
+       unsigned long long total; /* frames processed */
+       unsigned long long drop_dup;
+       unsigned long long drop_old;
        u8 dialog_token;
        bool first_time; /* is it 1-st time this buffer used? */
 };