Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108811
b: refs/heads/master
c: a9312ae
h: refs/heads/master
i:
  108809: 988affb
  108807: 99f11bd
v: v3
  • Loading branch information
David S. Miller committed Aug 18, 2008
1 parent 8083e6d commit d6f4fda
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08013fa353fdcfc0a03cae805393abfc56722387
refs/heads/master: a9312ae89324438b0edc554eb36c3ec6bf927d04
1 change: 1 addition & 0 deletions trunk/include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum qdisc_state_t
{
__QDISC_STATE_RUNNING,
__QDISC_STATE_SCHED,
__QDISC_STATE_DEACTIVATED,
};

struct qdisc_size_table {
Expand Down
9 changes: 8 additions & 1 deletion trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,12 @@ int dev_queue_xmit(struct sk_buff *skb)

spin_lock(root_lock);

if (unlikely(test_bit(__QDISC_STATE_DEACTIVATED, &q->state))) {
spin_unlock(root_lock);
rc = NET_XMIT_DROP;
goto out_kfree_skb;
}

rc = qdisc_enqueue_root(skb, q);
qdisc_run(q);

Expand Down Expand Up @@ -2084,7 +2090,8 @@ static int ing_filter(struct sk_buff *skb)
q = rxq->qdisc;
if (q != &noop_qdisc) {
spin_lock(qdisc_lock(q));
result = qdisc_enqueue_root(skb, q);
if (likely(!test_bit(__QDISC_STATE_DEACTIVATED, &q->state)))
result = qdisc_enqueue_root(skb, q);
spin_unlock(qdisc_lock(q));
}

Expand Down
6 changes: 6 additions & 0 deletions trunk/net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,9 @@ static void transition_one_qdisc(struct net_device *dev,
struct Qdisc *new_qdisc = dev_queue->qdisc_sleeping;
int *need_watchdog_p = _need_watchdog;

if (!(new_qdisc->flags & TCQ_F_BUILTIN))
clear_bit(__QDISC_STATE_DEACTIVATED, &new_qdisc->state);

rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
if (need_watchdog_p && new_qdisc != &noqueue_qdisc)
*need_watchdog_p = 1;
Expand Down Expand Up @@ -640,6 +643,9 @@ static void dev_deactivate_queue(struct net_device *dev,
if (qdisc) {
spin_lock_bh(qdisc_lock(qdisc));

if (!(qdisc->flags & TCQ_F_BUILTIN))
set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state);

dev_queue->qdisc = qdisc_default;
qdisc_reset(qdisc);

Expand Down

0 comments on commit d6f4fda

Please sign in to comment.