diff options
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r-- | include/net/sch_generic.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index a7abfda3e447..e5569625d2a5 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -27,6 +27,7 @@ enum qdisc_state_t | |||
27 | { | 27 | { |
28 | __QDISC_STATE_RUNNING, | 28 | __QDISC_STATE_RUNNING, |
29 | __QDISC_STATE_SCHED, | 29 | __QDISC_STATE_SCHED, |
30 | __QDISC_STATE_DEACTIVATED, | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | struct qdisc_size_table { | 33 | struct qdisc_size_table { |
@@ -60,7 +61,6 @@ struct Qdisc | |||
60 | struct gnet_stats_basic bstats; | 61 | struct gnet_stats_basic bstats; |
61 | struct gnet_stats_queue qstats; | 62 | struct gnet_stats_queue qstats; |
62 | struct gnet_stats_rate_est rate_est; | 63 | struct gnet_stats_rate_est rate_est; |
63 | struct rcu_head q_rcu; | ||
64 | int (*reshape_fail)(struct sk_buff *skb, | 64 | int (*reshape_fail)(struct sk_buff *skb, |
65 | struct Qdisc *q); | 65 | struct Qdisc *q); |
66 | 66 | ||
@@ -193,6 +193,11 @@ static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc) | |||
193 | return qdisc->dev_queue->qdisc; | 193 | return qdisc->dev_queue->qdisc; |
194 | } | 194 | } |
195 | 195 | ||
196 | static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc) | ||
197 | { | ||
198 | return qdisc->dev_queue->qdisc_sleeping; | ||
199 | } | ||
200 | |||
196 | /* The qdisc root lock is a mechanism by which to top level | 201 | /* The qdisc root lock is a mechanism by which to top level |
197 | * of a qdisc tree can be locked from any qdisc node in the | 202 | * of a qdisc tree can be locked from any qdisc node in the |
198 | * forest. This allows changing the configuration of some | 203 | * forest. This allows changing the configuration of some |
@@ -212,6 +217,14 @@ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) | |||
212 | return qdisc_lock(root); | 217 | return qdisc_lock(root); |
213 | } | 218 | } |
214 | 219 | ||
220 | static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc) | ||
221 | { | ||
222 | struct Qdisc *root = qdisc_root_sleeping(qdisc); | ||
223 | |||
224 | ASSERT_RTNL(); | ||
225 | return qdisc_lock(root); | ||
226 | } | ||
227 | |||
215 | static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) | 228 | static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) |
216 | { | 229 | { |
217 | return qdisc->dev_queue->dev; | 230 | return qdisc->dev_queue->dev; |
@@ -219,12 +232,12 @@ static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) | |||
219 | 232 | ||
220 | static inline void sch_tree_lock(struct Qdisc *q) | 233 | static inline void sch_tree_lock(struct Qdisc *q) |
221 | { | 234 | { |
222 | spin_lock_bh(qdisc_root_lock(q)); | 235 | spin_lock_bh(qdisc_root_sleeping_lock(q)); |
223 | } | 236 | } |
224 | 237 | ||
225 | static inline void sch_tree_unlock(struct Qdisc *q) | 238 | static inline void sch_tree_unlock(struct Qdisc *q) |
226 | { | 239 | { |
227 | spin_unlock_bh(qdisc_root_lock(q)); | 240 | spin_unlock_bh(qdisc_root_sleeping_lock(q)); |
228 | } | 241 | } |
229 | 242 | ||
230 | #define tcf_tree_lock(tp) sch_tree_lock((tp)->q) | 243 | #define tcf_tree_lock(tp) sch_tree_lock((tp)->q) |