git: 25af78d0bdcf - main - ath_rate_sample: correct the "best rate" calculation
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 18 Dec 2024 23:49:00 UTC
The branch main has been updated by adrian:
URL: https://cgit.FreeBSD.org/src/commit/?id=25af78d0bdcfda995de27afc602fd86abdbef346
commit 25af78d0bdcfda995de27afc602fd86abdbef346
Author: Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2024-12-08 17:09:55 +0000
Commit: Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2024-12-18 23:46:52 +0000
ath_rate_sample: correct the "best rate" calculation
This should be a *9 rather than a *10 so higher stream MCS rates
(eg comparing MCS0 and MCS8) that have slightly longer average transmit
times (but better burst transmit times) get considered.
This mirrors what the later code does when considering if a rate
change is needed.
Locally tested:
* AR9280, AP mode
* AR9380, AP mode
Differential Revision: https://reviews.freebsd.org/D47988
Reviewed by: imp
---
sys/dev/ath/ath_rate/sample/sample.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c
index 58eea8f64993..58df9ad1c1cd 100644
--- a/sys/dev/ath/ath_rate/sample/sample.c
+++ b/sys/dev/ath/ath_rate/sample/sample.c
@@ -397,7 +397,8 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TABLE *rt,
* be abstracted out and properly handled.
*/
if (an->an_node.ni_flags & IEEE80211_NODE_HT) {
- if (best_rate_tt == 0 || ((tt * 10) <= (best_rate_tt * 10))) {
+ if (best_rate_tt == 0 ||
+ ((tt * 9) <= (best_rate_tt * 10))) {
best_rate_tt = tt;
best_rate_rix = rix;
best_rate_pct = pct;