]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc: red: allow setting th_min and th_max to the same value
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 16 Jan 2018 23:08:50 +0000 (15:08 -0800)
committerDavid Ahern <dsahern@gmail.com>
Fri, 19 Jan 2018 20:35:23 +0000 (12:35 -0800)
Setting th_min and th_max to the same value may be useful for DCTCP
deployments.  The original DCTCP paper describes it as a simplest way
of achieving simple ECN threshold marking.  Indeed, there doesn't seem
to be any simpler qdisc in Linux which would allow such a setup today.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
tc/tc_red.c

index 1f82ef1aec65d0a1313a43ef55f055a7e11554f4..178fe088f73260711e5ed1e9bc31644334918b59 100644 (file)
@@ -30,7 +30,9 @@ int tc_red_eval_P(unsigned int qmin, unsigned int qmax, double prob)
 {
        int i = qmax - qmin;
 
-       if (i <= 0)
+       if (!i)
+               return 0;
+       if (i < 0)
                return -1;
 
        prob /= i;