Hi Johannes,
On Sat, Jun 9, 2012 at 1:53 AM, Johannes Berg <[email protected]> wrote:
> On Fri, 2012-06-08 at 13:31 -0700, Jason Abele wrote:
>> From: Javier Cardona <[email protected]>
>>
>> The mesh metric is computed every time it was requested by the path
>> selection framework. At that time only the last_tx_rate was taken into
>> account when computing the metric. This last frame may not reflect the
>> average data rate that was possible ver that peer link (it could be a
>> management frame, a rate control probe, or other outlier).
>>
>> This patch maintains an average tx rate for each peer link which is used
>> in metric calculation.
>
> I don't think this makes a lot of sense, the TX rate is supposed to be
> the "best rate" that the rate control algorithm decided on
Yes, but last_tx_rate is not that. This is a snippet from
ieee80211_tx_h_rate_ctrl():
txrc.skb = tx->skb;
txrc.reported_rate.idx = -1;
(...)
rate_control_get_rate(tx->sdata, tx->sta, &txrc);
(...)
if (txrc.reported_rate.idx < 0) {
txrc.reported_rate = info->control.rates[0];
if (tx->sta && ieee80211_is_data(hdr->frame_control))
tx->sta->last_tx_rate = txrc.reported_rate;
} else if (tx->sta)
tx->sta->last_tx_rate = txrc.reported_rate;
last_tx_rate is just the last rate used to send a data frame, not the
average data rate. For instance, if the last data frame is a
broadcast frame transmitted at the lowest rate, last_tx_rate will
report that low rate and not the much higher rate used for unicast
data frames. Using that low rate to compute the airtime link metric
is an aberration.
Cheers,
Javier
>
>> +++ b/net/mac80211/sta_info.h
>> @@ -330,6 +330,7 @@ struct sta_info {
>> unsigned long tx_retry_failed, tx_retry_count;
>> /* moving percentage of failed MSDUs */
>> unsigned int fail_avg;
>> + struct ewma avg_rate;
>
> and in any case this is missing kernel-doc
>
> johannes
>
> _______________________________________________
> Devel mailing list
> [email protected]
> http://lists.open80211s.org/cgi-bin/mailman/listinfo/devel
--
Javier Cardona
cozybit Inc.
http://www.cozybit.com
_______________________________________________
Devel mailing list
[email protected]
http://lists.open80211s.org/cgi-bin/mailman/listinfo/devel