| To: | "David S. Miller" <davem@xxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH 2.6]: Make packet scheduler clock source configurable |
| From: | Patrick McHardy <kaber@xxxxxxxxx> |
| Date: | Wed, 14 Jul 2004 03:02:37 +0200 |
| Cc: | shemminger@xxxxxxxx, netdev@xxxxxxxxxxx, devik@xxxxxx |
| In-reply-to: | <20040712205037.573411c0.davem@xxxxxxxxxx> |
| References: | <40F34740.5040100@xxxxxxxxx> <1107.63.170.215.71.1089689716.squirrel@xxxxxxxxxxxx> <20040712205037.573411c0.davem@xxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 |
David S. Miller wrote: I also want to add sparc64 %tick register support here too. This is an area with a lot of potential cleanup. We should made an asm/pkt_sched.h to abstract out the clock source implementation instead of loading net/pkt_sched.h up with a pile of ifdefs.
Couldn't we just use get_cycles() ? Something like this:
#include <asm/timex.h>
#if sizeof(cycles_t) == sizeof(u64)
#define PSCHED_GET_TIME(stamp) \
do { \
u64 cur = get_cycles(); \
stamp) = cur >> psched_clock_scale; \
} while (0)
#else
#define PSCHED_WATCHER u32
extern PSCHED_WATCHER psched_time_mark;
#define PSCHED_GET_TIME(stamp) \
do { \
u32 cur = get_cycles(); \
if (cur <= psched_time_mark) \
psched_time_base += 0x100000000UL; \
psched_time_mark = cur; \
(stamp) = (psched_time_base + cur) >> psched_clock_scale; \
} while (0)
#endif
Regards
Patrick
|
| Previous by Date: | [PATCH] netem --, Stephen Hemminger |
|---|---|
| Next by Date: | [PATCH 2.6]: Remove dead timer code from sch_api.c, Patrick McHardy |
| Previous by Thread: | Re: [PATCH 2.6]: Make packet scheduler clock source configurable, David S. Miller |
| Next by Thread: | Re: [PATCH 2.6]: Make packet scheduler clock source configurable, Patrick McHardy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |