* [PATCH] mac80211: make STA_SLOW_THRESHOLD local
@ 2017-09-26 9:59 Stanislaw Gruszka
2017-09-26 10:18 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Stanislaw Gruszka @ 2017-09-26 9:59 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, toke, Stanislaw Gruszka
STA_SLOW_THRESHOLD is used only in one function, so don't need to be
global define.
Patch also fixes problem of htmldocs build I encountered:
Error(.//net/mac80211/sta_info.h:416): cannot understand prototype: 'STA_SLOW_THRESHOLD 6000 '
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
net/mac80211/sta_info.c | 8 +++++++-
net/mac80211/sta_info.h | 8 --------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 6961501..b79c2d0 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -2319,10 +2319,16 @@ unsigned long ieee80211_sta_last_active(struct sta_info *sta)
static void sta_update_codel_params(struct sta_info *sta, u32 thr)
{
+ /* The bandwidth threshold below which the per-station CoDel parameters
+ * will be scaled to be more lenient (to prevent starvation of slow
+ * stations). Value will be scaled by the number of active stations.
+ */
+ const unsigned int slow_threshold = 6000; /* 6Mbps */
+
if (!sta->sdata->local->ops->wake_tx_queue)
return;
- if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) {
+ if (thr && thr < slow_threshold * sta->local->num_sta) {
sta->cparams.target = MS2TIME(50);
sta->cparams.interval = MS2TIME(300);
sta->cparams.ecn = false;
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 3acbdfa..24eeab8 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -399,14 +399,6 @@ struct ieee80211_sta_rx_stats {
};
/**
- * The bandwidth threshold below which the per-station CoDel parameters will be
- * scaled to be more lenient (to prevent starvation of slow stations). This
- * value will be scaled by the number of active stations when it is being
- * applied.
- */
-#define STA_SLOW_THRESHOLD 6000 /* 6 Mbps */
-
-/**
* struct sta_info - STA information
*
* This structure collects information about a station that
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mac80211: make STA_SLOW_THRESHOLD local
2017-09-26 9:59 [PATCH] mac80211: make STA_SLOW_THRESHOLD local Stanislaw Gruszka
@ 2017-09-26 10:18 ` Johannes Berg
2017-09-26 11:23 ` Stanislaw Gruszka
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2017-09-26 10:18 UTC (permalink / raw)
To: Stanislaw Gruszka, linux-wireless; +Cc: toke
On Tue, 2017-09-26 at 11:59 +0200, Stanislaw Gruszka wrote:
> STA_SLOW_THRESHOLD is used only in one function, so don't need to be
> global define.
>
> Patch also fixes problem of htmldocs build I encountered:
>
> Error(.//net/mac80211/sta_info.h:416): cannot understand prototype:
> 'STA_SLOW_THRESHOLD 6000 '
Why not just change /** to /*? I think it's better to keep it there
even if it's not used, it's a more public thing than the code?
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mac80211: make STA_SLOW_THRESHOLD local
2017-09-26 10:18 ` Johannes Berg
@ 2017-09-26 11:23 ` Stanislaw Gruszka
0 siblings, 0 replies; 3+ messages in thread
From: Stanislaw Gruszka @ 2017-09-26 11:23 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, toke
On Tue, Sep 26, 2017 at 12:18:14PM +0200, Johannes Berg wrote:
> On Tue, 2017-09-26 at 11:59 +0200, Stanislaw Gruszka wrote:
> > STA_SLOW_THRESHOLD is used only in one function, so don't need to be
> > global define.
> >
> > Patch also fixes problem of htmldocs build I encountered:
> >
> > Error(.//net/mac80211/sta_info.h:416): cannot understand prototype:
> > 'STA_SLOW_THRESHOLD 6000????'
>
> Why not just change /** to /*? I think it's better to keep it there
> even if it's not used, it's a more public thing than the code?
I thought local references are preferred over global. Fixing only
comment is fine for me, I'll post v2.
Stanislaw
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-26 11:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-26 9:59 [PATCH] mac80211: make STA_SLOW_THRESHOLD local Stanislaw Gruszka
2017-09-26 10:18 ` Johannes Berg
2017-09-26 11:23 ` Stanislaw Gruszka
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).