From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>
Subject: [NET_SCHED 06/11]: kill PSCHED_TDIFF
Date: Fri, 23 Mar 2007 14:35:46 +0100 (MET) [thread overview]
Message-ID: <20070323133521.10264.67254.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20070323133513.10264.16515.sendpatchset@localhost.localdomain>
[NET_SCHED]: kill PSCHED_TDIFF
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit d72d57707edf96c31e62da0841faf59c011dcd92
tree 8b6192c94e025fb8b6e1be3b02526d4792bd4fa1
parent ec252ac5640ea38d3630cdb97333c398a75391b9
author Patrick McHardy <kaber@trash.net> Fri, 23 Mar 2007 00:01:47 +0100
committer Patrick McHardy <kaber@trash.net> Fri, 23 Mar 2007 10:31:29 +0100
include/net/pkt_sched.h | 1 -
net/sched/sch_cbq.c | 14 +++++++-------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index c40147a..1639737 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -51,7 +51,6 @@ typedef long psched_tdiff_t;
#define PSCHED_GET_TIME(stamp) \
((stamp) = PSCHED_NS2US(ktime_to_ns(ktime_get())))
-#define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2))
#define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \
min_t(long long, (tv1) - (tv2), bound)
#define PSCHED_PASTPERFECT 0
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 2bb271b..f9e8403 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -386,7 +386,7 @@ cbq_mark_toplevel(struct cbq_sched_data *q, struct cbq_class *cl)
psched_tdiff_t incr;
PSCHED_GET_TIME(now);
- incr = PSCHED_TDIFF(now, q->now_rt);
+ incr = now - q->now_rt;
now = q->now + incr;
do {
@@ -474,7 +474,7 @@ cbq_requeue(struct sk_buff *skb, struct Qdisc *sch)
static void cbq_ovl_classic(struct cbq_class *cl)
{
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) {
delay += cl->offtime;
@@ -509,7 +509,7 @@ static void cbq_ovl_classic(struct cbq_class *cl)
psched_tdiff_t base_delay = q->wd_expires;
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 <= 0)
delay = 1;
@@ -547,7 +547,7 @@ static void cbq_ovl_rclassic(struct cbq_class *cl)
static void cbq_ovl_delay(struct cbq_class *cl)
{
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) {
psched_time_t sched = q->now;
@@ -776,7 +776,7 @@ cbq_update(struct cbq_sched_data *q)
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) {
avgidle = cl->maxidle;
} else {
@@ -1004,7 +1004,7 @@ cbq_dequeue(struct Qdisc *sch)
psched_tdiff_t incr;
PSCHED_GET_TIME(now);
- incr = PSCHED_TDIFF(now, q->now_rt);
+ incr = now - q->now_rt;
if (q->tx_class) {
psched_tdiff_t incr2;
@@ -1650,7 +1650,7 @@ cbq_dump_class_stats(struct Qdisc *sch, unsigned long arg,
cl->xstats.undertime = 0;
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 ||
#ifdef CONFIG_NET_ESTIMATOR
next prev parent reply other threads:[~2007-03-23 13:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 13:35 [NET_SCHED 00/11]: pkt_sched.h cleanup + misc changes Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 01/11]: sch_netem: fix off-by-one in send time comparison Patrick McHardy
2007-03-23 16:34 ` Stephen Hemminger
2007-03-23 13:35 ` [NET_SCHED 02/11]: kill PSCHED_AUDIT_TDIFF Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 03/11]: kill PSCHED_TADD/PSCHED_TADD2 Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 04/11]: kill PSCHED_TLESS Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 05/11]: kill PSCHED_SET_PASTPERFECT/PSCHED_IS_PASTPERFECT Patrick McHardy
2007-03-23 13:35 ` Patrick McHardy [this message]
2007-03-23 13:35 ` [NET_SCHED 07/11]: turn PSCHED_TDIFF_SAFE into inline function Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 08/11]: turn PSCHED_GET_TIME " Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 09/11]: Unline tcf_destroy Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 10/11]: qdisc: remove unnecessary memory barriers Patrick McHardy
2007-03-23 13:35 ` [NET_SCHED 11/11]: qdisc: avoid dequeue while throttled Patrick McHardy
2007-03-23 14:39 ` Patrick McHardy
2007-03-23 14:57 ` Patrick McHardy
2007-03-23 18:26 ` David Miller
2007-03-23 18:30 ` [NET_SCHED 00/11]: pkt_sched.h cleanup + misc changes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070323133521.10264.67254.sendpatchset@localhost.localdomain \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).