提交 104e0878 编写于 作者: P Patrick McHardy 提交者: David S. Miller

[NET_SCHED]: kill PSCHED_TLESS

Signed-off-by: NPatrick McHardy <kaber@trash.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7c59e25f
...@@ -54,7 +54,6 @@ typedef long psched_tdiff_t; ...@@ -54,7 +54,6 @@ typedef long psched_tdiff_t;
#define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2)) #define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2))
#define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \ #define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \
min_t(long long, (tv1) - (tv2), bound) min_t(long long, (tv1) - (tv2), bound)
#define PSCHED_TLESS(tv1, tv2) ((tv1) < (tv2))
#define PSCHED_SET_PASTPERFECT(t) ((t) = 0) #define PSCHED_SET_PASTPERFECT(t) ((t) = 0)
#define PSCHED_IS_PASTPERFECT(t) ((t) == 0) #define PSCHED_IS_PASTPERFECT(t) ((t) == 0)
......
...@@ -390,7 +390,7 @@ cbq_mark_toplevel(struct cbq_sched_data *q, struct cbq_class *cl) ...@@ -390,7 +390,7 @@ cbq_mark_toplevel(struct cbq_sched_data *q, struct cbq_class *cl)
now = q->now + incr; now = q->now + incr;
do { do {
if (PSCHED_TLESS(cl->undertime, now)) { if (cl->undertime < now) {
q->toplevel = cl->level; q->toplevel = cl->level;
return; return;
} }
...@@ -845,8 +845,7 @@ cbq_under_limit(struct cbq_class *cl) ...@@ -845,8 +845,7 @@ cbq_under_limit(struct cbq_class *cl)
if (cl->tparent == NULL) if (cl->tparent == NULL)
return cl; return cl;
if (PSCHED_IS_PASTPERFECT(cl->undertime) || if (PSCHED_IS_PASTPERFECT(cl->undertime) || q->now >= cl->undertime) {
!PSCHED_TLESS(q->now, cl->undertime)) {
cl->delayed = 0; cl->delayed = 0;
return cl; return cl;
} }
...@@ -870,7 +869,7 @@ cbq_under_limit(struct cbq_class *cl) ...@@ -870,7 +869,7 @@ cbq_under_limit(struct cbq_class *cl)
if (cl->level > q->toplevel) if (cl->level > q->toplevel)
return NULL; return NULL;
} while (!PSCHED_IS_PASTPERFECT(cl->undertime) && } while (!PSCHED_IS_PASTPERFECT(cl->undertime) &&
PSCHED_TLESS(q->now, cl->undertime)); q->now < cl->undertime);
cl->delayed = 0; cl->delayed = 0;
return cl; return cl;
......
...@@ -286,7 +286,7 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) ...@@ -286,7 +286,7 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
/* if more time remaining? */ /* if more time remaining? */
PSCHED_GET_TIME(now); PSCHED_GET_TIME(now);
if (!PSCHED_TLESS(now, cb->time_to_send)) { if (cb->time_to_send <= now) {
pr_debug("netem_dequeue: return skb=%p\n", skb); pr_debug("netem_dequeue: return skb=%p\n", skb);
sch->q.qlen--; sch->q.qlen--;
return skb; return skb;
...@@ -494,7 +494,7 @@ static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) ...@@ -494,7 +494,7 @@ static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch)
if (likely(skb_queue_len(list) < q->limit)) { if (likely(skb_queue_len(list) < q->limit)) {
/* Optimize for add at tail */ /* Optimize for add at tail */
if (likely(skb_queue_empty(list) || !PSCHED_TLESS(tnext, q->oldest))) { if (likely(skb_queue_empty(list) || tnext >= q->oldest)) {
q->oldest = tnext; q->oldest = tnext;
return qdisc_enqueue_tail(nskb, sch); return qdisc_enqueue_tail(nskb, sch);
} }
...@@ -503,7 +503,7 @@ static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) ...@@ -503,7 +503,7 @@ static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch)
const struct netem_skb_cb *cb const struct netem_skb_cb *cb
= (const struct netem_skb_cb *)skb->cb; = (const struct netem_skb_cb *)skb->cb;
if (!PSCHED_TLESS(tnext, cb->time_to_send)) if (tnext >= cb->time_to_send)
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册