blob: f60f056af879250c98b05d5bfd819ea0b20a9e58 [file] [log] [blame]
From 3c0b1d78552a7377151f26f72af08fd69414892d Mon Sep 17 00:00:00 2001
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Date: Thu, 6 Feb 2020 13:46:09 -0800
Subject: [PATCH] taprio: Use taprio_reset_tc() to reset Traffic Classes
configuration
commit 7c16680a08ee1e444a67d232c679ccf5b30fad16 upstream.
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>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index 49c5379696d8..2ef34b7b4874 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -901,7 +901,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);
--
2.7.4