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 8B48143E80 for ; Tue, 16 Apr 2024 01:14:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81576402E3; Tue, 16 Apr 2024 01:14:09 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 6D7604027F; Tue, 16 Apr 2024 01:14:06 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 94F1A20FC5F5; Mon, 15 Apr 2024 16:14:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 94F1A20FC5F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1713222845; bh=Rr/7AOhnI6nOa24yJOu+FBUHJP90ludGsgMmWst6MA4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OkGJ6EkZJax9ZFrnIkfvCz+OM3TAtq3FtzwcBnsi7/uKI+uG4/tifeiKQSExo1yqg /gchxnhrBFG7XILT355qL267KrrV1pacgx9z3qN6iTKxbVAOUJBUMtq1oaniAjvQws GhHfZWjaP/NW85c7efgBUvoJ/Vg3JkqGA1I2sg2w= Date: Mon, 15 Apr 2024 16:14:05 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org, Harry van Haaren , Remy Horton , Reshma Pattan , stable@dpdk.org Subject: Re: [PATCH] latencystats: fix missing f suffix on literal float Message-ID: <20240415231405.GA31632@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1713216746-25584-1-git-send-email-roretzla@linux.microsoft.com> <20240415151738.2b85fc05@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240415151738.2b85fc05@hermes.local> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Mon, Apr 15, 2024 at 03:17:38PM -0700, Stephen Hemminger wrote: > On Mon, 15 Apr 2024 14:32:26 -0700 > Tyler Retzlaff wrote: > > > Add missing f suffix to floating point literal to avoid warning about > > truncation from double to float. > > > > Fixes: 5cd3cac9ed22 ("latency: added new library for latency stats") > > Cc: reshma.pattan@intel.com > > Cc: stable@dpdk.org > > > > Signed-off-by: Tyler Retzlaff > > --- > > lib/latencystats/rte_latencystats.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c > > index 4ea9b0d..cae4b50 100644 > > --- a/lib/latencystats/rte_latencystats.c > > +++ b/lib/latencystats/rte_latencystats.c > > @@ -166,7 +166,7 @@ struct latency_stats_nameoff { > > * a constant smoothing factor between 0 and 1. The value > > * is used below for measuring average latency. > > */ > > - const float alpha = 0.2; > > + const float alpha = 0.2f; > > > > now = rte_rdtsc(); > > for (i = 0; i < nb_pkts; i++) { > > The use of floating point in fast path here is unnecessary. > Even without doing the full per-core values, this could just change > to an alpha of .25 and use fast fixed point math. agree, though my thoughts are make this code correct optimization is for the maintainer. if they submit an alternate series i can withdraw this patch. otherwise i think we should take it as-is.