Skip to content

Commit

Permalink
taprio: Use taprio_reset_tc() to reset Traffic Classes configuration
Browse files Browse the repository at this point in the history
When destroying the current taprio instance, which can happen when the
creation of one fails, we should reset the traffic class configuration
back to the default state.

netdev_reset_tc() is a better way because in addition to setting the
number of traffic classes to zero, it also resets the priority to
traffic classes mapping to the default value.

Fixes: 5a781cc ("tc: Add support for configuring the taprio scheduler")
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vinicius Costa Gomes authored and David S. Miller committed Feb 7, 2020
1 parent 49c684d commit 7c16680
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_taprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@ static void taprio_destroy(struct Qdisc *sch)
}
q->qdiscs = NULL;

netdev_set_num_tc(dev, 0);
netdev_reset_tc(dev);

if (q->oper_sched)
call_rcu(&q->oper_sched->rcu, taprio_free_sched_cb);
Expand Down

0 comments on commit 7c16680

Please sign in to comment.