summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorWANG Cong2015-07-22 01:52:43 +0200
committerDavid S. Miller2015-07-25 07:57:15 +0200
commit77e62da6e60c7772971f813f588d372a7f1a4167 (patch)
treecc71925da87ac5f6a2ad3d2d379952e3dd85de41 /net/sched
parentsch_plug: purge buffered packets during reset (diff)
downloadkernel-qcow2-linux-77e62da6e60c7772971f813f588d372a7f1a4167.tar.gz
kernel-qcow2-linux-77e62da6e60c7772971f813f588d372a7f1a4167.tar.xz
kernel-qcow2-linux-77e62da6e60c7772971f813f588d372a7f1a4167.zip
sch_choke: drop all packets in queue during reset
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_choke.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index 93d5742dc7e0..6a783afe4960 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -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);
}