netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net_sched: increase drop count when packets are dropped
@ 2014-05-13  9:42 Yang Yingliang
  2014-05-13 13:49 ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Yang Yingliang @ 2014-05-13  9:42 UTC (permalink / raw)
  To: netdev; +Cc: eric.dumazet, vtlam, nanditad, davem

When packets are dropped because of overlimit, the drop count
should be increased. Replace kfree_skb() with qdisc_drop() for
increasing drop count.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 net/sched/sch_fq.c       | 2 +-
 net/sched/sch_fq_codel.c | 3 ++-
 net/sched/sch_hhf.c      | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index 23c682b42f99..958ef7d4b825 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -714,7 +714,7 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt)
 
 		if (!skb)
 			break;
-		kfree_skb(skb);
+		qdisc_drop(skb, sch);
 		drop_count++;
 	}
 	qdisc_tree_decrease_qlen(sch, drop_count);
diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 0bf432c782c1..bcfe4594470f 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -344,7 +344,8 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt)
 	while (sch->q.qlen > sch->limit) {
 		struct sk_buff *skb = fq_codel_dequeue(sch);
 
-		kfree_skb(skb);
+		qdisc_drop(skb, sch);
+		q->drop_overlimit++;
 		q->cstats.drop_count++;
 	}
 	qdisc_tree_decrease_qlen(sch, q->cstats.drop_count);
diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c
index 6aab8619bbb0..71542d2cecac 100644
--- a/net/sched/sch_hhf.c
+++ b/net/sched/sch_hhf.c
@@ -593,7 +593,8 @@ static int hhf_change(struct Qdisc *sch, struct nlattr *opt)
 	while (sch->q.qlen > sch->limit) {
 		struct sk_buff *skb = hhf_dequeue(sch);
 
-		kfree_skb(skb);
+		qdisc_drop(skb, sch);
+		q->drop_overlimit++;
 	}
 	qdisc_tree_decrease_qlen(sch, qlen - sch->q.qlen);
 
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-19  8:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-13  9:42 [PATCH net-next] net_sched: increase drop count when packets are dropped Yang Yingliang
2014-05-13 13:49 ` Eric Dumazet
2014-05-16  9:07   ` Yang Yingliang
2014-05-16 13:22     ` Eric Dumazet
2014-05-19  8:25       ` Yang Yingliang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).