From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: [PATCH iproute2] sfq: add divisor support
Date: Sun, 23 Jan 2011 11:09:06 +0100 [thread overview]
Message-ID: <1295777346.17333.26.camel@edumazet-laptop> (raw)
In-Reply-To: <20110120.165618.180427971.davem@davemloft.net>
In 2.6.39, we can build SFQ queues with a given hash table size,
different than default one (1024 slots)
# tc qdisc add dev eth0 sfq help
Usage: ... sfq [ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ]
[ divisor NUMBER ]
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
tc/q_sfq.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tc/q_sfq.c b/tc/q_sfq.c
index 71a3c9a..98ec530 100644
--- a/tc/q_sfq.c
+++ b/tc/q_sfq.c
@@ -26,6 +26,7 @@
static void explain(void)
{
fprintf(stderr, "Usage: ... sfq [ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ]\n");
+ fprintf(stderr, " [ divisor NUMBER ]\n");
}
static int sfq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
@@ -61,6 +62,13 @@ static int sfq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
return -1;
}
ok++;
+ } else if (strcmp(*argv, "divisor") == 0) {
+ NEXT_ARG();
+ if (get_u32(&opt.divisor, *argv, 0)) {
+ fprintf(stderr, "Illegal \"divisor\"\n");
+ return -1;
+ }
+ ok++;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
@@ -93,6 +101,7 @@ static int sfq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
if (show_details) {
fprintf(f, "flows %u/%u ", qopt->flows, qopt->divisor);
}
+ fprintf(f, "divisor %u ", qopt->divisor);
if (qopt->perturb_period)
fprintf(f, "perturb %dsec ", qopt->perturb_period);
return 0;
next prev parent reply other threads:[~2011-01-23 10:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-20 10:14 [PATCH net-next-2.6] net_sched: sfq: allow divisor to be a parameter Eric Dumazet
2011-01-21 0:56 ` David Miller
2011-01-23 10:09 ` Eric Dumazet [this message]
2011-02-25 21:00 ` [PATCH iproute2] sfq: add divisor support Stephen Hemminger
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=1295777346.17333.26.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/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