Skip to content

wifi: Fix cache matching signal tolerance

Maciej S. Szmigiero requested to merge (removed):cache-signal-tolerance into master

Currently an AP signal level is divided by 10 to generate its cache hash table key: the intention was to match cache entries that are ±5 dBm from the current signal level for that particular AP, but with this approach signal pairs like (-59, -60) or (-58, -62) won't be considered within the tolerance window, even though they should.

This is one of the reasons of low cache hit ratio observed in some conditions.

Fix this by moving signal level values from cache hash table key to a separate array paired with each cached location.

With this change my hit ratio on a stationary laptop improves more than by an order of magnitude: from less than 0.2% to nearly 3% after roughly 12h of runtime (and still rising as more cache entries are collected).

Tested under Valgrind, including with accelerated cache pruning interval.

Merge request reports