From: Patrick McHardy <kaber@trash.net>
To: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] hfsc: add link layer overhead adaption
Date: Mon, 23 Jun 2008 12:57:54 +0200 [thread overview]
Message-ID: <485F81B2.7000107@trash.net> (raw)
In-Reply-To: <20080623102514.15821.13979.stgit@fate.lan>
Jussi Kivilinna wrote:
> CBQ and HTB have options for emulating overhead of underlying link layer
> (mpu/overhead/linklayer options). This patch makes sch_hfsc use rate table
> to emulate link layer overhead.
>
> Patch uses rate table to convert packet length to emulated link layer packet
> length using qdisc_l2t() in get_linklayer_len(). Converted packet length is
> passed to hfsc calculations instead of real. If rate table isn't passed to
> kernel, hfsc works as before.
>
> diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
> index fdfaa3f..94fd130 100644
> --- a/net/sched/sch_hfsc.c
> +++ b/net/sched/sch_hfsc.c
> +/* convert packet length to link layer packet length */
> +static unsigned int get_linklayer_len(struct hfsc_class *cl, unsigned int len)
> +{
> + u64 ll_len;
> + if (likely(len) && unlikely(cl->rtab)) {
> + ll_len = qdisc_l2t(cl->rtab, len);
> + if (unlikely(cl->rtab->rate.rate != PSCHED_TICKS_PER_SEC))
> + ll_len = div_u64(ll_len * cl->rtab->rate.rate,
> + PSCHED_TICKS_PER_SEC);
> + return (unsigned int)ll_len;
> + }
> + return len;
> +}
This looks like an abuse of rate tables, which usually convert
packet sizes to transmission times. You undo that above using
expensive calculations.
I think this should be done by performing the length calculation
in the kernel directly.
next prev parent reply other threads:[~2008-06-23 10:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 10:25 [PATCH] hfsc: add link layer overhead adaption Jussi Kivilinna
2008-06-23 10:57 ` Patrick McHardy [this message]
2008-06-23 11:24 ` Jussi Kivilinna
2008-06-23 11:27 ` Patrick McHardy
2008-06-23 19:15 ` Jussi Kivilinna
2008-06-23 19:37 ` Patrick McHardy
2008-06-23 22:29 ` Jussi Kivilinna
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=485F81B2.7000107@trash.net \
--to=kaber@trash.net \
--cc=jussi.kivilinna@mbnet.fi \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.