Skip to content

Commit

Permalink
mt7603: pull the final rate index from the status descriptor
Browse files Browse the repository at this point in the history
When doing rate probing, multiple frames might end up getting sent with
the probe rate, because of the way that rate probing is set up.
This race window is most visible with MCS rates and aggregation.

To improve rate control stats accuracy, pull the final tx rate from the
descriptor

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Apr 12, 2018
1 parent df9f9f6 commit 9c52f36
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mt7603_mac.c
Expand Up @@ -917,6 +917,8 @@ static bool
mt7603_fill_txs(struct mt7603_dev *dev, struct mt7603_sta *sta,
struct ieee80211_tx_info *info, __le32 *txs_data)
{
int final_idx = 0;
u32 final_rate;
bool final_mpdu;
bool ack_timeout;
bool fixed_rate;
Expand All @@ -938,6 +940,7 @@ mt7603_fill_txs(struct mt7603_dev *dev, struct mt7603_sta *sta,
count = FIELD_GET(MT_TXS4_TX_COUNT, txs);

txs = le32_to_cpu(txs_data[0]);
final_rate = FIELD_GET(MT_TXS0_TX_RATE, txs);
ack_timeout = txs & MT_TXS0_ACK_TIMEOUT;

if (!(txs & MT_TXS0_ACK_ERROR_MASK)) {
Expand Down Expand Up @@ -998,9 +1001,13 @@ mt7603_fill_txs(struct mt7603_dev *dev, struct mt7603_sta *sta,
}

info->status.rates[i].count = cur_count;
final_idx = i;
count -= cur_count;
}

if (sta->rates[final_idx].flags & IEEE80211_TX_RC_MCS)
info->status.rates[final_idx].idx = final_rate & GENMASK(5, 0);

return true;
}

Expand Down

0 comments on commit 9c52f36

Please sign in to comment.