From 63dd123deaa3064141ef7ef49e7896499e41e881 Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 9 Feb 2006 20:57:48 +0000 Subject: [PATCH] lower try count on mgt (and ctl) frames to avoid clogging the tx queue and loading the bss when operating in ap mode under load; adjust recognition of multi-rate retry to match MFC after: 2 weeks --- sys/dev/ath/if_ath.c | 15 ++++++++++----- sys/dev/ath/if_athvar.h | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 0a2e0e8ac1dd..879f567ec18b 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -3143,7 +3143,8 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf struct ath_hal *ah = sc->sc_ah; struct ifnet *ifp = sc->sc_ifp; const struct chanAccParams *cap = &ic->ic_wme.wme_chanParams; - int i, error, iswep, ismcast, keyix, hdrlen, pktlen, try0; + int i, error, iswep, ismcast, ismrr; + int keyix, hdrlen, pktlen, try0; u_int8_t rix, txrate, ctsrate; u_int8_t cix = 0xff; /* NB: silence compiler */ struct ath_desc *ds, *ds0; @@ -3285,6 +3286,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf an = ATH_NODE(ni); flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ + ismrr = 0; /* default no multi-rate retry*/ /* * Calculate Atheros packet type from IEEE80211 packet header, * setup for rate calculations, and select h/w transmit queue. @@ -3304,7 +3306,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf txrate = rt->info[rix].rateCode; if (shortPreamble) txrate |= rt->info[rix].shortPreamble; - try0 = ATH_TXMAXTRY; + try0 = ATH_TXMGTTRY; /* NB: force all management frames to highest queue */ if (ni->ni_flags & IEEE80211_NODE_QOS) { /* NB: force all management frames to highest queue */ @@ -3319,7 +3321,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf txrate = rt->info[rix].rateCode; if (shortPreamble) txrate |= rt->info[rix].shortPreamble; - try0 = ATH_TXMAXTRY; + try0 = ATH_TXMGTTRY; /* NB: force all ctl frames to highest queue */ if (ni->ni_flags & IEEE80211_NODE_QOS) { /* NB: force all ctl frames to highest queue */ @@ -3336,6 +3338,8 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf ath_rate_findrate(sc, an, shortPreamble, pktlen, &rix, &try0, &txrate); sc->sc_txrate = txrate; /* for LED blinking */ + if (try0 != ATH_TXMAXTRY) + ismrr = 1; /* * Default all non-QoS traffic to the background queue. */ @@ -3454,7 +3458,8 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf /* * Must disable multi-rate retry when using RTS/CTS. */ - try0 = ATH_TXMAXTRY; + ismrr = 0; + try0 = ATH_TXMGTTRY; /* XXX */ } else ctsrate = 0; @@ -3525,7 +3530,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf * when the hardware supports multi-rate retry and * we don't use it. */ - if (try0 != ATH_TXMAXTRY) + if (ismrr) ath_rate_setupxtxdesc(sc, an, ds, shortPreamble, rix); /* diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index ae808336f6af..7e49da1d9d5a 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -55,6 +55,7 @@ #define ATH_TXBUF 100 /* number of TX buffers */ #define ATH_TXDESC 10 /* number of descriptors per buffer */ #define ATH_TXMAXTRY 11 /* max number of transmit attempts */ +#define ATH_TXMGTTRY 4 /* xmit attempts for mgt/ctl frames */ #define ATH_TXINTR_PERIOD 5 /* max number of batched tx descriptors */ #define ATH_BEACON_AIFS_DEFAULT 0 /* default aifs for ap beacon q */