* [PATCH iproute2] tc: fq_codel: add drop_batch parameter
@ 2020-04-27 17:51 Eric Dumazet
2020-04-28 1:16 ` Stephen Hemminger
2020-04-30 5:33 ` Stephen Hemminger
0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2020-04-27 17:51 UTC (permalink / raw)
To: David Ahern, Stephen Hemminger; +Cc: netdev, Eric Dumazet, Eric Dumazet
Commit 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()")
added the new TCA_FQ_CODEL_DROP_BATCH_SIZE parameter, set by default to 64.
Add to tc command the ability to get/set the drop_batch
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
tc/q_fq_codel.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/tc/q_fq_codel.c b/tc/q_fq_codel.c
index 1c6cf1e0de9ef6aa2400f36008cbc830c37352c0..1a51302e0e2b332a4496965dfeaf520bc843f8ad 100644
--- a/tc/q_fq_codel.c
+++ b/tc/q_fq_codel.c
@@ -54,12 +54,14 @@ static void explain(void)
"[ memory_limit BYTES ]\n"
"[ target TIME ] [ interval TIME ]\n"
"[ quantum BYTES ] [ [no]ecn ]\n"
- "[ ce_threshold TIME ]\n");
+ "[ ce_threshold TIME ]\n"
+ "[ drop_batch SIZE ]\n");
}
static int fq_codel_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
+ unsigned int drop_batch = 0;
unsigned int limit = 0;
unsigned int flows = 0;
unsigned int target = 0;
@@ -89,6 +91,12 @@ static int fq_codel_parse_opt(struct qdisc_util *qu, int argc, char **argv,
fprintf(stderr, "Illegal \"quantum\"\n");
return -1;
}
+ } else if (strcmp(*argv, "drop_batch") == 0) {
+ NEXT_ARG();
+ if (get_unsigned(&drop_batch, *argv, 0)) {
+ fprintf(stderr, "Illegal \"drop_batch\"\n");
+ return -1;
+ }
} else if (strcmp(*argv, "target") == 0) {
NEXT_ARG();
if (get_time(&target, *argv)) {
@@ -147,6 +155,8 @@ static int fq_codel_parse_opt(struct qdisc_util *qu, int argc, char **argv,
if (memory != ~0U)
addattr_l(n, 1024, TCA_FQ_CODEL_MEMORY_LIMIT,
&memory, sizeof(memory));
+ if (drop_batch)
+ addattr_l(n, 1024, TCA_FQ_CODEL_DROP_BATCH_SIZE, &drop_batch, sizeof(drop_batch));
addattr_nest_end(n, tail);
return 0;
@@ -163,6 +173,7 @@ static int fq_codel_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt
unsigned int quantum;
unsigned int ce_threshold;
unsigned int memory_limit;
+ unsigned int drop_batch;
SPRINT_BUF(b1);
@@ -220,6 +231,12 @@ static int fq_codel_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt
if (ecn)
print_bool(PRINT_ANY, "ecn", "ecn ", true);
}
+ if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE] &&
+ RTA_PAYLOAD(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]) >= sizeof(__u32)) {
+ drop_batch = rta_getattr_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]);
+ if (drop_batch)
+ print_uint(PRINT_ANY, "drop_batch", "drop_batch %u ", drop_batch);
+ }
return 0;
}
--
2.26.2.303.gf8c07b1a785-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] tc: fq_codel: add drop_batch parameter
2020-04-27 17:51 [PATCH iproute2] tc: fq_codel: add drop_batch parameter Eric Dumazet
@ 2020-04-28 1:16 ` Stephen Hemminger
2020-04-30 5:33 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2020-04-28 1:16 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Ahern, netdev, Eric Dumazet
On Mon, 27 Apr 2020 10:51:55 -0700
Eric Dumazet <edumazet@google.com> wrote:
> Commit 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()")
> added the new TCA_FQ_CODEL_DROP_BATCH_SIZE parameter, set by default to 64.
>
> Add to tc command the ability to get/set the drop_batch
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Both patches applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] tc: fq_codel: add drop_batch parameter
2020-04-27 17:51 [PATCH iproute2] tc: fq_codel: add drop_batch parameter Eric Dumazet
2020-04-28 1:16 ` Stephen Hemminger
@ 2020-04-30 5:33 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2020-04-30 5:33 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Ahern, netdev, Eric Dumazet
On Mon, 27 Apr 2020 10:51:55 -0700
Eric Dumazet <edumazet@google.com> wrote:
> Commit 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()")
> added the new TCA_FQ_CODEL_DROP_BATCH_SIZE parameter, set by default to 64.
>
> Add to tc command the ability to get/set the drop_batch
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Both fq and fq_codel batch applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-30 5:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 17:51 [PATCH iproute2] tc: fq_codel: add drop_batch parameter Eric Dumazet
2020-04-28 1:16 ` Stephen Hemminger
2020-04-30 5:33 ` Stephen Hemminger
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).