Commit f0cd1508 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller
Browse files

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: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ccbd6a5a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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);