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 91BC1A0543; Tue, 24 May 2022 20:46:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0582640A87; Tue, 24 May 2022 20:46:31 +0200 (CEST) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mails.dpdk.org (Postfix) with ESMTP id B03A5400D6 for ; Tue, 24 May 2022 20:46:29 +0200 (CEST) Received: by mail-pg1-f170.google.com with SMTP id a9so15013549pgv.12 for ; Tue, 24 May 2022 11:46:29 -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=wvZimvJ/Ieo5oR0E7DPdIDUss9oRBYGfgxGYD13x/uFwniGv2N4In9TcifTtdqvHtP 3NMJG8ui/9qnVbgumo9pE9/WcvZpK833dBmJHcFvD+r0ytg4/WXT5EWJyjr9cPMJ2c2V g54cAu7CVbfdyMzRSr+//XYYkBg2/SWXHm8E2Q0MMkNnDgQAtCfifmF13RCn9kAr9m05 ZkdbrZuSmJKs0vXiH65Hb7/q5hPQYUYrMd0VNd0EDCUvI4NpirY0p9CBqV/dLJC2kW3j If+rgfSro3XG17lqNhlwp1Knmkd15zcc5XWJ9I62Z5sM8Aio+4QSZ2+YI/Jjek2d3mIL ZmEQ== 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=Uuh0aKJN/HJbUJUs78q7udKsDPCTbxNVaM5dAV5KNGmaVDOMDcFatuLZfJntXJv+TC wq1iEVGBNUTnfBh/EVpjAd3Nsx3rY9sufB5ZgyiRWkooV8SH118QXQXIlCOi2Jkwq8xI o4eOxA6op5M8/3hzO29UaEEluPeAwVd2j9Qft8X+dmFL9YrfpBY/BO8pI/34PkblGePM YKEO7GoXMh4LwR5crTrN8QWV2yIsOxVulZfgDOldjpgH2e0sGx0PTQerFVC+69nioY+1 S+WpTBfzLwpgxEbAisIM+t9kyQEPVTukLftun12uo55isYcAYvHnfpPWYmnv9NF8FMDk 2f1g== X-Gm-Message-State: AOAM532s1Tqso07X5LnJ3zJ6azeYdr3LTy0rlb0dQselKUmki9fo1/6r ruSuUOuhgBp4gy2g32XKKs3rAKAob+WTpw== X-Google-Smtp-Source: ABdhPJz9Ph84xV0FEBq+zZWgqWTU6TvRk2bQBz5mrd/m/NXyqScCG5uG8rNp2KqZOriqVQSaPaiQqw== X-Received: by 2002:a63:3541:0:b0:3f5:dc5a:2f80 with SMTP id c62-20020a633541000000b003f5dc5a2f80mr25306451pga.262.1653417988609; Tue, 24 May 2022 11:46:28 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id c21-20020a17090ab29500b001cd4989ff42sm63443pjr.9.2022.05.24.11.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 11:46:28 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , wojciechx.liguzinski@intel.com, Cristian Dumitrescu , Jasvinder Singh Subject: [RFT 1/2] rte_pie: remove unnecessary floating point Date: Tue, 24 May 2022 11:46:21 -0700 Message-Id: <20220524184623.480646-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220524184623.480646-1-stephen@networkplumber.org> References: <20220524184623.480646-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