]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: fix last RX rate data consistency
authorJohannes Berg <johannes.berg@intel.com>
Thu, 31 Mar 2016 17:02:08 +0000 (20:02 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 6 Apr 2016 11:18:17 +0000 (13:18 +0200)
commit475a7e1986aaf59077b796ed80294839b05abd5d
tree5591e35073577767d0ffb3eadaf74a3a2e0ce9ae
parent3d2dc5ebb823f52c18b26b0a811dfb9c0f0fda78
mac80211: fix last RX rate data consistency

When storing the last_rate_* values in the RX code, there's nothing
to guarantee consistency, so a concurrent reader could see, e.g.
last_rate_idx on the new value, but last_rate_flag still on the old,
getting completely bogus values in the end.

To fix this, I lifted the sta_stats_encode_rate() function from my
old rate statistics code, which encodes the entire rate data into a
single 16-bit value, avoiding the consistency issue.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c
net/mac80211/sta_info.c
net/mac80211/sta_info.h