Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276264
b: refs/heads/master
c: ea6a5d3
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Dec 1, 2011
1 parent 08d5bb3 commit 2c7693d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 917fbdb32f37e9a93b00bb12ee83532982982df3
refs/heads/master: ea6a5d3b97b768561db6358f15e4c84ced0f4f7e
15 changes: 6 additions & 9 deletions trunk/include/net/red.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct red_parms {
u32 qR; /* Cached random number */

unsigned long qavg; /* Average queue length: A scaled */
psched_time_t qidlestart; /* Start of current idle period */
ktime_t qidlestart; /* Start of current idle period */
};

static inline u32 red_rmask(u8 Plog)
Expand Down Expand Up @@ -148,17 +148,17 @@ static inline void red_set_parms(struct red_parms *p,

static inline int red_is_idling(struct red_parms *p)
{
return p->qidlestart != PSCHED_PASTPERFECT;
return p->qidlestart.tv64 != 0;
}

static inline void red_start_of_idle_period(struct red_parms *p)
{
p->qidlestart = psched_get_time();
p->qidlestart = ktime_get();
}

static inline void red_end_of_idle_period(struct red_parms *p)
{
p->qidlestart = PSCHED_PASTPERFECT;
p->qidlestart.tv64 = 0;
}

static inline void red_restart(struct red_parms *p)
Expand All @@ -170,13 +170,10 @@ static inline void red_restart(struct red_parms *p)

static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p)
{
psched_time_t now;
long us_idle;
s64 delta = ktime_us_delta(ktime_get(), p->qidlestart);
long us_idle = min_t(s64, delta, p->Scell_max);
int shift;

now = psched_get_time();
us_idle = psched_tdiff_bounded(now, p->qidlestart, p->Scell_max);

/*
* The problem: ideally, average length queue recalcultion should
* be done over constant clock intervals. This is too expensive, so
Expand Down

0 comments on commit 2c7693d

Please sign in to comment.