From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: [PATCH iproute2-next] tc: red: allow setting th_min and th_max to the same value Date: Tue, 16 Jan 2018 15:08:50 -0800 Message-ID: <20180116230850.25802-1-jakub.kicinski@netronome.com> Cc: netdev@vger.kernel.org, oss-drivers@netronome.com, Jakub Kicinski To: dsahern@gmail.com, stephen@networkplumber.org Return-path: Received: from mail-pl0-f66.google.com ([209.85.160.66]:40782 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750750AbeAPXI6 (ORCPT ); Tue, 16 Jan 2018 18:08:58 -0500 Received: by mail-pl0-f66.google.com with SMTP id g18so1706763plo.7 for ; Tue, 16 Jan 2018 15:08:58 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: 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 Reviewed-by: Dirk van der Merwe --- Or should I go ahead and add a DCTCP qdisc? :) tc/tc_red.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tc/tc_red.c b/tc/tc_red.c index 1f82ef1aec65..178fe088f732 100644 --- a/tc/tc_red.c +++ b/tc/tc_red.c @@ -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; -- 2.15.1