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 52D2FA0548; Wed, 25 May 2022 22:31:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CA0742685; Wed, 25 May 2022 22:31:33 +0200 (CEST) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id AD2F941133 for ; Wed, 25 May 2022 22:31:30 +0200 (CEST) Received: by mail-pj1-f45.google.com with SMTP id u12-20020a17090a1d4c00b001df78c7c209so2638530pju.1 for ; Wed, 25 May 2022 13:31: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=RAzbMDFiIwiPJhzEkWWAkxxdDj6dwlxR+qdCBT14VP0=; b=7q4BKYZax0zAc1PKz3ycbAtlpXPBCJQQBFm2jultHw+4/j4OvRd9d0yZduKjuu88o0 7gYoVk5OkQuws8sXLlCAlhDipccw2bsUXg7lKpfidBeAJBQ6uTuNfXKFb+rtawNoqYXN q7Z2nnrN+0r+r63tS/n9+8Z7fBbCTp5rW1KSYM00RONYTzs8VrfVpl6epeVrZkLhFMQL B7qq6xKQq3bhoZkbF8gaVoTmMe71+GdlOZAxoR/usvhz/Rx5yu/etWdfY+x/O3A1aa5U n2xlDr+BylVcTvVKfQAOQq8C/QFszoCkJEpCC9HdlxByIEPsIJaOQ78VyanQ0fEkz+AW HlqQ== 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=RAzbMDFiIwiPJhzEkWWAkxxdDj6dwlxR+qdCBT14VP0=; b=ELCf9aPb+FSIXVzFiCxEZoN4i24vp3WLDLZsP0ziCf6+p+xMtwHpgVumAHGBRVFqZW 2CvfBufyH1LtRvTiNhpbf/oXmpWyofYXkVxjEh6pakQKqWdFQH/MG09VyKNYx51Eoc5p rIs0olaD3FcopBjx9OVqDvUrGH5uKoSKGy4WLyXdbNphSQm2jK7v0Yfmae9dK4PE8Uix 62S/mQyk8SyQ71C7R2Si+BR2ZkXkvHTkfuNb5wFGsFxGL12KKKzuugsbZCRhnso9wKZ1 hfgFr/1mxzgalPPZwQTz3i8dpqYTFTiZm+vTvD6GhweizW2u5ZY9CC/XsmGVYORqFpam pblA== X-Gm-Message-State: AOAM530HZP7SFOqDrPM+qs73QXDNNStOuoKM0YDZUN0Jwi13yr6H57AL PDIUQbmp9dEt1Gf1ZNXI46dmrlWQL8vt8Q== X-Google-Smtp-Source: ABdhPJxbKw7lYC51NSCOW8Td9UVYiYj3+GsnyE9Ild+OxDZ7RZW/DK97lIKFFCivjNOS/BHbSow05A== X-Received: by 2002:a17:902:c952:b0:162:14b6:3179 with SMTP id i18-20020a170902c95200b0016214b63179mr19730122pla.7.1653510689267; Wed, 25 May 2022 13:31:29 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id a26-20020a62d41a000000b0050dc7628176sm11766091pfh.80.2022.05.25.13.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 13:31:28 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu , Jasvinder Singh , Wojciech Liguzinski Subject: [PATCH v4 2/3] rte_pie: remove unnecessary floating point Date: Wed, 25 May 2022 13:31:22 -0700 Message-Id: <20220525203123.277180-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220525203123.277180-1-stephen@networkplumber.org> References: <20220524184623.480646-1-stephen@networkplumber.org> <20220525203123.277180-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") 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