212-htb_time_fix.patch 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Index: linux-2.4.35.4/net/sched/sch_htb.c
  2. ===================================================================
  3. --- linux-2.4.35.4.orig/net/sched/sch_htb.c
  4. +++ linux-2.4.35.4/net/sched/sch_htb.c
  5. @@ -369,7 +369,7 @@ static void htb_debug_dump (struct htb_s
  6. struct list_head *l;
  7. list_for_each (l,q->hash+i) {
  8. struct htb_class *cl = list_entry(l,struct htb_class,hlist);
  9. - long diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer, 0);
  10. + long long diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer, 0);
  11. printk(KERN_DEBUG "htb*c%x m=%d t=%ld c=%ld pq=%lu df=%ld ql=%d "
  12. "pa=%x f:",
  13. cl->classid,cl->cmode,cl->tokens,cl->ctokens,
  14. @@ -617,7 +617,7 @@ static void htb_deactivate_prios(struct
  15. * mode transitions per time unit. The speed gain is about 1/6.
  16. */
  17. static __inline__ enum htb_cmode
  18. -htb_class_mode(struct htb_class *cl,long *diff)
  19. +htb_class_mode(struct htb_class *cl,long long *diff)
  20. {
  21. long toks;
  22. @@ -650,7 +650,7 @@ htb_class_mode(struct htb_class *cl,long
  23. * to mode other than HTB_CAN_SEND (see htb_add_to_wait_tree).
  24. */
  25. static void
  26. -htb_change_class_mode(struct htb_sched *q, struct htb_class *cl, long *diff)
  27. +htb_change_class_mode(struct htb_sched *q, struct htb_class *cl, long long *diff)
  28. {
  29. enum htb_cmode new_mode = htb_class_mode(cl,diff);
  30. @@ -815,7 +815,8 @@ static void htb_rate_timer(unsigned long
  31. static void htb_charge_class(struct htb_sched *q,struct htb_class *cl,
  32. int level,int bytes)
  33. {
  34. - long toks,diff;
  35. + long long diff;
  36. + long toks;
  37. enum htb_cmode old_mode;
  38. HTB_DBG(5,1,"htb_chrg_cl cl=%X lev=%d len=%d\n",cl->classid,level,bytes);
  39. @@ -831,7 +832,7 @@ static void htb_charge_class(struct htb_
  40. #ifdef HTB_DEBUG
  41. if (diff > cl->mbuffer || diff < 0 || PSCHED_TLESS(q->now, cl->t_c)) {
  42. if (net_ratelimit())
  43. - printk(KERN_ERR "HTB: bad diff in charge, cl=%X diff=%lX now=%Lu then=%Lu j=%lu\n",
  44. + printk(KERN_ERR "HTB: bad diff in charge, cl=%X diff=%Ld now=%Lu then=%Lu j=%lu\n",
  45. cl->classid, diff,
  46. (unsigned long long) q->now,
  47. (unsigned long long) cl->t_c,
  48. @@ -848,7 +849,7 @@ static void htb_charge_class(struct htb_
  49. }
  50. HTB_ACCNT (ctokens,cbuffer,ceil);
  51. cl->t_c = q->now;
  52. - HTB_DBG(5,2,"htb_chrg_clp cl=%X diff=%ld tok=%ld ctok=%ld\n",cl->classid,diff,cl->tokens,cl->ctokens);
  53. + HTB_DBG(5,2,"htb_chrg_clp cl=%X diff=%Ld tok=%ld ctok=%ld\n",cl->classid,diff,cl->tokens,cl->ctokens);
  54. old_mode = cl->cmode; diff = 0;
  55. htb_change_class_mode(q,cl,&diff);
  56. @@ -887,7 +888,7 @@ static long htb_do_events(struct htb_sch
  57. level,q->wait_pq[level].rb_node,q->row_mask[level]);
  58. for (i = 0; i < 500; i++) {
  59. struct htb_class *cl;
  60. - long diff;
  61. + long long diff;
  62. rb_node_t *p = q->wait_pq[level].rb_node;
  63. if (!p) return 0;
  64. while (p->rb_left) p = p->rb_left;
  65. @@ -902,7 +903,7 @@ static long htb_do_events(struct htb_sch
  66. #ifdef HTB_DEBUG
  67. if (diff > cl->mbuffer || diff < 0 || PSCHED_TLESS(q->now, cl->t_c)) {
  68. if (net_ratelimit())
  69. - printk(KERN_ERR "HTB: bad diff in events, cl=%X diff=%lX now=%Lu then=%Lu j=%lu\n",
  70. + printk(KERN_ERR "HTB: bad diff in events, cl=%X diff=%Ld now=%Lu then=%Lu j=%lu\n",
  71. cl->classid, diff,
  72. (unsigned long long) q->now,
  73. (unsigned long long) cl->t_c,