Skip to content

Commit

Permalink
[NET_SCHED]: kill PSCHED_TADD/PSCHED_TADD2
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
kaber authored and David S. Miller committed Apr 26, 2007
1 parent 26e252d commit 7c59e25
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions include/net/pkt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ typedef long psched_tdiff_t;
#define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \
min_t(long long, (tv1) - (tv2), bound)
#define PSCHED_TLESS(tv1, tv2) ((tv1) < (tv2))
#define PSCHED_TADD2(tv, delta, tv_res) ((tv_res) = (tv) + (delta))
#define PSCHED_TADD(tv, delta) ((tv) += (delta))
#define PSCHED_SET_PASTPERFECT(t) ((t) = 0)
#define PSCHED_IS_PASTPERFECT(t) ((t) == 0)

Expand Down
12 changes: 6 additions & 6 deletions net/sched/sch_cbq.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ cbq_mark_toplevel(struct cbq_sched_data *q, struct cbq_class *cl)

PSCHED_GET_TIME(now);
incr = PSCHED_TDIFF(now, q->now_rt);
PSCHED_TADD2(q->now, incr, now);
now = q->now + incr;

do {
if (PSCHED_TLESS(cl->undertime, now)) {
Expand Down Expand Up @@ -492,7 +492,7 @@ static void cbq_ovl_classic(struct cbq_class *cl)
cl->avgidle = cl->minidle;
if (delay <= 0)
delay = 1;
PSCHED_TADD2(q->now, delay, cl->undertime);
cl->undertime = q->now + delay;

cl->xstats.overactions++;
cl->delayed = 1;
Expand Down Expand Up @@ -558,7 +558,7 @@ static void cbq_ovl_delay(struct cbq_class *cl)
delay -= (-cl->avgidle) - ((-cl->avgidle) >> cl->ewma_log);
if (cl->avgidle < cl->minidle)
cl->avgidle = cl->minidle;
PSCHED_TADD2(q->now, delay, cl->undertime);
cl->undertime = q->now + delay;

if (delay > 0) {
sched += delay + cl->penalty;
Expand Down Expand Up @@ -820,7 +820,7 @@ cbq_update(struct cbq_sched_data *q)
idle -= L2T(&q->link, len);
idle += L2T(cl, len);

PSCHED_TADD2(q->now, idle, cl->undertime);
cl->undertime = q->now + idle;
} else {
/* Underlimit */

Expand Down Expand Up @@ -1018,12 +1018,12 @@ cbq_dequeue(struct Qdisc *sch)
cbq_time = max(real_time, work);
*/
incr2 = L2T(&q->link, q->tx_len);
PSCHED_TADD(q->now, incr2);
q->now += incr2;
cbq_update(q);
if ((incr -= incr2) < 0)
incr = 0;
}
PSCHED_TADD(q->now, incr);
q->now += incr;
q->now_rt = now;

for (;;) {
Expand Down
2 changes: 1 addition & 1 deletion net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
&q->delay_cor, q->delay_dist);

PSCHED_GET_TIME(now);
PSCHED_TADD2(now, delay, cb->time_to_send);
cb->time_to_send = now + delay;
++q->counter;
ret = q->qdisc->enqueue(skb, q->qdisc);
} else {
Expand Down

0 comments on commit 7c59e25

Please sign in to comment.