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 5C210A0547; Thu, 26 May 2022 22:27:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53C3C427F6; Thu, 26 May 2022 22:27:03 +0200 (CEST) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id 8D4FD427EA for ; Thu, 26 May 2022 22:26:59 +0200 (CEST) Received: by mail-pf1-f169.google.com with SMTP id f21so2611740pfa.3 for ; Thu, 26 May 2022 13:26:59 -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=g8fWd22d9lhdBdoYiveh2b6jxc4/6ls7rF3HsNbCfnrrtbA9nI42kQ+lMuxwCq2T79 hCMh+4Es0Fwa59r16LOFMw3/H967cE16zBK5VLvdJctHOdbJCZOi4K3RNCIFZ7wNeu+Q MIR3jF+995swnMlwnhMwygx+2vFo99IXvD99pLhbPdZoqr9Urdz5PVAqImTz77CljLzF jQuDCNcqrl63N7+Xf8nZ5bo5eCOo/AOPCqQUq9OLV7Pj+UHcgq+ts2Zy5R5HprI6Gof+ q9h2ukMLUgQLne7ulvqT/w2axo90yDnKEqK/UltvI8EwaCy1hJChjVVCrz031aVJgvyi UJ0A== 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=NxYqYnFxpdyRFSGc5nD9UBj4nAdnJDG1zgw1tySBI5nfDOLbMe3ONabLsP4ZVyvFb0 +ubd93czmpTT/CB91P1lkO1RuON33MJRFLJpLWEV9jzQy0zwR1D8vV+SvHvfPRKTkVck mv0EqzTxyUXSfh5LNhgVx4jFEHplynwTwHEkmA6sutv3DghFtp4hDZYfF8LFaK9LGSs3 IteIpFOV7WEOmSLbiZCesyEsEXWcELe75hQYWMFaC+/am0+1zcESMJCNt0XdVpcd/4av sAXv95WK96ClVU6afY8nTPf5C9v5A6mRxVKacDchWTVGezgfPn9PHOvGPnPmfVp1w0Zb WHuA== X-Gm-Message-State: AOAM530870Rq24oP5o588Wh/KFaRqNvf28fZf5BgAqYmBWbVDrPjNOZU VETDz28S6XLth5XrhFMQVNakFNxDHSfD2w== X-Google-Smtp-Source: ABdhPJzO5VByhVlAbspzlXLYcYcTU7/iPeCQFAoQ9ZaNyo8Cuj6RvRTb6gFa50Moj+C5vIGQFt86cw== X-Received: by 2002:aa7:8dd8:0:b0:518:11:18db with SMTP id j24-20020aa78dd8000000b00518001118dbmr40490815pfr.29.1653596818515; Thu, 26 May 2022 13:26:58 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id c20-20020a170902b69400b0015e8d4eb1e5sm2025316pls.47.2022.05.26.13.26.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 13:26:57 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu , Jasvinder Singh , Wojciech Liguzinski Subject: [PATCH v5 2/3] rte_pie: remove unnecessary floating point Date: Thu, 26 May 2022 13:26:52 -0700 Message-Id: <20220526202653.99796-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220526202653.99796-1-stephen@networkplumber.org> References: <20220524184623.480646-1-stephen@networkplumber.org> <20220526202653.99796-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