From: Eric Dumazet Date: Fri, 4 May 2012 04:37:21 +0000 (+0000) Subject: net: sched: factorize code (qdisc_drop()) X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=17045755193a93fbd2d97db9aad5e726fc8c2a6d;p=openwrt%2Fstaging%2Fblogic.git net: sched: factorize code (qdisc_drop()) Use qdisc_drop() helper where possible. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c index 81445cc8196f..cc37dd52ecf9 100644 --- a/net/sched/sch_choke.c +++ b/net/sched/sch_choke.c @@ -332,15 +332,13 @@ static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch) } q->stats.pdrop++; - sch->qstats.drops++; - kfree_skb(skb); - return NET_XMIT_DROP; + return qdisc_drop(skb, sch); - congestion_drop: +congestion_drop: qdisc_drop(skb, sch); return NET_XMIT_CN; - other_drop: +other_drop: if (ret & __NET_XMIT_BYPASS) sch->qstats.drops++; kfree_skb(skb); diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 389b856c6653..3886365cc207 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c @@ -265,8 +265,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) return NET_XMIT_SUCCESS; drop: - kfree_skb(skb); - sch->qstats.drops++; + qdisc_drop(skb, sch); return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; } diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 2ea6f196e3c8..acae5b0e3849 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -558,9 +558,7 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch) __skb_queue_tail(&q->direct_queue, skb); q->direct_pkts++; } else { - kfree_skb(skb); - sch->qstats.drops++; - return NET_XMIT_DROP; + return qdisc_drop(skb, sch); } #ifdef CONFIG_NET_CLS_ACT } else if (!cl) { diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 45326599fda3..ca0c29695d51 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c @@ -88,9 +88,7 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc *sch) return NET_XMIT_SUCCESS; } - kfree_skb(skb); - sch->qstats.drops++; - return NET_XMIT_DROP; + return qdisc_drop(skb, sch); } static struct sk_buff *