Some cosmetic fixes to ath_rate_sample.
* Use 64 bit integer types for the sample rate statistics. When TX'ing 11n aggregates, a 32 bit counter will overflow in a few hours due to the high packet throughput. * Create a default label of "" rather than defaulting to "Mb" - that way if a rate hasn't yet been selected, it won't say "-1 Mb". Sponsored by: Hobnob, Inc.
This commit is contained in:
parent
a73ffc7e72
commit
8f9fd74063
@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
*/
|
*/
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_wlan.h"
|
#include "opt_wlan.h"
|
||||||
|
#include "opt_ah.h"
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -146,6 +147,8 @@ ath_rate_node_cleanup(struct ath_softc *sc, struct ath_node *an)
|
|||||||
static int
|
static int
|
||||||
dot11rate(const HAL_RATE_TABLE *rt, int rix)
|
dot11rate(const HAL_RATE_TABLE *rt, int rix)
|
||||||
{
|
{
|
||||||
|
if (rix < 0)
|
||||||
|
return -1;
|
||||||
return rt->info[rix].phy == IEEE80211_T_HT ?
|
return rt->info[rix].phy == IEEE80211_T_HT ?
|
||||||
rt->info[rix].dot11Rate : (rt->info[rix].dot11Rate & IEEE80211_RATE_VAL) / 2;
|
rt->info[rix].dot11Rate : (rt->info[rix].dot11Rate & IEEE80211_RATE_VAL) / 2;
|
||||||
}
|
}
|
||||||
@ -153,6 +156,8 @@ dot11rate(const HAL_RATE_TABLE *rt, int rix)
|
|||||||
static const char *
|
static const char *
|
||||||
dot11rate_label(const HAL_RATE_TABLE *rt, int rix)
|
dot11rate_label(const HAL_RATE_TABLE *rt, int rix)
|
||||||
{
|
{
|
||||||
|
if (rix < 0)
|
||||||
|
return "";
|
||||||
return rt->info[rix].phy == IEEE80211_T_HT ? "MCS" : "Mb ";
|
return rt->info[rix].phy == IEEE80211_T_HT ? "MCS" : "Mb ";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -903,13 +908,14 @@ sample_stats(void *arg, struct ieee80211_node *ni)
|
|||||||
for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) {
|
for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) {
|
||||||
if (sn->stats[y][rix].total_packets == 0)
|
if (sn->stats[y][rix].total_packets == 0)
|
||||||
continue;
|
continue;
|
||||||
printf("[%2u %s:%4u] %8d:%-8d (%3d%%) T %8d F %4d avg %5u last %u\n",
|
printf("[%2u %s:%4u] %8ju:%-8ju (%3d%%) T %8ju F %4d avg %5u last %u\n",
|
||||||
dot11rate(rt, rix), dot11rate_label(rt, rix),
|
dot11rate(rt, rix), dot11rate_label(rt, rix),
|
||||||
bin_to_size(y),
|
bin_to_size(y),
|
||||||
sn->stats[y][rix].total_packets,
|
(uintmax_t) sn->stats[y][rix].total_packets,
|
||||||
sn->stats[y][rix].packets_acked,
|
(uintmax_t) sn->stats[y][rix].packets_acked,
|
||||||
(100*sn->stats[y][rix].packets_acked)/sn->stats[y][rix].total_packets,
|
(int) ((sn->stats[y][rix].packets_acked * 100ULL) /
|
||||||
sn->stats[y][rix].tries,
|
sn->stats[y][rix].total_packets),
|
||||||
|
(uintmax_t) sn->stats[y][rix].tries,
|
||||||
sn->stats[y][rix].successive_failures,
|
sn->stats[y][rix].successive_failures,
|
||||||
sn->stats[y][rix].average_tx_time,
|
sn->stats[y][rix].average_tx_time,
|
||||||
ticks - sn->stats[y][rix].last_tx);
|
ticks - sn->stats[y][rix].last_tx);
|
||||||
|
@ -57,9 +57,9 @@ struct sample_softc {
|
|||||||
struct rate_stats {
|
struct rate_stats {
|
||||||
unsigned average_tx_time;
|
unsigned average_tx_time;
|
||||||
int successive_failures;
|
int successive_failures;
|
||||||
int tries;
|
uint64_t tries;
|
||||||
int total_packets;
|
uint64_t total_packets; /* pkts total since assoc */
|
||||||
int packets_acked;
|
uint64_t packets_acked; /* pkts acked since assoc */
|
||||||
unsigned perfect_tx_time; /* transmit time for 0 retries */
|
unsigned perfect_tx_time; /* transmit time for 0 retries */
|
||||||
int last_tx;
|
int last_tx;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user