diff options
author | stephen hemminger <shemminger@vyatta.com> | 2010-05-14 10:38:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-17 20:44:35 -0400 |
commit | f0cd15081a72075df16c45a2310e873fb9fcd82f (patch) | |
tree | 88e462778635cb4e285315f144b62276bdcff6df /net/sched/sch_tbf.c | |
parent | ccbd6a5a4f76e821ed36f69fdaf59817c3a7f18e (diff) |
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/sch_tbf.c')
-rw-r--r-- | net/sched/sch_tbf.c | 6 |
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) | |||
273 | if (max_size < 0) | 273 | if (max_size < 0) |
274 | goto done; | 274 | goto done; |
275 | 275 | ||
276 | if (qopt->limit > 0) { | 276 | if (q->qdisc != &noop_qdisc) { |
277 | err = fifo_set_limit(q->qdisc, qopt->limit); | ||
278 | if (err) | ||
279 | goto done; | ||
280 | } else if (qopt->limit > 0) { | ||
277 | child = fifo_create_dflt(sch, &bfifo_qdisc_ops, qopt->limit); | 281 | child = fifo_create_dflt(sch, &bfifo_qdisc_ops, qopt->limit); |
278 | if (IS_ERR(child)) { | 282 | if (IS_ERR(child)) { |
279 | err = PTR_ERR(child); | 283 | err = PTR_ERR(child); |