From daf0131aaf944af331f9a635ec31cd9c5bee06e6 Mon Sep 17 00:00:00 2001 From: adrian Date: Wed, 23 Nov 2011 05:00:25 +0000 Subject: [PATCH] Flesh out the TX aggregation completion statistics. * Failall is now named just that. * Add TX ok and TX fail, for aggregate frame sub-frames. This will break athstats; a followup commit wil resolve this. Sponsored by: Hobnob, Inc. --- sys/dev/ath/if_ath_sysctl.c | 10 ++++++++-- sys/dev/ath/if_ath_tx.c | 5 ++++- sys/dev/ath/if_athioctl.h | 6 ++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sys/dev/ath/if_ath_sysctl.c b/sys/dev/ath/if_ath_sysctl.c index 53235048052..a609341214a 100644 --- a/sys/dev/ath/if_ath_sysctl.c +++ b/sys/dev/ath/if_ath_sysctl.c @@ -842,9 +842,15 @@ ath_sysctl_stats_attach(struct ath_softc *sc) &sc->sc_stats.ast_tx_data_underrun, 0, ""); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_delim_underrun", CTLFLAG_RD, &sc->sc_stats.ast_tx_delim_underrun, 0, ""); - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_aggrfail", CTLFLAG_RD, - &sc->sc_stats.ast_tx_aggrfail, 0, + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_aggr_failall", CTLFLAG_RD, + &sc->sc_stats.ast_tx_aggr_failall, 0, "Number of aggregate TX failures (whole frame)"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_aggr_ok", CTLFLAG_RD, + &sc->sc_stats.ast_tx_aggr_ok, 0, + "Number of aggregate TX OK completions (subframe)"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_aggr_fail", CTLFLAG_RD, + &sc->sc_stats.ast_tx_aggr_fail, 0, + "Number of aggregate TX failures (subframe)"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_intr", CTLFLAG_RD, &sc->sc_stats.ast_rx_intr, 0, "RX interrupts"); diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c index 5625bf24ca3..ea48b93d6ee 100644 --- a/sys/dev/ath/if_ath_tx.c +++ b/sys/dev/ath/if_ath_tx.c @@ -2940,7 +2940,6 @@ ath_tx_comp_aggr_error(struct ath_softc *sc, struct ath_buf *bf_first, TAILQ_INIT(&bf_q); TAILQ_INIT(&bf_cq); - sc->sc_stats.ast_tx_aggrfail++; /* * Update rate control - all frames have failed. @@ -2955,12 +2954,14 @@ ath_tx_comp_aggr_error(struct ath_softc *sc, struct ath_buf *bf_first, ATH_TXQ_LOCK(sc->sc_ac2q[tid->ac]); tap = ath_tx_get_tx_tid(an, tid->tid); + sc->sc_stats.ast_tx_aggr_failall++; /* Retry all subframes */ bf = bf_first; while (bf) { bf_next = bf->bf_next; bf->bf_next = NULL; /* Remove it from the aggr list */ + sc->sc_stats.ast_tx_aggr_fail++; if (ath_tx_retry_subframe(sc, bf, &bf_q)) { drops++; bf->bf_next = NULL; @@ -3196,6 +3197,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first, int fail) ATH_BA_ISSET(ba, ba_index)); if (tx_ok && ATH_BA_ISSET(ba, ba_index)) { + sc->sc_stats.ast_tx_aggr_ok++; ath_tx_update_baw(sc, an, atid, bf); bf->bf_state.bfs_dobaw = 0; if (! bf->bf_state.bfs_addedbaw) @@ -3205,6 +3207,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first, int fail) bf->bf_next = NULL; TAILQ_INSERT_TAIL(&bf_cq, bf, bf_list); } else { + sc->sc_stats.ast_tx_aggr_fail++; if (ath_tx_retry_subframe(sc, bf, &bf_q)) { drops++; bf->bf_next = NULL; diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h index 680694f8d2b..9c1cc12c72e 100644 --- a/sys/dev/ath/if_athioctl.h +++ b/sys/dev/ath/if_athioctl.h @@ -148,12 +148,14 @@ struct ath_stats { u_int32_t ast_tx_swretrymax; /* software TX retry max limit reach */ u_int32_t ast_tx_data_underrun; u_int32_t ast_tx_delim_underrun; - u_int32_t ast_tx_aggrfail; /* aggregate TX failed in its entirety */ + u_int32_t ast_tx_aggr_failall; /* aggregate TX failed in its entirety */ u_int32_t ast_tx_getnobuf; u_int32_t ast_tx_getbusybuf; u_int32_t ast_tx_intr; u_int32_t ast_rx_intr; - u_int32_t ast_pad[4]; + u_int32_t ast_tx_aggr_ok; /* aggregate TX ok */ + u_int32_t ast_tx_aggr_fail; /* aggregate TX failed */ + u_int32_t ast_pad[2]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) -- 2.45.0