[NET_SCHED]: kill PSCHED_TDIFF

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Patrick McHardy 2007-03-23 11:28:55 -07:00 коммит произвёл David S. Miller
Родитель a084980dcb
Коммит 8edc0c31d6
2 изменённых файлов: 7 добавлений и 8 удалений

Просмотреть файл

@ -51,7 +51,6 @@ typedef long psched_tdiff_t;
#define PSCHED_GET_TIME(stamp) \ #define PSCHED_GET_TIME(stamp) \
((stamp) = PSCHED_NS2US(ktime_to_ns(ktime_get()))) ((stamp) = PSCHED_NS2US(ktime_to_ns(ktime_get())))
#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_PASTPERFECT 0 #define PSCHED_PASTPERFECT 0

Просмотреть файл

@ -386,7 +386,7 @@ cbq_mark_toplevel(struct cbq_sched_data *q, struct cbq_class *cl)
psched_tdiff_t incr; psched_tdiff_t incr;
PSCHED_GET_TIME(now); PSCHED_GET_TIME(now);
incr = PSCHED_TDIFF(now, q->now_rt); incr = now - q->now_rt;
now = q->now + incr; now = q->now + incr;
do { do {
@ -474,7 +474,7 @@ cbq_requeue(struct sk_buff *skb, struct Qdisc *sch)
static void cbq_ovl_classic(struct cbq_class *cl) static void cbq_ovl_classic(struct cbq_class *cl)
{ {
struct cbq_sched_data *q = qdisc_priv(cl->qdisc); struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
psched_tdiff_t delay = PSCHED_TDIFF(cl->undertime, q->now); psched_tdiff_t delay = cl->undertime - q->now;
if (!cl->delayed) { if (!cl->delayed) {
delay += cl->offtime; delay += cl->offtime;
@ -509,7 +509,7 @@ static void cbq_ovl_classic(struct cbq_class *cl)
psched_tdiff_t base_delay = q->wd_expires; psched_tdiff_t base_delay = q->wd_expires;
for (b = cl->borrow; b; b = b->borrow) { for (b = cl->borrow; b; b = b->borrow) {
delay = PSCHED_TDIFF(b->undertime, q->now); delay = b->undertime - q->now;
if (delay < base_delay) { if (delay < base_delay) {
if (delay <= 0) if (delay <= 0)
delay = 1; delay = 1;
@ -547,7 +547,7 @@ static void cbq_ovl_rclassic(struct cbq_class *cl)
static void cbq_ovl_delay(struct cbq_class *cl) static void cbq_ovl_delay(struct cbq_class *cl)
{ {
struct cbq_sched_data *q = qdisc_priv(cl->qdisc); struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
psched_tdiff_t delay = PSCHED_TDIFF(cl->undertime, q->now); psched_tdiff_t delay = cl->undertime - q->now;
if (!cl->delayed) { if (!cl->delayed) {
psched_time_t sched = q->now; psched_time_t sched = q->now;
@ -776,7 +776,7 @@ cbq_update(struct cbq_sched_data *q)
idle = (now - last) - last_pktlen/rate idle = (now - last) - last_pktlen/rate
*/ */
idle = PSCHED_TDIFF(q->now, cl->last); idle = q->now - cl->last;
if ((unsigned long)idle > 128*1024*1024) { if ((unsigned long)idle > 128*1024*1024) {
avgidle = cl->maxidle; avgidle = cl->maxidle;
} else { } else {
@ -1004,7 +1004,7 @@ cbq_dequeue(struct Qdisc *sch)
psched_tdiff_t incr; psched_tdiff_t incr;
PSCHED_GET_TIME(now); PSCHED_GET_TIME(now);
incr = PSCHED_TDIFF(now, q->now_rt); incr = now - q->now_rt;
if (q->tx_class) { if (q->tx_class) {
psched_tdiff_t incr2; psched_tdiff_t incr2;
@ -1650,7 +1650,7 @@ cbq_dump_class_stats(struct Qdisc *sch, unsigned long arg,
cl->xstats.undertime = 0; cl->xstats.undertime = 0;
if (cl->undertime != PSCHED_PASTPERFECT) if (cl->undertime != PSCHED_PASTPERFECT)
cl->xstats.undertime = PSCHED_TDIFF(cl->undertime, q->now); cl->xstats.undertime = cl->undertime - q->now;
if (gnet_stats_copy_basic(d, &cl->bstats) < 0 || if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
#ifdef CONFIG_NET_ESTIMATOR #ifdef CONFIG_NET_ESTIMATOR