Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

-7
-2
net/mac80211/debugfs_key.c
··· 57 57 KEY_CONF_FILE(keyidx, D); 58 58 KEY_CONF_FILE(hw_key_idx, D); 59 59 KEY_FILE(flags, X); 60 - KEY_FILE(tx_rx_count, D); 61 60 KEY_READ(ifindex, sdata->name, "%s\n"); 62 61 KEY_OPS(ifindex); 63 62 ··· 309 310 DEBUGFS_ADD(flags); 310 311 DEBUGFS_ADD(keyidx); 311 312 DEBUGFS_ADD(hw_key_idx); 312 - DEBUGFS_ADD(tx_rx_count); 313 313 DEBUGFS_ADD(algorithm); 314 314 DEBUGFS_ADD(tx_spec); 315 315 DEBUGFS_ADD(rx_spec);
-3
net/mac80211/key.h
··· 115 115 } gen; 116 116 } u; 117 117 118 - /* number of times this key has been used */ 119 - int tx_rx_count; 120 - 121 118 #ifdef CONFIG_MAC80211_DEBUGFS 122 119 struct { 123 120 struct dentry *stalink;
-1
net/mac80211/rx.c
··· 1682 1682 if (unlikely(rx->key->flags & KEY_FLAG_TAINTED)) 1683 1683 return RX_DROP_MONITOR; 1684 1684 1685 - rx->key->tx_rx_count++; 1686 1685 /* TODO: add threshold stuff again */ 1687 1686 } else { 1688 1687 return RX_DROP_MONITOR;
-1
net/mac80211/tx.c
··· 610 610 if (tx->key) { 611 611 bool skip_hw = false; 612 612 613 - tx->key->tx_rx_count++; 614 613 /* TODO: add threshold stuff again */ 615 614 616 615 switch (tx->key->conf.cipher) {