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 1DD54A0555; Wed, 25 May 2022 19:12:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EAA2041133; Wed, 25 May 2022 19:12:39 +0200 (CEST) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id 4566442670 for ; Wed, 25 May 2022 19:12:38 +0200 (CEST) Received: by mail-pg1-f180.google.com with SMTP id h186so19396366pgc.3 for ; Wed, 25 May 2022 10:12:38 -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=J9DaLWmcVol7QtevyyiH8DedyYubJituluZuya9NGfjCq6pnykg0Nmjy6hrCdQYXWo 8gBZjQ3lTiAnkrr5KSRO3HasqQwly71gMZbEhRXRcBrcr8+MxHClFdKu9tXLk24sT6H5 XNDnJJUmFRNwUGFZAFEZlVro7w2PszQxZ9/ugBOUQ+XMm9oHiVaIePgHCOY3Iq/ndVbg hy/KqnDICzGKoLOIvKjwi0rKcOPNeXivfb0Zz8PkojitKkZLo5R49JFk21PGj+QThMsJ I+NZvLYFty4M9gnyOq1fdum1zKOhuKYHl9QPzOLb60rS2BScClo7shfWLXlWW0UdzCG7 CITA== 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=spfmI3lAQYPgaoUApG+b5afZNotiXtrX0XJzzQsJvYz6i59SZtypPmfjJVhnYms85o KYUQ6bvDTehpKiRWl1am/rG/NiHc4mBvpMVlcLTfhe+C+dI/bV2fF6/VFtPKY20uW1ME ZNtmdhDUgmMcDRrStlBSeqJ3+NHH8qBvGI3KTG4ob+4QYqmIciJQQyGWLgrODLKIXzSR hUzAQBpaCubPz5EAwB1r54NQDzOor30snhJGkQuEvYQulSaXfO2K4rfmPA0tG1jut4r5 ug870GkyU3QGwopCjEZsowVpmARW0S2wF+qOQRzmLHQR5X/EauJ1lE7iv/ZRkRZMHQ6A c/kA== X-Gm-Message-State: AOAM530YxbcZYwGlyspfh+X99eRi8vrLWdlSSH0njehIgMc867wUTRzj ZFMGIao9EdpUo+/JHrYfOUmYd5Bvj4R3+A== X-Google-Smtp-Source: ABdhPJyjIBK2DEhWJ0HYcLhDU9kYFiHyloPakYxziZOa/pKCj+bgvVAqBo+54VA5quMui4ap8cWCdw== X-Received: by 2002:a63:f913:0:b0:3fa:2b27:bb82 with SMTP id h19-20020a63f913000000b003fa2b27bb82mr16203936pgi.213.1653498757241; Wed, 25 May 2022 10:12:37 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id s23-20020a170902b19700b001622c377c3esm6139599plr.117.2022.05.25.10.12.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 10:12:36 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , wojciechx.liguzinski@intel.com, Cristian Dumitrescu , Jasvinder Singh Subject: [PATCH v3 2/3] rte_pie: remove unnecessary floating point Date: Wed, 25 May 2022 10:12:29 -0700 Message-Id: <20220525171231.200035-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220525171231.200035-1-stephen@networkplumber.org> References: <20220524184623.480646-1-stephen@networkplumber.org> <20220525171231.200035-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