Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

taprio: Use taprio_reset_tc() to reset Traffic Classes configuration

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: 5a781ccbd19e ("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>

authored by

Vinicius Costa Gomes and committed by
David S. Miller
7c16680a 49c684d7

+1 -1
+1 -1
net/sched/sch_taprio.c
··· 1588 1588 } 1589 1589 q->qdiscs = NULL; 1590 1590 1591 - netdev_set_num_tc(dev, 0); 1591 + netdev_reset_tc(dev); 1592 1592 1593 1593 if (q->oper_sched) 1594 1594 call_rcu(&q->oper_sched->rcu, taprio_free_sched_cb);