Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150770
b: refs/heads/master
c: 728bf09
h: refs/heads/master
v: v3
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Jun 9, 2009
1 parent 676a698 commit f71cd23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 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: 0c27922e4933ceb86644f4a9b1af212ffe5aad75
refs/heads/master: 728bf09827d350cdaa1f093170e745e8dac49b7a
5 changes: 3 additions & 2 deletions trunk/include/net/pkt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ typedef u64 psched_time_t;
typedef long psched_tdiff_t;

/* Avoid doing 64 bit divide by 1000 */
#define PSCHED_US2NS(x) ((s64)(x) << 10)
#define PSCHED_NS2US(x) ((x) >> 10)
#define PSCHED_SHIFT 10
#define PSCHED_US2NS(x) ((s64)(x) << PSCHED_SHIFT)
#define PSCHED_NS2US(x) ((x) >> PSCHED_SHIFT)

#define PSCHED_TICKS_PER_SEC PSCHED_NS2US(NSEC_PER_SEC)
#define PSCHED_PASTPERFECT 0
Expand Down
8 changes: 5 additions & 3 deletions trunk/net/sched/sch_hfsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ cftree_update(struct hfsc_class *cl)
* ism: (psched_us/byte) << ISM_SHIFT
* dx: psched_us
*
* The clock source resolution with ktime is 1.024us.
* The clock source resolution with ktime and PSCHED_SHIFT 10 is 1.024us.
*
* sm and ism are scaled in order to keep effective digits.
* SM_SHIFT and ISM_SHIFT are selected to keep at least 4 effective
Expand All @@ -383,9 +383,11 @@ cftree_update(struct hfsc_class *cl)
* bytes/1.024us 12.8e-3 128e-3 1280e-3 12800e-3 128000e-3
*
* 1.024us/byte 78.125 7.8125 0.78125 0.078125 0.0078125
*
* So, for PSCHED_SHIFT 10 we need: SM_SHIFT 20, ISM_SHIFT 18.
*/
#define SM_SHIFT 20
#define ISM_SHIFT 18
#define SM_SHIFT (30 - PSCHED_SHIFT)
#define ISM_SHIFT (8 + PSCHED_SHIFT)

#define SM_MASK ((1ULL << SM_SHIFT) - 1)
#define ISM_MASK ((1ULL << ISM_SHIFT) - 1)
Expand Down

0 comments on commit f71cd23

Please sign in to comment.