patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: dev@dpdk.org, Harry van Haaren <harry.van.haaren@intel.com>,
	Remy Horton <remy.horton@intel.com>,
	Reshma Pattan <reshma.pattan@intel.com>,
	stable@dpdk.org
Subject: Re: [PATCH] latencystats: fix missing f suffix on literal float
Date: Mon, 15 Apr 2024 15:17:38 -0700	[thread overview]
Message-ID: <20240415151738.2b85fc05@hermes.local> (raw)
In-Reply-To: <1713216746-25584-1-git-send-email-roretzla@linux.microsoft.com>

On Mon, 15 Apr 2024 14:32:26 -0700
Tyler Retzlaff <roretzla@linux.microsoft.com> 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 <roretzla@linux.microsoft.com>
> ---
>  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.


  reply	other threads:[~2024-04-15 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 21:32 Tyler Retzlaff
2024-04-15 22:17 ` Stephen Hemminger [this message]
2024-04-15 23:14   ` Tyler Retzlaff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240415151738.2b85fc05@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=remy.horton@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).