#define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2))
#define PSCHED_TDIFF_SAFE(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_IS_PASTPERFECT(t) ((t) == 0)
now = q->now + incr;
do {
- if (PSCHED_TLESS(cl->undertime, now)) {
+ if (cl->undertime < now) {
q->toplevel = cl->level;
return;
}
if (cl->tparent == NULL)
return cl;
- if (PSCHED_IS_PASTPERFECT(cl->undertime) ||
- !PSCHED_TLESS(q->now, cl->undertime)) {
+ if (PSCHED_IS_PASTPERFECT(cl->undertime) || q->now >= cl->undertime) {
cl->delayed = 0;
return cl;
}
if (cl->level > q->toplevel)
return NULL;
} while (!PSCHED_IS_PASTPERFECT(cl->undertime) &&
- PSCHED_TLESS(q->now, cl->undertime));
+ q->now < cl->undertime);
cl->delayed = 0;
return cl;
/* if more time remaining? */
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);
sch->q.qlen--;
return skb;
if (likely(skb_queue_len(list) < q->limit)) {
/* 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;
return qdisc_enqueue_tail(nskb, sch);
}
const struct netem_skb_cb *cb
= (const struct netem_skb_cb *)skb->cb;
- if (!PSCHED_TLESS(tnext, cb->time_to_send))
+ if (tnext >= cb->time_to_send)
break;
}