mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 08:10:54 +07:00
sch_mqprio: Always set num_tc to 0 in mqprio_destroy()
All the cleanup code in mqprio_destroy() is currently conditional on priv->qdiscs being non-null, but that condition should only apply to the per-queue qdisc cleanup. We should always set the number of traffic classes back to 0 here. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
This commit is contained in:
parent
263fb5b1bf
commit
ac7100ba93
@ -29,18 +29,18 @@ static void mqprio_destroy(struct Qdisc *sch)
|
|||||||
struct mqprio_sched *priv = qdisc_priv(sch);
|
struct mqprio_sched *priv = qdisc_priv(sch);
|
||||||
unsigned int ntx;
|
unsigned int ntx;
|
||||||
|
|
||||||
if (!priv->qdiscs)
|
if (priv->qdiscs) {
|
||||||
return;
|
for (ntx = 0;
|
||||||
|
ntx < dev->num_tx_queues && priv->qdiscs[ntx];
|
||||||
for (ntx = 0; ntx < dev->num_tx_queues && priv->qdiscs[ntx]; ntx++)
|
ntx++)
|
||||||
qdisc_destroy(priv->qdiscs[ntx]);
|
qdisc_destroy(priv->qdiscs[ntx]);
|
||||||
|
kfree(priv->qdiscs);
|
||||||
|
}
|
||||||
|
|
||||||
if (priv->hw_owned && dev->netdev_ops->ndo_setup_tc)
|
if (priv->hw_owned && dev->netdev_ops->ndo_setup_tc)
|
||||||
dev->netdev_ops->ndo_setup_tc(dev, 0);
|
dev->netdev_ops->ndo_setup_tc(dev, 0);
|
||||||
else
|
else
|
||||||
netdev_set_num_tc(dev, 0);
|
netdev_set_num_tc(dev, 0);
|
||||||
|
|
||||||
kfree(priv->qdiscs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mqprio_parse_opt(struct net_device *dev, struct tc_mqprio_qopt *qopt)
|
static int mqprio_parse_opt(struct net_device *dev, struct tc_mqprio_qopt *qopt)
|
||||||
|
Loading…
Reference in New Issue
Block a user