Commit 6b0355f4 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by David S. Miller

net_sched/hfsc: opencode trivial set_active() and set_passive()

Any move comment abount update_vf() into right place.
Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 95946658
...@@ -829,28 +829,6 @@ update_vf(struct hfsc_class *cl, unsigned int len, u64 cur_time) ...@@ -829,28 +829,6 @@ update_vf(struct hfsc_class *cl, unsigned int len, u64 cur_time)
} }
} }
static void
set_active(struct hfsc_class *cl, unsigned int len)
{
if (cl->cl_flags & HFSC_RSC)
init_ed(cl, len);
if (cl->cl_flags & HFSC_FSC)
init_vf(cl, len);
}
static void
set_passive(struct hfsc_class *cl)
{
if (cl->cl_flags & HFSC_RSC)
eltree_remove(cl);
/*
* vttree is now handled in update_vf() so that update_vf(cl, 0, 0)
* needs to be called explicitly to remove a class from vttree.
*/
}
static unsigned int static unsigned int
qdisc_peek_len(struct Qdisc *sch) qdisc_peek_len(struct Qdisc *sch)
{ {
...@@ -1221,8 +1199,12 @@ hfsc_qlen_notify(struct Qdisc *sch, unsigned long arg) ...@@ -1221,8 +1199,12 @@ hfsc_qlen_notify(struct Qdisc *sch, unsigned long arg)
{ {
struct hfsc_class *cl = (struct hfsc_class *)arg; struct hfsc_class *cl = (struct hfsc_class *)arg;
/* vttree is now handled in update_vf() so that update_vf(cl, 0, 0)
* needs to be called explicitly to remove a class from vttree.
*/
update_vf(cl, 0, 0); update_vf(cl, 0, 0);
set_passive(cl); if (cl->cl_flags & HFSC_RSC)
eltree_remove(cl);
} }
static unsigned long static unsigned long
...@@ -1583,7 +1565,12 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free) ...@@ -1583,7 +1565,12 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)
} }
if (cl->qdisc->q.qlen == 1) { if (cl->qdisc->q.qlen == 1) {
set_active(cl, qdisc_pkt_len(skb)); unsigned int len = qdisc_pkt_len(skb);
if (cl->cl_flags & HFSC_RSC)
init_ed(cl, len);
if (cl->cl_flags & HFSC_FSC)
init_vf(cl, len);
/* /*
* If this is the first packet, isolate the head so an eventual * If this is the first packet, isolate the head so an eventual
* head drop before the first dequeue operation has no chance * head drop before the first dequeue operation has no chance
...@@ -1647,18 +1634,18 @@ hfsc_dequeue(struct Qdisc *sch) ...@@ -1647,18 +1634,18 @@ hfsc_dequeue(struct Qdisc *sch)
if (realtime) if (realtime)
cl->cl_cumul += qdisc_pkt_len(skb); cl->cl_cumul += qdisc_pkt_len(skb);
if (cl->qdisc->q.qlen != 0) {
if (cl->cl_flags & HFSC_RSC) { if (cl->cl_flags & HFSC_RSC) {
if (cl->qdisc->q.qlen != 0) {
/* update ed */ /* update ed */
next_len = qdisc_peek_len(cl->qdisc); next_len = qdisc_peek_len(cl->qdisc);
if (realtime) if (realtime)
update_ed(cl, next_len); update_ed(cl, next_len);
else else
update_d(cl, next_len); update_d(cl, next_len);
}
} else { } else {
/* the class becomes passive */ /* the class becomes passive */
set_passive(cl); eltree_remove(cl);
}
} }
qdisc_bstats_update(sch, skb); qdisc_bstats_update(sch, skb);
......
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