From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 245573B260 for ; Sat, 10 Sep 2016 15:54:46 -0400 (EDT) Received: by mail-wm0-x244.google.com with SMTP id b187so7617290wme.0 for ; Sat, 10 Sep 2016 12:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rdLlCbCJAUzWs6YJTOYV8cMI2iTkaxVXQeg5vQxvYj0=; b=bqUmN7ekC6qJRRdwYvzRjc9CHPkRZfmVte7phkiG1RDVVCxv6ELFWJGwsHZdMDWYM3 Z6QfWIHby2XqrXirLMnPegSa8LuzFgfwM8BzmpRRDVCnAL69ypeyaUpdDW4FmuS86kkR aeTNxFlKEhw50yxJRagJAg2Z0bOfxlAPcWLNE1QrwGM7YAwBVxtQdG+rRpqrDrhx9GLl SYO9J3nQdJZcIv6Ypd7ncbKNJoK3aW9uzL99wk4aq7wNo7vaYq9tyfseVEbHY7N5rI2f bjZK4NiqjtJsDzPALAj2HuAwVEXX7SlFpc8HSulsnIgWS8b1lyOy5/d+gxP7mdIpc/jd 3FJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rdLlCbCJAUzWs6YJTOYV8cMI2iTkaxVXQeg5vQxvYj0=; b=c699DOdzpMyfSGife4SiA2NWg3W6rO9bnz22DJjw3qQ4A2Dh/AQXwQy6N7NfHzAC40 hAXuf0ufd4fzQmAn9TRTuXGPtFzSDSZl9DbsUWCXcAm4U6M22TnXjtT0JHLnKeekHMO3 r9HiVfdlU7Gkhf9dowJvFDHIrXSRMAa1RpxvWy+p6dmwHgJGBEfzB4a2LL8goJzvss/E 1zNvI+l6ivw6UL3/ixEI8wQkbd1VWXTMzA3KgIbqwt4aAdCuvYD+DxTabPFCpFKncWR8 WPJz7Qsslomb+Soe3gEzoeb0TYqlo22L1e1wsmnx5ox8umAMcS0MO6HzLHoN3OVk00+z H71Q== X-Gm-Message-State: AE9vXwPqN2ydMu3OHGa0HGC1cpFe5GxJUCKjBFwpQ8qy938T/v/I+gJ6xlj0RV3lcZSMIvtXevS4FvaGMohHjA== X-Received: by 10.194.192.195 with SMTP id hi3mr8306674wjc.108.1473537285095; Sat, 10 Sep 2016 12:54:45 -0700 (PDT) MIME-Version: 1.0 Sender: gettysjim@gmail.com Received: by 10.194.146.208 with HTTP; Sat, 10 Sep 2016 12:54:44 -0700 (PDT) In-Reply-To: <20160910193315.30738-1-toke@toke.dk> References: <20160910193315.30738-1-toke@toke.dk> From: Jim Gettys Date: Sat, 10 Sep 2016 15:54:44 -0400 X-Google-Sender-Auth: OjlvrgpNdKfz2zcfLD17nFu1V7Y Message-ID: To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Cc: make-wifi-fast@lists.bufferbloat.net, linux-wireless , Felix Fietkau Content-Type: multipart/alternative; boundary=047d7ba97fb27105b9053c2ca2ee Subject: Re: [Make-wifi-fast] [PATCH] mac80211: Dynamically set CoDel parameters per station. X-BeenThere: make-wifi-fast@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Sep 2016 19:54:46 -0000 --047d7ba97fb27105b9053c2ca2ee Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Sep 10, 2016 at 3:33 PM, Toke H=C3=B8iland-J=C3=B8rgensen wrote: > CoDel can be too aggressive if a station sends at a very low rate, > leading to starvation. This gets worse the more stations are present, as > each station gets more bursty the longer the round-robin scheduling > between stations takes. > > This adds dynamic adjustment of CoDel parameters per station. It uses > the rate selection information to estimate throughput and sets more > lenient CoDel parameters if the estimated throughput is below a > threshold. To not change parameters too often, a hysteresis of two > seconds is added. > =E2=80=8BWhere is this 2 second constant coming from? I'd expect it should= be of order the maximum RTT (or a small constant factor of that, which for intercontinental connections should be 200-300ms. More interestingly, maybe the adjustment should be related to the # of active stations. Basically, I'm pushing back about an arbitrary number apparently picked out of thin air... ;-). - Jim =E2=80=8B > > A new callback is added that drivers can use to notify mac80211 about > changes in expected throughput, so the same adjustment can be made for > cards that implement rate control in firmware. Drivers that don't use > this will just get the default parameters. > > The threshold used and the CoDel parameters set for slow stations are > chosen to err on the side of caution. I.e. rather be too lenient than > too aggressive. A better algorithm can then be added later. > > Cc: Michal Kazior > Cc: Felix Fietkau > Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen > --- > include/net/mac80211.h | 17 +++++++++++++++++ > net/mac80211/rate.c | 2 ++ > net/mac80211/sta_info.c | 35 +++++++++++++++++++++++++++++++++++ > net/mac80211/sta_info.h | 12 ++++++++++++ > net/mac80211/tx.c | 9 ++++++++- > 5 files changed, 74 insertions(+), 1 deletion(-) > > diff --git a/include/net/mac80211.h b/include/net/mac80211.h > index cca510a..6e0cf85 100644 > --- a/include/net/mac80211.h > +++ b/include/net/mac80211.h > @@ -4089,6 +4089,23 @@ void ieee80211_get_tx_rates(struct ieee80211_vif > *vif, > int max_rates); > > /** > + * ieee80211_sta_set_expected_throughput - set the expected throughput > for a > + * station > + * > + * Call this function to notify mac80211 about a change in expected > throughput > + * to a station. A driver for a device that does rate control in firmwar= e > can > + * call this function when the expected throughput estimate towards a > station > + * changes. The information is used to tune the CoDel AQM applied to > traffic > + * going towards that station (which can otherwise be too aggressive and > cause > + * slow stations to starve). > + * > + * @sta: the station to set throughput for. > + * @thr: the current expected throughput in kbps. > + */ > +void ieee80211_sta_set_expected_throughput(struct ieee80211_sta *pubsta, > + u32 thr); > + > +/** > * ieee80211_tx_status - transmit status callback > * > * Call this function for all transmitted frames after they have been > diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c > index 206698b..5370f5c 100644 > --- a/net/mac80211/rate.c > +++ b/net/mac80211/rate.c > @@ -890,6 +890,8 @@ int rate_control_set_rates(struct ieee80211_hw *hw, > > drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta); > > + sta_update_codel_params(sta, sta_get_expected_throughput(sta)); > + > return 0; > } > EXPORT_SYMBOL(rate_control_set_rates); > diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c > index 19f14c9..6deda4a 100644 > --- a/net/mac80211/sta_info.c > +++ b/net/mac80211/sta_info.c > @@ -20,6 +20,7 @@ > #include > #include > > +#include > #include > #include "ieee80211_i.h" > #include "driver-ops.h" > @@ -419,6 +420,8 @@ struct sta_info *sta_info_alloc(struct > ieee80211_sub_if_data *sdata, > > sta->sta.max_rc_amsdu_len =3D IEEE80211_MAX_MPDU_LEN_HT_BA; > > + sta_update_codel_params(sta, 0); > + > sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr); > > return sta; > @@ -2306,6 +2309,15 @@ u32 sta_get_expected_throughput(struct sta_info > *sta) > return thr; > } > > +void ieee80211_sta_set_expected_throughput(struct ieee80211_sta *pubsta, > + u32 thr) > +{ > + struct sta_info *sta =3D container_of(pubsta, struct sta_info, st= a); > + > + sta_update_codel_params(sta, thr); > +} > +EXPORT_SYMBOL(ieee80211_sta_set_expected_throughput); > + > unsigned long ieee80211_sta_last_active(struct sta_info *sta) > { > struct ieee80211_sta_rx_stats *stats =3D sta_get_last_rx_stats(st= a); > @@ -2314,3 +2326,26 @@ unsigned long ieee80211_sta_last_active(struct > sta_info *sta) > return stats->last_rx; > return sta->status_stats.last_ack; > } > + > +void sta_update_codel_params(struct sta_info *sta, u32 thr) > +{ > + u64 now =3D ktime_get_ns(); > + > + if (!sta->sdata->local->ops->wake_tx_queue) > + return; > + > + if (now - sta->cparams.update_time < STA_CPARAMS_HYSTERESIS) > + return; > + > + if (thr && thr < STA_SLOW_THRESHOLD) { > + sta->cparams.params.target =3D MS2TIME(50); > + sta->cparams.params.interval =3D MS2TIME(300); > + sta->cparams.params.ecn =3D false; > + } else { > + sta->cparams.params.target =3D MS2TIME(20); > + sta->cparams.params.interval =3D MS2TIME(100); > + sta->cparams.params.ecn =3D true; > + } > + sta->cparams.params.ce_threshold =3D CODEL_DISABLED_THRESHOLD; > + sta->cparams.update_time =3D now; > +} > diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h > index 0556be3..ad088ff 100644 > --- a/net/mac80211/sta_info.h > +++ b/net/mac80211/sta_info.h > @@ -384,6 +384,14 @@ struct ieee80211_sta_rx_stats { > u64 msdu[IEEE80211_NUM_TIDS + 1]; > }; > > +#define STA_CPARAMS_HYSTERESIS (2L * NSEC_PER_SEC) > +#define STA_SLOW_THRESHOLD 8000 /* 8 Mbps */ > + > +struct sta_codel_params { > + struct codel_params params; > + u64 update_time; > +}; > + > /** > * struct sta_info - STA information > * > @@ -437,6 +445,7 @@ struct ieee80211_sta_rx_stats { > * @known_smps_mode: the smps_mode the client thinks we are in. Relevant > for > * AP only. > * @cipher_scheme: optional cipher scheme for this station > + * @cparams: CoDel parameters for this station. > * @reserved_tid: reserved TID (if any, otherwise > IEEE80211_TID_UNRESERVED) > * @fast_tx: TX fastpath information > * @fast_rx: RX fastpath information > @@ -540,6 +549,8 @@ struct sta_info { > enum ieee80211_smps_mode known_smps_mode; > const struct ieee80211_cipher_scheme *cipher_scheme; > > + struct sta_codel_params cparams; > + > u8 reserved_tid; > > struct cfg80211_chan_def tdls_chandef; > @@ -713,6 +724,7 @@ void sta_set_rate_info_tx(struct sta_info *sta, > void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo); > > u32 sta_get_expected_throughput(struct sta_info *sta); > +void sta_update_codel_params(struct sta_info *sta, u32 thr); > > void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata, > unsigned long exp_time); > diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c > index efc38e7..ec60ac1 100644 > --- a/net/mac80211/tx.c > +++ b/net/mac80211/tx.c > @@ -1342,9 +1342,16 @@ static struct sk_buff *fq_tin_dequeue_func(struct > fq *fq, > > local =3D container_of(fq, struct ieee80211_local, fq); > txqi =3D container_of(tin, struct txq_info, tin); > - cparams =3D &local->cparams; > cstats =3D &local->cstats; > > + if (txqi->txq.sta) { > + struct sta_info *sta =3D container_of(txqi->txq.sta, > + struct sta_info, sta)= ; > + cparams =3D &sta->cparams.params; > + } else { > + cparams =3D &local->cparams; > + } > + > if (flow =3D=3D &txqi->def_flow) > cvars =3D &txqi->def_cvars; > else > -- > 2.9.3 > > base-commit: abc3750c31320f36e230f88b235a90e0a35f7032 > _______________________________________________ > Make-wifi-fast mailing list > Make-wifi-fast@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/make-wifi-fast > --047d7ba97fb27105b9053c2ca2ee Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Sat, Se= p 10, 2016 at 3:33 PM, Toke H=C3=B8iland-J=C3=B8rgensen &= lt;toke@toke.dk> wrote:
CoDel can be too aggressive = if a station sends at a very low rate,
leading to starvation. This gets worse the more stations are present, as each station gets more bursty the longer the round-robin scheduling
between stations takes.

This adds dynamic adjustment of CoDel parameters per station. It uses
the rate selection information to estimate throughput and sets more
lenient CoDel parameters if the estimated throughput is below a
threshold. To not change parameters too often, a hysteresis of two
seconds is added.

=E2=80=8BWhere is this 2 s= econd constant coming from?=C2=A0 I'd expect it should be of order the = maximum RTT (or a small constant factor of that, which for intercontinental= connections should be 200-300ms.

More interesti= ngly, maybe the adjustment should be related to the # of active stations.

Basically, I'm pushing back about an arbitrar= y number apparently picked out of thin air... ;-).
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0- Jim
=E2=80=8B
=C2=A0

A new callback is added that drivers can use to notify mac80211 about
changes in expected throughput, so the same adjustment can be made for
cards that implement rate control in firmware. Drivers that don't use this will just get the default parameters.

The threshold used and the CoDel parameters set for slow stations are
chosen to err on the side of caution. I.e. rather be too lenient than
too aggressive. A better algorithm can then be added later.

Cc: Michal Kazior <michal.kaz= ior@tieto.com>
Cc: Felix Fietkau <nbd@nbd.name><= br> Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen <toke@toke.dk>
---
=C2=A0include/net/mac80211.h=C2=A0 | 17 +++++++++++++++++
=C2=A0net/mac80211/rate.c=C2=A0 =C2=A0 =C2=A0|=C2=A0 2 ++
=C2=A0net/mac80211/sta_info.c | 35 +++++++++++++++++++++++++++++++++++=
=C2=A0net/mac80211/sta_info.h | 12 ++++++++++++
=C2=A0net/mac80211/tx.c=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 9 ++++++++-
=C2=A05 files changed, 74 insertions(+), 1 deletion(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index cca510a..6e0cf85 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4089,6 +4089,23 @@ void ieee80211_get_tx_rates(struct ieee80211_vif *vi= f,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 int max_rates);

=C2=A0/**
+ * ieee80211_sta_set_expected_throughput - set the expected throughpu= t for a
+ * station
+ *
+ * Call this function to notify mac80211 about a change in expected throug= hput
+ * to a station. A driver for a device that does rate control in firmware = can
+ * call this function when the expected throughput estimate towards a stat= ion
+ * changes. The information is used to tune the CoDel AQM applied to traff= ic
+ * going towards that station (which can otherwise be too aggressive and c= ause
+ * slow stations to starve).
+ *
+ * @sta: the station to set throughput for.
+ * @thr: the current expected throughput in kbps.
+ */
+void ieee80211_sta_set_expected_throughput(struct ieee80211_sta *pubs= ta,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 u= 32 thr);
+
+/**
=C2=A0 * ieee80211_tx_status - transmit status callback
=C2=A0 *
=C2=A0 * Call this function for all transmitted frames after they have been=
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index 206698b..5370f5c 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -890,6 +890,8 @@ int rate_control_set_rates(struct ieee80211_hw *hw,

=C2=A0 =C2=A0 =C2=A0 =C2=A0 drv_sta_rate_tbl_update(hw_to_local(hw), s= ta->sdata, pubsta);

+=C2=A0 =C2=A0 =C2=A0 =C2=A0sta_update_codel_params(sta, sta_get_expected_t= hroughput(sta));
+
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;
=C2=A0}
=C2=A0EXPORT_SYMBOL(rate_control_set_rates);
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 19f14c9..6deda4a 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -20,6 +20,7 @@
=C2=A0#include <linux/timer.h>
=C2=A0#include <linux/rtnetlink.h>

+#include <net/codel.h>
=C2=A0#include <net/mac80211.h>
=C2=A0#include "ieee80211_i.h"
=C2=A0#include "driver-ops.h"
@@ -419,6 +420,8 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if= _data *sdata,

=C2=A0 =C2=A0 =C2=A0 =C2=A0 sta->sta.max_rc_amsdu_len =3D IEEE80211_MAX_= MPDU_LEN_HT_BA;

+=C2=A0 =C2=A0 =C2=A0 =C2=A0sta_update_codel_params(sta, 0);
+
=C2=A0 =C2=A0 =C2=A0 =C2=A0 sta_dbg(sdata, "Allocated STA %pM\n",= sta->sta.addr);

=C2=A0 =C2=A0 =C2=A0 =C2=A0 return sta;
@@ -2306,6 +2309,15 @@ u32 sta_get_expected_throughput(struct sta_info= *sta)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return thr;
=C2=A0}

+void ieee80211_sta_set_expected_throughput(struct ieee80211_sta *pubs= ta,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 u= 32 thr)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct sta_info *sta =3D container_of(pubsta, s= truct sta_info, sta);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0sta_update_codel_params(sta, thr);
+}
+EXPORT_SYMBOL(ieee80211_sta_set_expected_throughput);
+
=C2=A0unsigned long ieee80211_sta_last_active(struct sta_info *sta) =C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct ieee80211_sta_rx_stats *stats =3D sta_ge= t_last_rx_stats(sta);
@@ -2314,3 +2326,26 @@ unsigned long ieee80211_sta_last_active(struct = sta_info *sta)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return stats->la= st_rx;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return sta->status_stats.last_ack;
=C2=A0}
+
+void sta_update_codel_params(struct sta_info *sta, u32 thr)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0u64 now =3D ktime_get_ns();
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (!sta->sdata->local->ops->w= ake_tx_queue)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (now - sta->cparams.update_time < STA_= CPARAMS_HYSTERESIS)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (thr && thr < STA_SLOW_THRESHOLD)= {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sta->cparams.par= ams.target =3D MS2TIME(50);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sta->cparams.par= ams.interval =3D MS2TIME(300);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sta->cparams.par= ams.ecn =3D false;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0} else {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sta->cparams.par= ams.target =3D MS2TIME(20);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sta->cparams.par= ams.interval =3D MS2TIME(100);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sta->cparams.par= ams.ecn =3D true;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0sta->cparams.params.ce_threshold =3D CO= DEL_DISABLED_THRESHOLD;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0sta->cparams.update_time =3D now;
+}
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 0556be3..ad088ff 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -384,6 +384,14 @@ struct ieee80211_sta_rx_stats {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 u64 msdu[IEEE80211_NUM_TIDS + 1];
=C2=A0};

+#define STA_CPARAMS_HYSTERESIS (2L * NSEC_PER_SEC)
+#define STA_SLOW_THRESHOLD=C2=A0 =C2=A0 =C2=A08000 /* 8 Mbps */
+
+struct sta_codel_params {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct codel_params params;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0u64 update_time;
+};
+
=C2=A0/**
=C2=A0 * struct sta_info - STA information
=C2=A0 *
@@ -437,6 +445,7 @@ struct ieee80211_sta_rx_stats {
=C2=A0 * @known_smps_mode: the smps_mode the client thinks we are in. Relev= ant for
=C2=A0 *=C2=A0 =C2=A0 =C2=A0AP only.
=C2=A0 * @cipher_scheme: optional cipher scheme for this station
+ * @cparams: CoDel parameters for this station.
=C2=A0 * @reserved_tid: reserved TID (if any, otherwise IEEE80211_TID_UNRES= ERVED)
=C2=A0 * @fast_tx: TX fastpath information
=C2=A0 * @fast_rx: RX fastpath information
@@ -540,6 +549,8 @@ struct sta_info {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 enum ieee80211_smps_mode known_smps_mode;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 const struct ieee80211_cipher_scheme *cipher_sc= heme;

+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct sta_codel_params cparams;
+
=C2=A0 =C2=A0 =C2=A0 =C2=A0 u8 reserved_tid;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct cfg80211_chan_def tdls_chandef;
@@ -713,6 +724,7 @@ void sta_set_rate_info_tx(struct sta_info *sta,
=C2=A0void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo);=

=C2=A0u32 sta_get_expected_throughput(struct sta_info *sta);
+void sta_update_codel_params(struct sta_info *sta, u32 thr);

=C2=A0void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 unsigned long exp_time);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index efc38e7..ec60ac1 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1342,9 +1342,16 @@ static struct sk_buff *fq_tin_dequeue_func(struct fq= *fq,

=C2=A0 =C2=A0 =C2=A0 =C2=A0 local =3D container_of(fq, struct ieee80211_loc= al, fq);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 txqi =3D container_of(tin, struct txq_info, tin= );
-=C2=A0 =C2=A0 =C2=A0 =C2=A0cparams =3D &local->cparams;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cstats =3D &local->cstats;

+=C2=A0 =C2=A0 =C2=A0 =C2=A0if (txqi->txq.sta) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct sta_info *st= a =3D container_of(txqi->txq.sta,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct sta_info, sta);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cparams =3D &st= a->cparams.params;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0} else {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cparams =3D &lo= cal->cparams;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (flow =3D=3D &txqi->def_flow)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cvars =3D &txqi= ->def_cvars;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else
--
2.9.3

base-commit: abc3750c31320f36e230f88b235a90e0a35f7032
_______________________________________________
Make-wifi-fast mailing list
Make-wifi-fast@list= s.bufferbloat.net
https://lists.bufferbloat.net/listinfo/mak= e-wifi-fast

--047d7ba97fb27105b9053c2ca2ee--