netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net] fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks
@ 2020-04-25 19:40 Eric Dumazet
  2020-04-27 10:57 ` Toke Høiland-Jørgensen
  2020-04-27 18:34 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2020-04-25 19:40 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet

My intent was to not let users set a zero drop_batch_size,
it seems I once again messed with min()/max().

Fixes: 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/sched/sch_fq_codel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 968519ff36e97734e495d90331d3e3197660b8f6..436160be9c180ceedaeb74126e40c7e24bf7ccba 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -416,7 +416,7 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt,
 		q->quantum = max(256U, nla_get_u32(tb[TCA_FQ_CODEL_QUANTUM]));
 
 	if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE])
-		q->drop_batch_size = min(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]));
+		q->drop_batch_size = max(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]));
 
 	if (tb[TCA_FQ_CODEL_MEMORY_LIMIT])
 		q->memory_limit = min(1U << 31, nla_get_u32(tb[TCA_FQ_CODEL_MEMORY_LIMIT]));
-- 
2.26.2.303.gf8c07b1a785-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 net] fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks
  2020-04-25 19:40 [PATCH v2 net] fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks Eric Dumazet
@ 2020-04-27 10:57 ` Toke Høiland-Jørgensen
  2020-04-27 18:34 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Toke Høiland-Jørgensen @ 2020-04-27 10:57 UTC (permalink / raw)
  To: Eric Dumazet, David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet

Eric Dumazet <edumazet@google.com> writes:

> My intent was to not let users set a zero drop_batch_size,
> it seems I once again messed with min()/max().
>
> Fixes: 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()")
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 net] fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks
  2020-04-25 19:40 [PATCH v2 net] fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks Eric Dumazet
  2020-04-27 10:57 ` Toke Høiland-Jørgensen
@ 2020-04-27 18:34 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-04-27 18:34 UTC (permalink / raw)
  To: edumazet; +Cc: netdev, eric.dumazet

From: Eric Dumazet <edumazet@google.com>
Date: Sat, 25 Apr 2020 12:40:25 -0700

> My intent was to not let users set a zero drop_batch_size,
> it seems I once again messed with min()/max().
> 
> Fixes: 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()")
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-27 18:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-25 19:40 [PATCH v2 net] fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks Eric Dumazet
2020-04-27 10:57 ` Toke Høiland-Jørgensen
2020-04-27 18:34 ` David Miller

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).