summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-05-14 16:38:59 +0200
committerDavid S. Miller <davem@davemloft.net>2010-05-18 02:44:35 +0200
commitf0cd15081a72075df16c45a2310e873fb9fcd82f (patch)
tree88e462778635cb4e285315f144b62276bdcff6df /net/sched
parentnet: Remove unnecessary semicolons after switch statements (diff)
downloadlinux-f0cd15081a72075df16c45a2310e873fb9fcd82f.tar.xz
linux-f0cd15081a72075df16c45a2310e873fb9fcd82f.zip
tbf: stop wanton destruction of children (v2)
Several netem users use TBF for rate control. But every time the parameters of TBF are changed it destroys the child qdisc, requiring reconfigation. Better to just keep child qdisc and just notify it of changed limit. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_tbf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 8fb8107ab188..0991c640cd3e 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -273,7 +273,11 @@ static int tbf_change(struct Qdisc* sch, struct nlattr *opt)
if (max_size < 0)
goto done;
- if (qopt->limit > 0) {
+ if (q->qdisc != &noop_qdisc) {
+ err = fifo_set_limit(q->qdisc, qopt->limit);
+ if (err)
+ goto done;
+ } else if (qopt->limit > 0) {
child = fifo_create_dflt(sch, &bfifo_qdisc_ops, qopt->limit);
if (IS_ERR(child)) {
err = PTR_ERR(child);