2012-11-26 12:56:53

by Saravana

[permalink] [raw]
Subject: [RFC] mac80211: add debugfs file for mic failure


Add a debugfs file showing the number of failure of
rx packet dropped due to mic failures. currently the
number of rx packet dropped is counted in general and
not with respect to a specific reason. This patch
counts the number of packet drop due to mic failure.

Signed-off-by: Saravana <[email protected]>
---
The diff file is generated from wireless-testing git tree.
net/mac80211/debugfs_sta.c | 1 +
net/mac80211/sta_info.h | 3 +++
net/mac80211/wpa.c | 1 +
3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 89281d2..b1aea94 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -377,6 +377,7 @@ void ieee80211_sta_debugfs_add(struct sta_info
*sta)
DEBUGFS_ADD_COUNTER(rx_duplicates, num_duplicates);
DEBUGFS_ADD_COUNTER(rx_fragments, rx_fragments);
DEBUGFS_ADD_COUNTER(rx_dropped, rx_dropped);
+ DEBUGFS_ADD_COUNTER(rx_dropped_mic_failure, rx_dropped_mic_failure);
DEBUGFS_ADD_COUNTER(tx_fragments, tx_fragments);
DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count);
DEBUGFS_ADD_COUNTER(tx_retry_failed, tx_retry_failed);
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 776f3d0..7456a95 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -247,6 +247,8 @@ struct sta_ampdu_mlme {
* @num_duplicates: number of duplicate frames received from this STA
* @rx_fragments: number of received MPDUs
* @rx_dropped: number of dropped MPDUs from this STA
+ * @rx_dropped_mic_failure: number of dropped MPDUs
+ * due to mic failure from this STA
* @last_signal: signal of last received frame from this STA
* @avg_signal: moving average of signal of received frames from this
STA
* @last_seq_ctrl: last received seq/frag number from this STA (per RX
queue)
@@ -326,6 +328,7 @@ struct sta_info {
unsigned long num_duplicates;
unsigned long rx_fragments;
unsigned long rx_dropped;
+ unsigned long rx_dropped_mic_failure;
int last_signal;
struct ewma avg_signal;
/* Plus 1 for non-QoS frames */
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 8bd2f5c..960403e 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -166,6 +166,7 @@ mic_fail:
* a driver that supports HW encryption. Send up the key idx only if
* the key is set.
*/
+ rx->sta->rx_dropped_mic_failure++;
mac80211_ev_michael_mic_failure(rx->sdata,
rx->key ? rx->key->conf.keyidx : -1,
(void *) skb->data, NULL, GFP_ATOMIC);


2012-11-27 05:57:56

by Saravana

[permalink] [raw]
Subject: Re: [RFC] mac80211: add debugfs file for mic failure

On 11/26/2012 08:38 PM, Johannes Berg wrote:
> On Mon, 2012-11-26 at 04:56 -0800, [email protected] wrote:
>> Add a debugfs file showing the number of failure of
>> rx packet dropped due to mic failures. currently the
>> number of rx packet dropped is counted in general and
>> not with respect to a specific reason. This patch
>> counts the number of packet drop due to mic failure.
>
> What's the value of this, shouldn't wpa_s/hostapd start countermeasures
> pretty quickly?
>
This will just be a counter which keeps track of the number of mic
failures. Debugfs already had Rx dropped packet counter. This would
provide more granularity in respect to the reason of packet drop.
Yes, wpa_s/hostapd will start countermeasure quickly.

> johannes
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2012-11-29 06:29:13

by Saravana

[permalink] [raw]
Subject: Re: [RFC] mac80211: add debugfs file for mic failure

On 11/27/2012 11:27 AM, Saravana wrote:
> On 11/26/2012 08:38 PM, Johannes Berg wrote:
>> On Mon, 2012-11-26 at 04:56 -0800, [email protected] wrote:
>>> Add a debugfs file showing the number of failure of
>>> rx packet dropped due to mic failures. currently the
>>> number of rx packet dropped is counted in general and
>>> not with respect to a specific reason. This patch
>>> counts the number of packet drop due to mic failure.
>>
>> What's the value of this, shouldn't wpa_s/hostapd start countermeasures
>> pretty quickly?
>>
> This will just be a counter which keeps track of the number of mic failures. Debugfs already had Rx dropped packet counter. This would provide more granularity in respect to the reason of packet drop.
> Yes, wpa_s/hostapd will start countermeasure quickly.
>
>> johannes
>>
Could mic failure count be added to debugfs?
Saravana
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>


2012-11-26 15:08:23

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC] mac80211: add debugfs file for mic failure

On Mon, 2012-11-26 at 04:56 -0800, [email protected] wrote:
> Add a debugfs file showing the number of failure of
> rx packet dropped due to mic failures. currently the
> number of rx packet dropped is counted in general and
> not with respect to a specific reason. This patch
> counts the number of packet drop due to mic failure.

What's the value of this, shouldn't wpa_s/hostapd start countermeasures
pretty quickly?

johannes