]> git.baikalelectronics.ru Git - kernel.git/commit
iwlwifi: mvm: LRU-assign key offsets
authorJohannes Berg <johannes.berg@intel.com>
Tue, 16 Jun 2015 15:09:18 +0000 (17:09 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 4 Aug 2015 07:11:39 +0000 (10:11 +0300)
commit2fb975c0957d8f9968a8fca591ca091dee45d977
treebc31eb33a7a7bacd56759f8bd839dc5d5adff178
parent13ed01545e32b7acd5014f5b569103db7feef664
iwlwifi: mvm: LRU-assign key offsets

The current key offset assignment algorithm always uses the lowest
unused key offset, which will potentially lead to issues when the
firmware will change to take the key material for TX from the key
table rather than from the TX command.

In order to avoid those issues (and avoid forgetting about them)
change the key offset allocation algorithm now to avoid reusing key
offsets quickly.

The new algorithm always picks as the next offset the least recently
freed offset, i.e. the offset that has been unused for the longest
amount of time. This is implemented by having a generation counter
for each key offset that is incremented every time a key is deleted,
except for the one that's deleted, which is reset to zero. Thus the
highest counter is the key that's been unused longest.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/mvm.h
drivers/net/wireless/iwlwifi/mvm/sta.c