diff options
author | Koen Vandeputte <koen.vandeputte@ncentric.com> | 2019-08-28 12:12:41 +0200 |
---|---|---|
committer | Koen Vandeputte <koen.vandeputte@ncentric.com> | 2019-08-28 13:08:21 +0200 |
commit | 5cc942a80eff3b41df164d5e875befa4fc12b183 (patch) | |
tree | 32c4dd126d6ab14a27cd043af60ed75bdd766adc /package/kernel/mac80211/patches/ath/558-ath9k-dynack-introduce-ath_dynack_set_timeout-routin.patch | |
parent | 1bc31e0339352839780a2bb01c350e103f757d72 (diff) | |
download | upstream-5cc942a80eff3b41df164d5e875befa4fc12b183.tar.gz upstream-5cc942a80eff3b41df164d5e875befa4fc12b183.tar.bz2 upstream-5cc942a80eff3b41df164d5e875befa4fc12b183.zip |
ath9k: backport dynack improvements
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
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Diffstat (limited to 'package/kernel/mac80211/patches/ath/558-ath9k-dynack-introduce-ath_dynack_set_timeout-routin.patch')
-rw-r--r-- | package/kernel/mac80211/patches/ath/558-ath9k-dynack-introduce-ath_dynack_set_timeout-routin.patch | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/ath/558-ath9k-dynack-introduce-ath_dynack_set_timeout-routin.patch b/package/kernel/mac80211/patches/ath/558-ath9k-dynack-introduce-ath_dynack_set_timeout-routin.patch new file mode 100644 index 0000000000..e13a15026e --- /dev/null +++ b/package/kernel/mac80211/patches/ath/558-ath9k-dynack-introduce-ath_dynack_set_timeout-routin.patch @@ -0,0 +1,94 @@ +From 4420866ef1b602682b009e0186fbb8aefd2125be Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi <lorenzo@kernel.org> +Date: Tue, 20 Aug 2019 18:20:19 +0200 +Subject: [PATCH 1/4] ath9k: dynack: introduce ath_dynack_set_timeout routine + +Introduce ath_dynack_set_timeout routine to configure slottime/ack/cts +timeouts and remove duplicated code + +Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com> +Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> +--- + drivers/net/wireless/ath/ath9k/dynack.c | 37 ++++++++++++++----------- + 1 file changed, 21 insertions(+), 16 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c +index f112fa5b2eac..38dbe25919f7 100644 +--- a/drivers/net/wireless/ath/ath9k/dynack.c ++++ b/drivers/net/wireless/ath/ath9k/dynack.c +@@ -78,6 +78,24 @@ static inline bool ath_dynack_bssidmask(struct ath_hw *ah, const u8 *mac) + return true; + } + ++/** ++ * ath_dynack_set_timeout - configure timeouts/slottime registers ++ * @ah: ath hw ++ * @to: timeout value ++ * ++ */ ++static void ath_dynack_set_timeout(struct ath_hw *ah, int to) ++{ ++ struct ath_common *common = ath9k_hw_common(ah); ++ int slottime = (to - 3) / 2; ++ ++ ath_dbg(common, DYNACK, "ACK timeout %u slottime %u\n", ++ to, slottime); ++ ath9k_hw_setslottime(ah, slottime); ++ ath9k_hw_set_ack_timeout(ah, to); ++ ath9k_hw_set_cts_timeout(ah, to); ++} ++ + /** + * ath_dynack_compute_ackto - compute ACK timeout as the maximum STA timeout + * @ah: ath hw +@@ -86,7 +104,6 @@ static inline bool ath_dynack_bssidmask(struct ath_hw *ah, const u8 *mac) + */ + static void ath_dynack_compute_ackto(struct ath_hw *ah) + { +- struct ath_common *common = ath9k_hw_common(ah); + struct ath_dynack *da = &ah->dynack; + struct ath_node *an; + int to = 0; +@@ -96,15 +113,8 @@ static void ath_dynack_compute_ackto(struct ath_hw *ah) + to = an->ackto; + + if (to && da->ackto != to) { +- u32 slottime; +- +- slottime = (to - 3) / 2; ++ ath_dynack_set_timeout(ah, to); + da->ackto = to; +- ath_dbg(common, DYNACK, "ACK timeout %u slottime %u\n", +- da->ackto, slottime); +- ath9k_hw_setslottime(ah, slottime); +- ath9k_hw_set_ack_timeout(ah, da->ackto); +- ath9k_hw_set_cts_timeout(ah, da->ackto); + } + } + +@@ -198,10 +208,7 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, + ieee80211_is_assoc_resp(hdr->frame_control) || + ieee80211_is_auth(hdr->frame_control)) { + ath_dbg(common, DYNACK, "late ack\n"); +- +- ath9k_hw_setslottime(ah, (LATEACK_TO - 3) / 2); +- ath9k_hw_set_ack_timeout(ah, LATEACK_TO); +- ath9k_hw_set_cts_timeout(ah, LATEACK_TO); ++ ath_dynack_set_timeout(ah, LATEACK_TO); + if (sta) { + struct ath_node *an; + +@@ -340,9 +347,7 @@ void ath_dynack_reset(struct ath_hw *ah) + da->ack_rbf.h_rb = 0; + + /* init acktimeout */ +- ath9k_hw_setslottime(ah, (ackto - 3) / 2); +- ath9k_hw_set_ack_timeout(ah, ackto); +- ath9k_hw_set_cts_timeout(ah, ackto); ++ ath_dynack_set_timeout(ah, ackto); + } + EXPORT_SYMBOL(ath_dynack_reset); + +-- +2.17.1 + |