PERFORCE change 140816 for review
Sam Leffler
sam at FreeBSD.org
Mon Apr 28 22:54:07 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=140816
Change 140816 by sam at sam_ebb on 2008/04/28 22:53:17
o lie to amrr about retry counts to avoid pessmimizing the rate
estimator; this is mostly to compensate for bb issues but also
papers over the generic amrr algorithm only handling a single
tx rate (and we often supply two)
o simplify tb_rate data recorded by tx complete status processing;
we don't need the rate indices, the rates are sufficient and
less work to acquire; also no need to bzero values we always write
Affected files ...
.. //depot/projects/vap/sys/dev/bwi/if_bwi.c#10 edit
.. //depot/projects/vap/sys/dev/bwi/if_bwivar.h#6 edit
Differences ...
==== //depot/projects/vap/sys/dev/bwi/if_bwi.c#10 (text+ko) ====
@@ -2942,7 +2942,7 @@
uint32_t mac_ctrl;
uint16_t phy_ctrl;
bus_addr_t paddr;
- int type, ismcast, pkt_len, error;
+ int type, ismcast, pkt_len, error, rix;
#if 0
const uint8_t *p;
int i;
@@ -2962,7 +2962,6 @@
/*
* Find TX rate
*/
- bzero(tb->tb_rate_idx, sizeof(tb->tb_rate_idx));
tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
if (type != IEEE80211_FC0_TYPE_DATA || (m->m_flags & M_EAPOL)) {
rate = rate_fb = tp->mgmtrate;
@@ -2971,19 +2970,18 @@
} else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) {
rate = rate_fb = tp->ucastrate;
} else {
- tb->tb_rate_idx[0] =
- ieee80211_amrr_choose(ni, &BWI_NODE(ni)->amn);
+ rix = ieee80211_amrr_choose(ni, &BWI_NODE(ni)->amn);
rate = ni->ni_txrate;
- if (tb->tb_rate_idx[0] > 0) {
- tb->tb_rate_idx[1] = tb->tb_rate_idx[0] - 1;
- rate_fb = ni->ni_rates.rs_rates[tb->tb_rate_idx[1]] &
+ if (rix > 0) {
+ rate_fb = ni->ni_rates.rs_rates[rix-1] &
IEEE80211_RATE_VAL;
} else {
rate_fb = rate;
- tb->tb_rate_idx[1] = tb->tb_rate_idx[0];
}
}
+ tb->tb_rate[0] = rate;
+ tb->tb_rate[1] = rate_fb;
sc->sc_tx_rate = rate;
/*
@@ -3147,12 +3145,11 @@
/*
* Find TX rate
*/
- bzero(tb->tb_rate_idx, sizeof(tb->tb_rate_idx));
rate = params->ibp_rate0;
rate_fb = (params->ibp_try1 != 0) ?
params->ibp_rate1 : params->ibp_rate0;
- tb->tb_rate_idx[0] = rate;
- tb->tb_rate_idx[1] = rate_fb;
+ tb->tb_rate[0] = rate;
+ tb->tb_rate[1] = rate_fb;
sc->sc_tx_rate = rate;
/*
@@ -3347,12 +3344,15 @@
/* NB: update rate control only for unicast frames */
if (hdr->txh_mac_ctrl & htole32(BWI_TXH_MAC_C_ACK)) {
- /* Feed back 'acked and data_txcnt' */
- ieee80211_amrr_tx_complete(&bn->amn,
- (acked &&
- (data_txcnt <= BWI_SHRETRY_FB ||
- tb->tb_rate_idx[0] == tb->tb_rate_idx[1])),
- data_txcnt-1);
+ /*
+ * Feed back 'acked and data_txcnt'. Note that the
+ * generic AMRR code only understands one tx rate
+ * and the estimator doesn't handle real retry counts
+ * well so to avoid over-aggressive downshifting we
+ * treat any number of retries as "1".
+ */
+ ieee80211_amrr_tx_complete(&bn->amn, acked,
+ data_txcnt > 1);
}
/*
==== //depot/projects/vap/sys/dev/bwi/if_bwivar.h#6 (text+ko) ====
@@ -233,7 +233,7 @@
bus_dmamap_t tb_dmap;
struct ieee80211_node *tb_ni;
- int tb_rate_idx[2];
+ int tb_rate[2];
};
struct bwi_txbuf_data {
More information about the p4-projects
mailing list