浏览代码

mac80211: remove key TX/RX counter

This counter is inherently racy (since it can be incremented by RX
as well as by concurrent TX) and only available in debugfs. Instead
of fixing it to be per-CPU or similar, remove it for now. If needed
it should be added without races and with proper nl80211, perhaps
even addressing the threshold reporting TODO item that's been there
since the code was originally added.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg 10 年之前
父节点
当前提交
77c96404a4
共有 4 个文件被更改,包括 0 次插入7 次删除
  1. 0 2
      net/mac80211/debugfs_key.c
  2. 0 3
      net/mac80211/key.h
  3. 0 1
      net/mac80211/rx.c
  4. 0 1
      net/mac80211/tx.c

+ 0 - 2
net/mac80211/debugfs_key.c

@@ -57,7 +57,6 @@ KEY_CONF_FILE(keylen, D);
 KEY_CONF_FILE(keyidx, D);
 KEY_CONF_FILE(keyidx, D);
 KEY_CONF_FILE(hw_key_idx, D);
 KEY_CONF_FILE(hw_key_idx, D);
 KEY_FILE(flags, X);
 KEY_FILE(flags, X);
-KEY_FILE(tx_rx_count, D);
 KEY_READ(ifindex, sdata->name, "%s\n");
 KEY_READ(ifindex, sdata->name, "%s\n");
 KEY_OPS(ifindex);
 KEY_OPS(ifindex);
 
 
@@ -310,7 +309,6 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key)
 	DEBUGFS_ADD(flags);
 	DEBUGFS_ADD(flags);
 	DEBUGFS_ADD(keyidx);
 	DEBUGFS_ADD(keyidx);
 	DEBUGFS_ADD(hw_key_idx);
 	DEBUGFS_ADD(hw_key_idx);
-	DEBUGFS_ADD(tx_rx_count);
 	DEBUGFS_ADD(algorithm);
 	DEBUGFS_ADD(algorithm);
 	DEBUGFS_ADD(tx_spec);
 	DEBUGFS_ADD(tx_spec);
 	DEBUGFS_ADD(rx_spec);
 	DEBUGFS_ADD(rx_spec);

+ 0 - 3
net/mac80211/key.h

@@ -115,9 +115,6 @@ struct ieee80211_key {
 		} gen;
 		} gen;
 	} u;
 	} u;
 
 
-	/* number of times this key has been used */
-	int tx_rx_count;
-
 #ifdef CONFIG_MAC80211_DEBUGFS
 #ifdef CONFIG_MAC80211_DEBUGFS
 	struct {
 	struct {
 		struct dentry *stalink;
 		struct dentry *stalink;

+ 0 - 1
net/mac80211/rx.c

@@ -1682,7 +1682,6 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
 		if (unlikely(rx->key->flags & KEY_FLAG_TAINTED))
 		if (unlikely(rx->key->flags & KEY_FLAG_TAINTED))
 			return RX_DROP_MONITOR;
 			return RX_DROP_MONITOR;
 
 
-		rx->key->tx_rx_count++;
 		/* TODO: add threshold stuff again */
 		/* TODO: add threshold stuff again */
 	} else {
 	} else {
 		return RX_DROP_MONITOR;
 		return RX_DROP_MONITOR;

+ 0 - 1
net/mac80211/tx.c

@@ -610,7 +610,6 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
 	if (tx->key) {
 	if (tx->key) {
 		bool skip_hw = false;
 		bool skip_hw = false;
 
 
-		tx->key->tx_rx_count++;
 		/* TODO: add threshold stuff again */
 		/* TODO: add threshold stuff again */
 
 
 		switch (tx->key->conf.cipher) {
 		switch (tx->key->conf.cipher) {