From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 71681A0545; Wed, 25 May 2022 00:18:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89BEB427EC; Wed, 25 May 2022 00:18:33 +0200 (CEST) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mails.dpdk.org (Postfix) with ESMTP id 3A19340C35 for ; Wed, 25 May 2022 00:18:30 +0200 (CEST) Received: by mail-pj1-f53.google.com with SMTP id z11so8221916pjc.3 for ; Tue, 24 May 2022 15:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5/3sc9SGpZ9Q/YTgJdFfIYh1zwzoVJ75BgiA+TOIsyk=; b=jsGE3vwUVrJPxbBauOb9nBpHxWNVFIqTXbBAzD+dK8JAPxowzMt4niMSTR++w3DwWN Jr6d7DwgayokfsIi3m9F3JN7+EWMACVDRz+sM7qMys8wC5IjCqWo8cMidjnZyvpobBpu QM7wfDzXLclGKJUCguRHLQGaRwz2wQc31E5hQRtl2Fwnoqnl827nnZylVwbK75ctsFj0 ZXUHD9dFq9c/jLgLyFqey2I0b+QQ8bPW0iXq9yWo+HwBxwRqS7BegNaG2KgfALWSs/sW 6i8NasPmxVHlGJszvzI8VlEJa5vFbb3JGw3ECLHYlqc8rzuwU4p+B8sZjKY71tA0zJgr bGsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5/3sc9SGpZ9Q/YTgJdFfIYh1zwzoVJ75BgiA+TOIsyk=; b=FeFo9kzOgsQAg36zeqXDrfX6cYcfMGElWd9ZrY40sFmQihu3qxt3schsVVQdRYXMbP O6WGUC2lcRaC/D0DXQuFmBkizcxhHu4/u11iwPbbGZVA3+TaR0GdTcx61Nmn7IZE2oyk 5IMWoiS/FD47y13alNk4O0o+MzguYUKIURwuKwjXQLeSxEVDibmYdu1mnMB79OtI84z3 xXU5CPpgqrB/sI+Q93/NdLHbLueaUHrxUuBW6t3nk4UqLIllNpLPWhDphnU+ziduQ1TG 0D0FqF3rmQkdWuqwSI/R1U9vb3zgkWz0kTtQ2WSa9UlQcN4vxTUvAWLNvarQ5LrOCGVb x3ZA== X-Gm-Message-State: AOAM5334+Pr+v5YgiLJdyxbDHoIODT/Xzsg+MqnVAcyEZj52uUaa/qdW N4IoWt0wAKRFc1r84R/bQiTFB0JhKGOWLw== X-Google-Smtp-Source: ABdhPJwZlBur/L6gFInWxIzqOjVSH0wT5H+gfC2lBZRlOdGHNh0oqmNHnvHHRArovF4o+UwT7zxK4A== X-Received: by 2002:a17:902:7c11:b0:162:1122:8a7f with SMTP id x17-20020a1709027c1100b0016211228a7fmr15757210pll.37.1653430709119; Tue, 24 May 2022 15:18:29 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id j64-20020a62c543000000b0050dc7628158sm10007121pfg.50.2022.05.24.15.18.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 15:18:28 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , wojciechx.liguzinski@intel.com, Cristian Dumitrescu , Jasvinder Singh Subject: [RFT v2 2/3] rte_pie: remove unnecessary floating point Date: Tue, 24 May 2022 15:18:23 -0700 Message-Id: <20220524221824.1037693-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220524221824.1037693-1-stephen@networkplumber.org> References: <20220524184623.480646-1-stephen@networkplumber.org> <20220524221824.1037693-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The qdelay variable is derived from and compared to 64 bit value so it doesn't have to be floating point. Fixes: 44c730b0e379 ("sched: add PIE based congestion management") Cc: wojciechx.liguzinski@intel.com Signed-off-by: Stephen Hemminger --- lib/sched/rte_pie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sched/rte_pie.h b/lib/sched/rte_pie.h index 02a987f54ad1..3e2c1ef46721 100644 --- a/lib/sched/rte_pie.h +++ b/lib/sched/rte_pie.h @@ -218,7 +218,7 @@ _rte_pie_drop(const struct rte_pie_config *pie_cfg, struct rte_pie *pie) { uint64_t rand_value; - double qdelay = pie_cfg->qdelay_ref * 0.5; + uint64_t qdelay = pie_cfg->qdelay_ref / 2; /* PIE is active but the queue is not congested: return 0 */ if (((pie->qdelay_old < qdelay) && (pie->drop_prob < 0.2)) || -- 2.35.1