linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>,
	linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net
Subject: Re: [PATCH v2 08/10] mac80211: add max. lossless throughput per rate to rc_stats
Date: Tue, 17 Mar 2015 09:32:29 +0100	[thread overview]
Message-ID: <5507E69D.3080001@openwrt.org> (raw)
In-Reply-To: <1423839472-15625-9-git-send-email-thomas@net.t-labs.tu-berlin.de>

On 2015-02-13 15:57, Thomas Huehn wrote:
> This patch adds the new statistic "maximum possible lossless
> throughput" to Minstrels and Minstrel-HTs rc_stats (in debugfs). This
> enables comprehensive comparison between current per-rate throughput
> and max. achievable per-rate throughput.
> 
> Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
> ---
>  net/mac80211/rc80211_minstrel.c            | 12 ++++++++++++
>  net/mac80211/rc80211_minstrel.h            |  1 +
>  net/mac80211/rc80211_minstrel_debugfs.c    | 18 +++++++++++-------
>  net/mac80211/rc80211_minstrel_ht.c         | 19 +++++++++++++++++++
>  net/mac80211/rc80211_minstrel_ht.h         |  1 +
>  net/mac80211/rc80211_minstrel_ht_debugfs.c | 20 ++++++++++++--------
>  6 files changed, 56 insertions(+), 15 deletions(-)
> 
> diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
> index 28de2f7a..42dfef8 100644
> --- a/net/mac80211/rc80211_minstrel.c
> +++ b/net/mac80211/rc80211_minstrel.c
> @@ -87,7 +87,19 @@ int minstrel_get_tp_avg(struct minstrel_rate *mr)
>  	return tp_avg;
>  }
>  
> +/* return max. potential lossless throughput */
> +int minstrel_get_tp_max(struct minstrel_rate *mr)
> +{
> +	int tp_max, usecs;
>  
> +	usecs = mr->perfect_tx_time;
> +	if (!usecs)
> +		usecs = 1000000;
> +
> +	tp_max = 100000 / usecs;
> +
> +	return tp_max;
> +}
This should probably be an inline function, and you can remove the
tp_max variable as well.
By the way, in the case of !usecs, the result (100000 / 1000000) will be
0, so you can simplify the logic.


>  /* find & sort topmost throughput rates */
>  static inline void
> diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
> index 2a55f63..b62b04e 100644
> --- a/net/mac80211/rc80211_minstrel_ht.c
> +++ b/net/mac80211/rc80211_minstrel_ht.c
> @@ -350,6 +350,25 @@ minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate)
>  }
>  
>  /*
> + * Return max. potential lossless throughput based on the average A-MPDU
> + */
> +int
> +minstrel_ht_get_tp_max(struct minstrel_ht_sta *mi, int group, int rate)
> +{
> +	unsigned int nsecs = 0;
> +	unsigned int tp_max;
> +
> +	if (group != MINSTREL_CCK_GROUP)
> +		nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len);
> +
> +	nsecs += minstrel_mcs_groups[group].duration[rate];
> +	tp_max = 100000000 / nsecs;
> +
> +	return tp_max;
> +}
I don't like duplication of the throughput metric - gets annoying if we
ever decide to tweak it. How about unifying this with
minstrel_ht_get_tp_avg by passing in the prob value as a parameter.

- Felix

  reply	other threads:[~2015-03-17  8:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 14:57 [PATCH v2 0/10] Improve Minstrels & Minstrel-HTs common code base & statistics Thomas Huehn
2015-02-13 14:57 ` [PATCH v2 01/10] mac80211: enhance readability of Minstrels rc_stats output Thomas Huehn
2015-02-13 14:57 ` [PATCH v2 02/10] mac80211: enhance readability of Minstrel-HTs " Thomas Huehn
2015-02-13 14:57 ` [PATCH v2 03/10] mac80211: add new Minstrel statistic output via csv Thomas Huehn
2015-03-17  8:16   ` Felix Fietkau
2015-02-13 14:57 ` [PATCH v2 04/10] mac80211: add new Minstrel-HT " Thomas Huehn
2015-03-17  8:18   ` Felix Fietkau
2015-02-13 14:57 ` [PATCH v2 05/10] mac80211: unify Minstrel & Minstrel-HTs calculation of rate statistics Thomas Huehn
2015-02-13 14:57 ` [PATCH v2 06/10] mac80211: improve Minstrel variable & function naming Thomas Huehn
2015-02-13 14:57 ` [PATCH v2 07/10] mac80211: restructure per-rate throughput calculation into function Thomas Huehn
2015-03-17  8:24   ` Felix Fietkau
2015-02-13 14:57 ` [PATCH v2 08/10] mac80211: add max. lossless throughput per rate to rc_stats Thomas Huehn
2015-03-17  8:32   ` Felix Fietkau [this message]
2015-02-13 14:57 ` [PATCH v2 09/10] mac80211: reduce calculation costs of EWMA Thomas Huehn
2015-02-13 14:57 ` [PATCH v2 10/10] mac80211: add standard deviation to Minstrels throughput statistic Thomas Huehn
2015-02-25 21:00 ` [PATCH v2 0/10] Improve Minstrels & Minstrel-HTs common code base & statistics Bastian Bittorf
2015-02-25 21:18 ` Bastian Bittorf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5507E69D.3080001@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=thomas@net.t-labs.tu-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).