Skip to content

Commit

Permalink
sch_choke: drop all packets in queue during reset
Browse files Browse the repository at this point in the history
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
WANG Cong authored and David S. Miller committed Jul 25, 2015
1 parent fe6bea7 commit 77e62da
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions net/sched/sch_choke.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,19 @@ static void choke_reset(struct Qdisc *sch)
{
struct choke_sched_data *q = qdisc_priv(sch);

while (q->head != q->tail) {
struct sk_buff *skb = q->tab[q->head];

q->head = (q->head + 1) & q->tab_mask;
if (!skb)
continue;
qdisc_qstats_backlog_dec(sch, skb);
--sch->q.qlen;
qdisc_drop(skb, sch);
}

memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *));
q->head = q->tail = 0;
red_restart(&q->vars);
}

Expand Down

0 comments on commit 77e62da

Please sign in to comment.