pkt_sched: Remove qdisc->ops->requeue() etc.
After implementing qdisc->ops->peek() and changing sch_netem into classless qdisc there are no more qdisc->ops->requeue() users. This patch removes this method with its wrappers (qdisc_requeue()), and also unused qdisc->requeue structure. There are a few minor fixes of warnings (htb_enqueue()) and comments btw. The idea to kill ->requeue() and a similar patch were first developed by David S. Miller. Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
38a7ddffa4
commit
f30ab418a1
@ -551,7 +551,7 @@ static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl)
|
||||
|
||||
static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
|
||||
{
|
||||
int ret;
|
||||
int uninitialized_var(ret);
|
||||
struct htb_sched *q = qdisc_priv(sch);
|
||||
struct htb_class *cl = htb_classify(skb, sch, &ret);
|
||||
|
||||
@ -591,47 +591,6 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
|
||||
return NET_XMIT_SUCCESS;
|
||||
}
|
||||
|
||||
/* TODO: requeuing packet charges it to policers again !! */
|
||||
static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)
|
||||
{
|
||||
int ret;
|
||||
struct htb_sched *q = qdisc_priv(sch);
|
||||
struct htb_class *cl = htb_classify(skb, sch, &ret);
|
||||
struct sk_buff *tskb;
|
||||
|
||||
if (cl == HTB_DIRECT) {
|
||||
/* enqueue to helper queue */
|
||||
if (q->direct_queue.qlen < q->direct_qlen) {
|
||||
__skb_queue_head(&q->direct_queue, skb);
|
||||
} else {
|
||||
__skb_queue_head(&q->direct_queue, skb);
|
||||
tskb = __skb_dequeue_tail(&q->direct_queue);
|
||||
kfree_skb(tskb);
|
||||
sch->qstats.drops++;
|
||||
return NET_XMIT_CN;
|
||||
}
|
||||
#ifdef CONFIG_NET_CLS_ACT
|
||||
} else if (!cl) {
|
||||
if (ret & __NET_XMIT_BYPASS)
|
||||
sch->qstats.drops++;
|
||||
kfree_skb(skb);
|
||||
return ret;
|
||||
#endif
|
||||
} else if ((ret = cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q)) !=
|
||||
NET_XMIT_SUCCESS) {
|
||||
if (net_xmit_drop_count(ret)) {
|
||||
sch->qstats.drops++;
|
||||
cl->qstats.drops++;
|
||||
}
|
||||
return ret;
|
||||
} else
|
||||
htb_activate(q, cl);
|
||||
|
||||
sch->q.qlen++;
|
||||
sch->qstats.requeues++;
|
||||
return NET_XMIT_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* htb_charge_class - charges amount "bytes" to leaf and ancestors
|
||||
*
|
||||
@ -1566,7 +1525,6 @@ static struct Qdisc_ops htb_qdisc_ops __read_mostly = {
|
||||
.enqueue = htb_enqueue,
|
||||
.dequeue = htb_dequeue,
|
||||
.peek = qdisc_peek_dequeued,
|
||||
.requeue = htb_requeue,
|
||||
.drop = htb_drop,
|
||||
.init = htb_init,
|
||||
.reset = htb_reset,
|
||||
|
Reference in New Issue
Block a user