diff options
author | Patrick McHardy <kaber@trash.net> | 2007-03-23 14:27:45 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:27:49 -0400 |
commit | 7c59e25f3186f26e85b13a318dbc4482d1d363e9 (patch) | |
tree | b6cfda6d2e14879e3f4373d261b65b80d156d1c1 | |
parent | 26e252df1e6e5b68eb790e4a4baf745aa3870038 (diff) |
[NET_SCHED]: kill PSCHED_TADD/PSCHED_TADD2
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/pkt_sched.h | 2 | ||||
-rw-r--r-- | net/sched/sch_cbq.c | 12 | ||||
-rw-r--r-- | net/sched/sch_netem.c | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 276d1ad2b708..32cdf0137cb2 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -55,8 +55,6 @@ typedef long psched_tdiff_t; | |||
55 | #define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \ | 55 | #define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \ |
56 | min_t(long long, (tv1) - (tv2), bound) | 56 | min_t(long long, (tv1) - (tv2), bound) |
57 | #define PSCHED_TLESS(tv1, tv2) ((tv1) < (tv2)) | 57 | #define PSCHED_TLESS(tv1, tv2) ((tv1) < (tv2)) |
58 | #define PSCHED_TADD2(tv, delta, tv_res) ((tv_res) = (tv) + (delta)) | ||
59 | #define PSCHED_TADD(tv, delta) ((tv) += (delta)) | ||
60 | #define PSCHED_SET_PASTPERFECT(t) ((t) = 0) | 58 | #define PSCHED_SET_PASTPERFECT(t) ((t) = 0) |
61 | #define PSCHED_IS_PASTPERFECT(t) ((t) == 0) | 59 | #define PSCHED_IS_PASTPERFECT(t) ((t) == 0) |
62 | 60 | ||
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 57ac6c5cd273..290b26bdc89d 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -387,7 +387,7 @@ cbq_mark_toplevel(struct cbq_sched_data *q, struct cbq_class *cl) | |||
387 | 387 | ||
388 | PSCHED_GET_TIME(now); | 388 | PSCHED_GET_TIME(now); |
389 | incr = PSCHED_TDIFF(now, q->now_rt); | 389 | incr = PSCHED_TDIFF(now, q->now_rt); |
390 | PSCHED_TADD2(q->now, incr, now); | 390 | now = q->now + incr; |
391 | 391 | ||
392 | do { | 392 | do { |
393 | if (PSCHED_TLESS(cl->undertime, now)) { | 393 | if (PSCHED_TLESS(cl->undertime, now)) { |
@@ -492,7 +492,7 @@ static void cbq_ovl_classic(struct cbq_class *cl) | |||
492 | cl->avgidle = cl->minidle; | 492 | cl->avgidle = cl->minidle; |
493 | if (delay <= 0) | 493 | if (delay <= 0) |
494 | delay = 1; | 494 | delay = 1; |
495 | PSCHED_TADD2(q->now, delay, cl->undertime); | 495 | cl->undertime = q->now + delay; |
496 | 496 | ||
497 | cl->xstats.overactions++; | 497 | cl->xstats.overactions++; |
498 | cl->delayed = 1; | 498 | cl->delayed = 1; |
@@ -558,7 +558,7 @@ static void cbq_ovl_delay(struct cbq_class *cl) | |||
558 | delay -= (-cl->avgidle) - ((-cl->avgidle) >> cl->ewma_log); | 558 | delay -= (-cl->avgidle) - ((-cl->avgidle) >> cl->ewma_log); |
559 | if (cl->avgidle < cl->minidle) | 559 | if (cl->avgidle < cl->minidle) |
560 | cl->avgidle = cl->minidle; | 560 | cl->avgidle = cl->minidle; |
561 | PSCHED_TADD2(q->now, delay, cl->undertime); | 561 | cl->undertime = q->now + delay; |
562 | 562 | ||
563 | if (delay > 0) { | 563 | if (delay > 0) { |
564 | sched += delay + cl->penalty; | 564 | sched += delay + cl->penalty; |
@@ -820,7 +820,7 @@ cbq_update(struct cbq_sched_data *q) | |||
820 | idle -= L2T(&q->link, len); | 820 | idle -= L2T(&q->link, len); |
821 | idle += L2T(cl, len); | 821 | idle += L2T(cl, len); |
822 | 822 | ||
823 | PSCHED_TADD2(q->now, idle, cl->undertime); | 823 | cl->undertime = q->now + idle; |
824 | } else { | 824 | } else { |
825 | /* Underlimit */ | 825 | /* Underlimit */ |
826 | 826 | ||
@@ -1018,12 +1018,12 @@ cbq_dequeue(struct Qdisc *sch) | |||
1018 | cbq_time = max(real_time, work); | 1018 | cbq_time = max(real_time, work); |
1019 | */ | 1019 | */ |
1020 | incr2 = L2T(&q->link, q->tx_len); | 1020 | incr2 = L2T(&q->link, q->tx_len); |
1021 | PSCHED_TADD(q->now, incr2); | 1021 | q->now += incr2; |
1022 | cbq_update(q); | 1022 | cbq_update(q); |
1023 | if ((incr -= incr2) < 0) | 1023 | if ((incr -= incr2) < 0) |
1024 | incr = 0; | 1024 | incr = 0; |
1025 | } | 1025 | } |
1026 | PSCHED_TADD(q->now, incr); | 1026 | q->now += incr; |
1027 | q->now_rt = now; | 1027 | q->now_rt = now; |
1028 | 1028 | ||
1029 | for (;;) { | 1029 | for (;;) { |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index bc4284396fcb..6044ae77d5da 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -218,7 +218,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
218 | &q->delay_cor, q->delay_dist); | 218 | &q->delay_cor, q->delay_dist); |
219 | 219 | ||
220 | PSCHED_GET_TIME(now); | 220 | PSCHED_GET_TIME(now); |
221 | PSCHED_TADD2(now, delay, cb->time_to_send); | 221 | cb->time_to_send = now + delay; |
222 | ++q->counter; | 222 | ++q->counter; |
223 | ret = q->qdisc->enqueue(skb, q->qdisc); | 223 | ret = q->qdisc->enqueue(skb, q->qdisc); |
224 | } else { | 224 | } else { |