Commit 1e0d5a57 authored by David S. Miller's avatar David S. Miller

pkt_sched: No longer destroy qdiscs from RCU.

We can now kill them synchronously with all of the
previous dev_deactivate() cures.

This makes netdev destruction and shutdown saner as
the qdiscs hold references to the device.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3a76e371
...@@ -61,7 +61,6 @@ struct Qdisc ...@@ -61,7 +61,6 @@ struct Qdisc
struct gnet_stats_basic bstats; struct gnet_stats_basic bstats;
struct gnet_stats_queue qstats; struct gnet_stats_queue qstats;
struct gnet_stats_rate_est rate_est; struct gnet_stats_rate_est rate_est;
struct rcu_head q_rcu;
int (*reshape_fail)(struct sk_buff *skb, int (*reshape_fail)(struct sk_buff *skb,
struct Qdisc *q); struct Qdisc *q);
......
...@@ -518,14 +518,19 @@ void qdisc_reset(struct Qdisc *qdisc) ...@@ -518,14 +518,19 @@ void qdisc_reset(struct Qdisc *qdisc)
} }
EXPORT_SYMBOL(qdisc_reset); EXPORT_SYMBOL(qdisc_reset);
/* this is the rcu callback function to clean up a qdisc when there /* Under qdisc_lock(qdisc) and BH! */
* are no further references to it */
static void __qdisc_destroy(struct rcu_head *head) void qdisc_destroy(struct Qdisc *qdisc)
{ {
struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu);
const struct Qdisc_ops *ops = qdisc->ops; const struct Qdisc_ops *ops = qdisc->ops;
if (qdisc->flags & TCQ_F_BUILTIN ||
!atomic_dec_and_test(&qdisc->refcnt))
return;
if (qdisc->parent)
list_del(&qdisc->list);
#ifdef CONFIG_NET_SCHED #ifdef CONFIG_NET_SCHED
qdisc_put_stab(qdisc->stab); qdisc_put_stab(qdisc->stab);
#endif #endif
...@@ -542,20 +547,6 @@ static void __qdisc_destroy(struct rcu_head *head) ...@@ -542,20 +547,6 @@ static void __qdisc_destroy(struct rcu_head *head)
kfree((char *) qdisc - qdisc->padded); kfree((char *) qdisc - qdisc->padded);
} }
/* Under qdisc_lock(qdisc) and BH! */
void qdisc_destroy(struct Qdisc *qdisc)
{
if (qdisc->flags & TCQ_F_BUILTIN ||
!atomic_dec_and_test(&qdisc->refcnt))
return;
if (qdisc->parent)
list_del(&qdisc->list);
call_rcu(&qdisc->q_rcu, __qdisc_destroy);
}
EXPORT_SYMBOL(qdisc_destroy); EXPORT_SYMBOL(qdisc_destroy);
static bool dev_all_qdisc_sleeping_noop(struct net_device *dev) static bool dev_all_qdisc_sleeping_noop(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment