diff options
-rw-r--r-- | include/net/sch_generic.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index b5f40d7ef724..c5bb13065051 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -193,10 +193,22 @@ 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 | /* 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 | ||
198 | * forest. This allows changing the configuration of some | ||
199 | * aspect of the qdisc tree while blocking out asynchronous | ||
200 | * qdisc access in the packet processing paths. | ||
201 | * | ||
202 | * It is only legal to do this when the root will not change | ||
203 | * on us. Otherwise we'll potentially lock the wrong qdisc | ||
204 | * root. This is enforced by holding the RTNL semaphore, which | ||
205 | * all users of this lock accessor must do. | ||
206 | */ | ||
196 | static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) | 207 | static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) |
197 | { | 208 | { |
198 | struct Qdisc *root = qdisc_root(qdisc); | 209 | struct Qdisc *root = qdisc_root(qdisc); |
199 | 210 | ||
211 | ASSERT_RTNL(); | ||
200 | return qdisc_lock(root); | 212 | return qdisc_lock(root); |
201 | } | 213 | } |
202 | 214 | ||