From a2d74cc30bf7dd80819001de01f92b3660b37909 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 22 Jan 2017 05:45:42 +0000 Subject: [PATCH] [ath] only apply the AR9300 delimiter workaround for the first sub-frame. This is supposed to only be applied to the first subframe and only if RTS/CTS is being done. I'm still not yet checking RTS/CTS exchange status so it's just happening for all subframes on AR9380 and later. This gets MCS23 throughput up from around 250mbit to 303mbit with RTS/CTS protection enabled, and around 330mbit with no HT protection enabled. Now, MCS23 has a PHY rate of 450mbit and we should be seeing closer to 400mbit for a straight one-way UDP test, but this beats the previous maximum throughput. Tested: * AR9380 (STA) -> AR9580 (AP) - STA with the modifications, doing UDP TX test using iperf. --- sys/dev/ath/if_ath_tx_ht.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c index e8bd665303ac..ff79b78817dd 100644 --- a/sys/dev/ath/if_ath_tx_ht.c +++ b/sys/dev/ath/if_ath_tx_ht.c @@ -402,7 +402,7 @@ ath_tx_rate_fill_rcflags(struct ath_softc *sc, struct ath_buf *bf) */ static int ath_compute_num_delims(struct ath_softc *sc, struct ath_buf *first_bf, - uint16_t pktlen) + uint16_t pktlen, int is_first) { #define MS(_v, _f) (((_v) & _f) >> _f##_S) const HAL_RATE_TABLE *rt = sc->sc_currates; @@ -458,11 +458,12 @@ ath_compute_num_delims(struct ath_softc *sc, struct ath_buf *first_bf, * For AR9380, there's a minimum number of delimeters * required when doing RTS. * - * XXX TODO: this is only needed if (a) RTS/CTS is enabled, and - * XXX (b) this is the first sub-frame in the aggregate. + * XXX TODO: this is only needed if (a) RTS/CTS is enabled for + * this exchange, and (b) (done) this is the first sub-frame + * in the aggregate. */ if (sc->sc_use_ent && (sc->sc_ent_cfg & AH_ENT_RTSCTS_DELIM_WAR) - && ndelim < AH_FIRST_DESC_NDELIMS) + && ndelim < AH_FIRST_DESC_NDELIMS && is_first) ndelim = AH_FIRST_DESC_NDELIMS; /* @@ -975,7 +976,7 @@ ath_tx_form_aggr(struct ath_softc *sc, struct ath_node *an, */ bf->bf_state.bfs_ndelim = ath_compute_num_delims(sc, bf_first, - bf->bf_state.bfs_pktlen); + bf->bf_state.bfs_pktlen, (bf_first == bf)); /* * Calculate the padding needed from this set of delimiters,