Commit 17045755 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: sched: factorize code (qdisc_drop())

Use qdisc_drop() helper where possible.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 041441d0
...@@ -332,15 +332,13 @@ static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -332,15 +332,13 @@ static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch)
} }
q->stats.pdrop++; q->stats.pdrop++;
sch->qstats.drops++; return qdisc_drop(skb, sch);
kfree_skb(skb);
return NET_XMIT_DROP;
congestion_drop: congestion_drop:
qdisc_drop(skb, sch); qdisc_drop(skb, sch);
return NET_XMIT_CN; return NET_XMIT_CN;
other_drop: other_drop:
if (ret & __NET_XMIT_BYPASS) if (ret & __NET_XMIT_BYPASS)
sch->qstats.drops++; sch->qstats.drops++;
kfree_skb(skb); kfree_skb(skb);
......
...@@ -265,8 +265,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -265,8 +265,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
return NET_XMIT_SUCCESS; return NET_XMIT_SUCCESS;
drop: drop:
kfree_skb(skb); qdisc_drop(skb, sch);
sch->qstats.drops++;
return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
} }
......
...@@ -558,9 +558,7 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -558,9 +558,7 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
__skb_queue_tail(&q->direct_queue, skb); __skb_queue_tail(&q->direct_queue, skb);
q->direct_pkts++; q->direct_pkts++;
} else { } else {
kfree_skb(skb); return qdisc_drop(skb, sch);
sch->qstats.drops++;
return NET_XMIT_DROP;
} }
#ifdef CONFIG_NET_CLS_ACT #ifdef CONFIG_NET_CLS_ACT
} else if (!cl) { } else if (!cl) {
......
...@@ -88,9 +88,7 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -88,9 +88,7 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc *sch)
return NET_XMIT_SUCCESS; return NET_XMIT_SUCCESS;
} }
kfree_skb(skb); return qdisc_drop(skb, sch);
sch->qstats.drops++;
return NET_XMIT_DROP;
} }
static struct sk_buff * static struct sk_buff *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment