* [Cerowrt-devel] Fwd: [PATCH net-next] net_sched: restore "mpu xxx" handling
[not found] <20220107202249.3812322-1-kevin@bracey.fi>
@ 2022-01-12 23:08 ` Dave Taht
2022-01-12 23:25 ` Sebastian Moeller
0 siblings, 1 reply; 2+ messages in thread
From: Dave Taht @ 2022-01-12 23:08 UTC (permalink / raw)
To: cerowrt-devel, Cake List
this has been broken this long??
---------- Forwarded message ---------
From: Kevin Bracey <kevin@bracey.fi>
Date: Fri, Jan 7, 2022 at 4:56 PM
Subject: [PATCH net-next] net_sched: restore "mpu xxx" handling
To: <netdev@vger.kernel.org>
Cc: Kevin Bracey <kevin@bracey.fi>, Eric Dumazet
<edumazet@google.com>, Jiri Pirko <jiri@resnulli.us>, Vimalkumar
<j.vimal@gmail.com>
commit 56b765b79e9a ("htb: improved accuracy at high rates") broke
"overhead X", "linklayer atm" and "mpu X" attributes.
"overhead X" and "linklayer atm" have already been fixed. This restores
the "mpu X" handling, as might be used by DOCSIS or Ethernet shaping:
tc class add ... htb rate X overhead 4 mpu 64
The code being fixed is used by htb, tbf and act_police. Cake has its
own mpu handling. qdisc_calculate_pkt_len still uses the size table
containing values adjusted for mpu by user space.
Fixes: 56b765b79e9a ("htb: improved accuracy at high rates")
Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: Vimalkumar <j.vimal@gmail.com>
---
include/net/sch_generic.h | 5 +++++
net/sched/sch_generic.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index c70e6d2b2fdd..fddca0aa73ef 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -1244,6 +1244,7 @@ struct psched_ratecfg {
u64 rate_bytes_ps; /* bytes per second */
u32 mult;
u16 overhead;
+ u16 mpu;
u8 linklayer;
u8 shift;
};
@@ -1253,6 +1254,9 @@ static inline u64 psched_l2t_ns(const struct
psched_ratecfg *r,
{
len += r->overhead;
+ if (len < r->mpu)
+ len = r->mpu;
+
if (unlikely(r->linklayer == TC_LINKLAYER_ATM))
return ((u64)(DIV_ROUND_UP(len,48)*53) * r->mult) >> r->shift;
@@ -1275,6 +1279,7 @@ static inline void psched_ratecfg_getrate(struct
tc_ratespec *res,
res->rate = min_t(u64, r->rate_bytes_ps, ~0U);
res->overhead = r->overhead;
+ res->mpu = r->mpu;
res->linklayer = (r->linklayer & TC_LINKLAYER_MASK);
}
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 3b0f62095803..5d391fe3137d 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -1474,6 +1474,7 @@ void psched_ratecfg_precompute(struct psched_ratecfg *r,
{
memset(r, 0, sizeof(*r));
r->overhead = conf->overhead;
+ r->mpu = conf->mpu;
r->rate_bytes_ps = max_t(u64, conf->rate, rate64);
r->linklayer = (conf->linklayer & TC_LINKLAYER_MASK);
psched_ratecfg_precompute__(r->rate_bytes_ps, &r->mult, &r->shift);
--
2.25.1
--
I tried to build a better future, a few times:
https://wayforward.archive.org/?site=https%3A%2F%2Fwww.icei.org
Dave Täht CEO, TekLibre, LLC
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Cerowrt-devel] Fwd: [PATCH net-next] net_sched: restore "mpu xxx" handling
2022-01-12 23:08 ` [Cerowrt-devel] Fwd: [PATCH net-next] net_sched: restore "mpu xxx" handling Dave Taht
@ 2022-01-12 23:25 ` Sebastian Moeller
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Moeller @ 2022-01-12 23:25 UTC (permalink / raw)
To: cerowrt-devel, Dave Taht, cerowrt-devel, Cake List
[-- Attachment #1: Type: text/plain, Size: 3726 bytes --]
No idea, sqm-scripts long had supported htb's linklayer accounting but defaulted to using tc stab instead, and mainly for htb+fq_codel, for cake it defaulted to cake's internal accounting.
I have no recollection when I last tested that, probably when I was still on an ADSL link without a relevant mpu....
Regards
Sebastian
On 13 January 2022 00:08:10 CET, Dave Taht <dave.taht@gmail.com> wrote:
>this has been broken this long??
>
>---------- Forwarded message ---------
>From: Kevin Bracey <kevin@bracey.fi>
>Date: Fri, Jan 7, 2022 at 4:56 PM
>Subject: [PATCH net-next] net_sched: restore "mpu xxx" handling
>To: <netdev@vger.kernel.org>
>Cc: Kevin Bracey <kevin@bracey.fi>, Eric Dumazet
><edumazet@google.com>, Jiri Pirko <jiri@resnulli.us>, Vimalkumar
><j.vimal@gmail.com>
>
>
>commit 56b765b79e9a ("htb: improved accuracy at high rates") broke
>"overhead X", "linklayer atm" and "mpu X" attributes.
>
>"overhead X" and "linklayer atm" have already been fixed. This restores
>the "mpu X" handling, as might be used by DOCSIS or Ethernet shaping:
>
> tc class add ... htb rate X overhead 4 mpu 64
>
>The code being fixed is used by htb, tbf and act_police. Cake has its
>own mpu handling. qdisc_calculate_pkt_len still uses the size table
>containing values adjusted for mpu by user space.
>
>Fixes: 56b765b79e9a ("htb: improved accuracy at high rates")
>Signed-off-by: Kevin Bracey <kevin@bracey.fi>
>Cc: Eric Dumazet <edumazet@google.com>
>Cc: Jiri Pirko <jiri@resnulli.us>
>Cc: Vimalkumar <j.vimal@gmail.com>
>---
> include/net/sch_generic.h | 5 +++++
> net/sched/sch_generic.c | 1 +
> 2 files changed, 6 insertions(+)
>
>diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
>index c70e6d2b2fdd..fddca0aa73ef 100644
>--- a/include/net/sch_generic.h
>+++ b/include/net/sch_generic.h
>@@ -1244,6 +1244,7 @@ struct psched_ratecfg {
> u64 rate_bytes_ps; /* bytes per second */
> u32 mult;
> u16 overhead;
>+ u16 mpu;
> u8 linklayer;
> u8 shift;
> };
>@@ -1253,6 +1254,9 @@ static inline u64 psched_l2t_ns(const struct
>psched_ratecfg *r,
> {
> len += r->overhead;
>
>+ if (len < r->mpu)
>+ len = r->mpu;
>+
> if (unlikely(r->linklayer == TC_LINKLAYER_ATM))
> return ((u64)(DIV_ROUND_UP(len,48)*53) * r->mult) >> r->shift;
>
>@@ -1275,6 +1279,7 @@ static inline void psched_ratecfg_getrate(struct
>tc_ratespec *res,
> res->rate = min_t(u64, r->rate_bytes_ps, ~0U);
>
> res->overhead = r->overhead;
>+ res->mpu = r->mpu;
> res->linklayer = (r->linklayer & TC_LINKLAYER_MASK);
> }
>
>diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
>index 3b0f62095803..5d391fe3137d 100644
>--- a/net/sched/sch_generic.c
>+++ b/net/sched/sch_generic.c
>@@ -1474,6 +1474,7 @@ void psched_ratecfg_precompute(struct psched_ratecfg *r,
> {
> memset(r, 0, sizeof(*r));
> r->overhead = conf->overhead;
>+ r->mpu = conf->mpu;
> r->rate_bytes_ps = max_t(u64, conf->rate, rate64);
> r->linklayer = (conf->linklayer & TC_LINKLAYER_MASK);
> psched_ratecfg_precompute__(r->rate_bytes_ps, &r->mult, &r->shift);
>--
>2.25.1
>
>
>
>--
>I tried to build a better future, a few times:
>https://wayforward.archive.org/?site=https%3A%2F%2Fwww.icei.org
>
>Dave Täht CEO, TekLibre, LLC
>_______________________________________________
>Cerowrt-devel mailing list
>Cerowrt-devel@lists.bufferbloat.net
>https://lists.bufferbloat.net/listinfo/cerowrt-devel
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
[-- Attachment #2: Type: text/html, Size: 4451 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-12 23:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20220107202249.3812322-1-kevin@bracey.fi>
2022-01-12 23:08 ` [Cerowrt-devel] Fwd: [PATCH net-next] net_sched: restore "mpu xxx" handling Dave Taht
2022-01-12 23:25 ` Sebastian Moeller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox