From: Jarek Poplawski <jarkao2@gmail.com>
To: Denys Fedoryschenko <denys@visp.net.lb>
Cc: netdev@vger.kernel.org
Subject: [PATCH] Re: iproute2 / tbf with large burst seems broken again
Date: Wed, 26 Aug 2009 23:59:56 +0200 [thread overview]
Message-ID: <20090826215956.GA5148@ami.dom.local> (raw)
In-Reply-To: <200908251518.00762.denys@visp.net.lb>
Denys Fedoryschenko wrote, On 08/25/2009 02:18 PM:
...
> Just maybe good idea in next kernels to document this or handle overflow, that
> it will give warning in kernel. Otherwise user will have non-functional qdisc
> that will not pass traffic.
OK, if this patch works for you send your Tested-by, please.
Thanks,
Jarek P.
---------------->
pkt_sched: Warn on tokens overflow in tbf_dequeue
After recent change of scheduling resolution some "extreme" configs
can cause token overflows with stalls. This patch warns when tokens
were negative before accounting for a packet length.
Reported-by: Denys Fedoryschenko <denys@visp.net.lb>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
---
net/sched/sch_tbf.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index e22dfe8..ef191c4 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -191,6 +191,12 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch)
return skb;
}
+ if (unlikely((long)(toks + L2T(q, len)) < 0 ||
+ (long)(ptoks + L2T_P(q, len) < 0)))
+ if (net_ratelimit())
+ pr_warning("tbf: tokens overflow;"
+ " fix limits.\n");
+
qdisc_watchdog_schedule(&q->watchdog,
now + max_t(long, -toks, -ptoks));
next prev parent reply other threads:[~2009-08-26 22:00 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-24 23:37 iproute2 / tbf with large burst seems broken again Denys Fedoryschenko
2009-08-25 6:22 ` Jarek Poplawski
2009-08-25 7:34 ` Denys Fedoryschenko
2009-08-25 8:43 ` Jarek Poplawski
2009-08-25 9:00 ` Jarek Poplawski
2009-08-25 9:41 ` Jarek Poplawski
2009-08-25 10:29 ` Denys Fedoryschenko
2009-08-25 11:16 ` Denys Fedoryschenko
2009-08-25 12:13 ` Jarek Poplawski
2009-08-25 12:18 ` Denys Fedoryschenko
2009-08-26 21:59 ` Jarek Poplawski [this message]
2009-08-31 5:05 ` [PATCH] " David Miller
2009-08-31 5:30 ` Jarek Poplawski
2009-08-31 5:32 ` David Miller
2009-08-31 8:03 ` Denys Fedoryschenko
2009-08-31 8:18 ` Denys Fedoryschenko
2009-08-31 8:37 ` David Miller
2009-08-31 8:51 ` Denys Fedoryschenko
2009-08-31 9:05 ` Jarek Poplawski
2009-08-31 8:58 ` Jarek Poplawski
2009-09-01 22:51 ` David Miller
2009-08-31 8:49 ` Jarek Poplawski
2009-08-25 20:03 ` Jarek Poplawski
2009-08-26 19:03 ` Jarek Poplawski
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=20090826215956.GA5148@ami.dom.local \
--to=jarkao2@gmail.com \
--cc=denys@visp.net.lb \
--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 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).