netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Corey Hickey <bugfood-ml@fatooh.org>
To: netdev@vger.kernel.org
Cc: Corey Hickey <bugfood-ml@fatooh.org>
Subject: [PATCH 08/10] Multiply perturb_period by HZ when used rather than when assigned.
Date: Sat, 25 Aug 2007 15:27:02 -0700	[thread overview]
Message-ID: <11880808272401-git-send-email-bugfood-ml@fatooh.org> (raw)
In-Reply-To: <11880808243166-git-send-email-bugfood-ml@fatooh.org>

perturb_period is the only parameter that doesn't match 1:1 with the
value from userspace. This change makes it easy and clean to use a
small macro for setting parameters (in a subsequent patch).

Signed-off-by: Corey Hickey <bugfood-ml@fatooh.org>
---
 net/sched/sch_sfq.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 77ffce3..f9f4460 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -370,7 +370,7 @@ static void sfq_perturbation(unsigned long arg)
 	q->perturbation = net_random()&0x1F;
 
 	if (q->perturb_period) {
-		q->perturb_timer.expires = jiffies + q->perturb_period;
+		q->perturb_timer.expires = jiffies + q->perturb_period * HZ;
 		add_timer(&q->perturb_timer);
 	}
 }
@@ -432,7 +432,7 @@ sfq_q_init(struct sfq_sched_data *q, struct rtattr *opt)
 		if (ctl->quantum)
 			q->quantum = ctl->quantum;
 		if (ctl->perturb_period)
-			q->perturb_period = ctl->perturb_period * HZ;
+			q->perturb_period = ctl->perturb_period;
 		if (ctl->divisor)
 			q->hash_divisor = ctl->divisor;
 		if (ctl->flows)
@@ -495,7 +495,7 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt)
 	q->perturb_timer.data = (unsigned long)sch;
 	q->perturb_timer.function = sfq_perturbation;
 	if (q->perturb_period) {
-		q->perturb_timer.expires = jiffies + q->perturb_period;
+		q->perturb_timer.expires = jiffies + q->perturb_period * HZ;
 		add_timer(&q->perturb_timer);
 	}
 
@@ -545,7 +545,7 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt)
 
 	/* finish up */
 	if (q->perturb_period) {
-		q->perturb_timer.expires = jiffies + q->perturb_period;
+		q->perturb_timer.expires = jiffies + q->perturb_period * HZ;
 		add_timer(&q->perturb_timer);
 	} else {
 		q->perturbation = 0;
@@ -561,7 +561,7 @@ static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb)
 	struct tc_sfq_qopt opt;
 
 	opt.quantum = q->quantum;
-	opt.perturb_period = q->perturb_period/HZ;
+	opt.perturb_period = q->perturb_period;
 
 	opt.limit = q->limit;
 	opt.divisor = q->hash_divisor;
-- 
1.5.2.4


  parent reply	other threads:[~2007-08-25 22:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-25 22:26 [PATCH 00/10] SFQ: backport some features from ESFQ (try 3) Corey Hickey
2007-08-25 22:26 ` [PATCH 01/10] Preparatory refactoring part 1 Corey Hickey
2007-08-25 22:26 ` [PATCH 02/10] Preparatory refactoring part 2 Corey Hickey
2007-08-25 22:26 ` [PATCH 03/10] Move two functions Corey Hickey
2007-08-25 22:26 ` [PATCH 04/10] Make "depth" (number of queues) user-configurable: Corey Hickey
2007-08-25 22:26 ` [PATCH 05/10] Add divisor Corey Hickey
2007-08-25 22:27 ` [PATCH 06/10] Make qdisc changeable Corey Hickey
2007-08-25 22:27 ` [PATCH 07/10] Remove comments about hardcoded values Corey Hickey
2007-08-25 22:27 ` Corey Hickey [this message]
2007-08-25 22:27 ` [PATCH 09/10] Change perturb_period to unsigned Corey Hickey
2007-08-25 22:27 ` [PATCH 10/10] Use nested compat attributes to pass parameters Corey Hickey
  -- strict thread matches above, loose matches on Subject: below --
2007-09-28 22:52 SFQ: backport some features from ESFQ (try 4) Corey Hickey
2007-09-28 22:52 ` [PATCH 08/10] Multiply perturb_period by HZ when used rather than when assigned Corey Hickey

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=11880808272401-git-send-email-bugfood-ml@fatooh.org \
    --to=bugfood-ml@fatooh.org \
    --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).