From: stephen hemminger Date: Fri, 14 May 2010 14:38:59 +0000 (+0000) Subject: tbf: stop wanton destruction of children (v2) X-Git-Tag: v2.6.35-rc1~473^2~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f0cd15081a72075df16c45a2310e873fb9fcd82f;p=platform%2Fkernel%2Flinux-3.10.git 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 Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 8fb8107..0991c64 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);