mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-06 22:08:54 +00:00
4b5c77ca2f
Close cooperation with Lorenzo Bianconi resulted in these patches which fix all remaining seen issues when using dynack. Fix link losses when: - Late Ack's are not seen or not present - switching from too low static coverage class to dynack on a live link These are fixed by setting the Ack Timeout/Slottime to the max possible value for the currently used channel width when a new station has been discovered. When traffic flows, dynack is able to adjust to optimal values within a few packets received (typically < 1 second) These changes have been thoroughly tested on ~60 offshore devices all interconnected using mesh over IBSS and dynack enabled on all. Distances between devices varied from <100m up to ~35km [move patches to correct folder + renumber] Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> (cherry picked from commit f6e8ba0238fe349b7529357793e2fb18635819ed)
97 lines
2.8 KiB
Diff
97 lines
2.8 KiB
Diff
From 3f737abb7d53cc80d619a3b4a30b6fa63cdc8df7 Mon Sep 17 00:00:00 2001
|
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Date: Tue, 20 Aug 2019 18:20:21 +0200
|
|
Subject: [PATCH 3/4] ath9k: dynack: set max timeout according to channel width
|
|
|
|
Compute maximum configurable ackimeout/ctstimeout according to channel
|
|
width (clockrate)
|
|
|
|
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
---
|
|
drivers/net/wireless/ath/ath9k/dynack.c | 38 +++++++++++++++++++------
|
|
1 file changed, 30 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c
|
|
index 398ea872751f..fe9181533de3 100644
|
|
--- a/drivers/net/wireless/ath/ath9k/dynack.c
|
|
+++ b/drivers/net/wireless/ath/ath9k/dynack.c
|
|
@@ -20,11 +20,30 @@
|
|
|
|
#define COMPUTE_TO (5 * HZ)
|
|
#define LATEACK_DELAY (10 * HZ)
|
|
-#define LATEACK_TO 256
|
|
-#define MAX_DELAY 300
|
|
#define EWMA_LEVEL 96
|
|
#define EWMA_DIV 128
|
|
|
|
+/**
|
|
+ * ath_dynack_get_max_to - set max timeout according to channel width
|
|
+ * @ah: ath hw
|
|
+ *
|
|
+ */
|
|
+static u32 ath_dynack_get_max_to(struct ath_hw *ah)
|
|
+{
|
|
+ const struct ath9k_channel *chan = ah->curchan;
|
|
+
|
|
+ if (!chan)
|
|
+ return 300;
|
|
+
|
|
+ if (IS_CHAN_HT40(chan))
|
|
+ return 300;
|
|
+ if (IS_CHAN_HALF_RATE(chan))
|
|
+ return 750;
|
|
+ if (IS_CHAN_QUARTER_RATE(chan))
|
|
+ return 1500;
|
|
+ return 600;
|
|
+}
|
|
+
|
|
/**
|
|
* ath_dynack_ewma - EWMA (Exponentially Weighted Moving Average) calculation
|
|
*
|
|
@@ -126,15 +145,16 @@ static void ath_dynack_compute_ackto(struct ath_hw *ah)
|
|
*/
|
|
static void ath_dynack_compute_to(struct ath_hw *ah)
|
|
{
|
|
- u32 ackto, ack_ts;
|
|
- u8 *dst, *src;
|
|
+ struct ath_dynack *da = &ah->dynack;
|
|
+ u32 ackto, ack_ts, max_to;
|
|
struct ieee80211_sta *sta;
|
|
- struct ath_node *an;
|
|
struct ts_info *st_ts;
|
|
- struct ath_dynack *da = &ah->dynack;
|
|
+ struct ath_node *an;
|
|
+ u8 *dst, *src;
|
|
|
|
rcu_read_lock();
|
|
|
|
+ max_to = ath_dynack_get_max_to(ah);
|
|
while (da->st_rbf.h_rb != da->st_rbf.t_rb &&
|
|
da->ack_rbf.h_rb != da->ack_rbf.t_rb) {
|
|
ack_ts = da->ack_rbf.tstamp[da->ack_rbf.h_rb];
|
|
@@ -150,7 +170,7 @@ static void ath_dynack_compute_to(struct ath_hw *ah)
|
|
if (ack_ts > st_ts->tstamp + st_ts->dur) {
|
|
ackto = ack_ts - st_ts->tstamp - st_ts->dur;
|
|
|
|
- if (ackto < MAX_DELAY) {
|
|
+ if (ackto < max_to) {
|
|
sta = ieee80211_find_sta_by_ifaddr(ah->hw, dst,
|
|
src);
|
|
if (sta) {
|
|
@@ -207,8 +227,10 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb,
|
|
if (ieee80211_is_assoc_req(hdr->frame_control) ||
|
|
ieee80211_is_assoc_resp(hdr->frame_control) ||
|
|
ieee80211_is_auth(hdr->frame_control)) {
|
|
+ u32 max_to = ath_dynack_get_max_to(ah);
|
|
+
|
|
ath_dbg(common, DYNACK, "late ack\n");
|
|
- ath_dynack_set_timeout(ah, LATEACK_TO);
|
|
+ ath_dynack_set_timeout(ah, max_to);
|
|
if (sta) {
|
|
struct ath_node *an;
|
|
|
|
--
|
|
2.17.1
|
|
|