]> git.droids-corp.org - dpdk.git/commitdiff
sched: remove unnecessary floating point
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 26 May 2022 20:26:52 +0000 (13:26 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 22 Jun 2022 09:11:44 +0000 (11:11 +0200)
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: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
lib/sched/rte_pie.h

index 02a987f54ad1cfe0f688ed383d8d91b472c4d52d..3e2c1ef4672111a808d803d880ad87df63af97b6 100644 (file)
@@ -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)) ||