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 93CF643E80 for ; Tue, 16 Apr 2024 00:17:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8509D402E4; Tue, 16 Apr 2024 00:17:43 +0200 (CEST) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mails.dpdk.org (Postfix) with ESMTP id 40359402AE for ; Tue, 16 Apr 2024 00:17:41 +0200 (CEST) Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-53fa455cd94so3013523a12.2 for ; Mon, 15 Apr 2024 15:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1713219460; x=1713824260; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=x4DitTcO+SzuhJlD4y9XCBfIA3azIE9i2Cw5aKFw7hE=; b=yoG/YBzc7Wll05+dpZu28Ki8voLV7p1oimssWLWILG9BkQ1TO0qX3Y4RqosMq4Znmv 70N1MCb9pOWnCJKvaft0Ccn6R23XdRtExF33W3OSt4RlSKHG5tWZH3EsMW059ScQDfY9 zMWjxGDvs05mb+xYK97V4SvYAADntwJ6hLrFgBdIgg/CM5O5LpcbEqE2Fx1YHSeDdKEm IHlxPUZ6LhhrAcp0pULN6XUEuSzDUgO0Mk1lJ5cKTnpOz3YCs4+XcDkujgcN3oeA/qb7 UglFNQ3QgM9hqiiysfMrsDCI9vFZfhh/ooImiilmVzP76tVkXFdymGknQKFOKRTbeUvP cR0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713219460; x=1713824260; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x4DitTcO+SzuhJlD4y9XCBfIA3azIE9i2Cw5aKFw7hE=; b=awfQk3eEe+rpqktKynq5DTQ2+Vry/3GlhTacUWRnwW874CWTfJPcmrPqLEyk7c8fJX zluyi5OD2GjO9R3d1AaZ/hZ2eypy6lR0A5zV6xX8gp6b9BgDEIa/di2jFGytwM9uFlJA xbSXPU4+cadM855Qymw9gGAx3gT0nFzFejAvZYoFp5lxCQTI9tspiStFF7HCKwSXIVrz 9I42xMvNio8bE0HJhrEkVZ5sICLEPQbg4FYm2Ye7OeKfVEvkyQrN0CSJBbmMlsx8hpOE bNfe6CsIB/sib9WMrtZ3wVeheTKJHTQpQUOaCs6VprP/KsKEfwiBX0Z7S2JnevGrzPuJ fh/w== X-Forwarded-Encrypted: i=1; AJvYcCUhucTvCCvEbk/3XWQ1yH5U5fMk1EI38krx94+iF1zVPTFjb2l2qY2OaxMm0wnQOvOFd2+UY9L/AsOLdwbNTM0= X-Gm-Message-State: AOJu0Yzk/fwlbYHauIP3pmm+mlvvHHfhoYDn+y7RNF2XggkX7O3UUJKb IBLWxyLaNwlYYrTSPEKqCn7nJyZE248iX2XrPVyBkiGCJHgtkFWw929LSKjqLXI= X-Google-Smtp-Source: AGHT+IH3FoG6I9PRuWWvW/DTUElO8EzZn3658T8nMMi5T44qEo/Ka0HaguFC4C7cP1gaHj9D6njnIQ== X-Received: by 2002:a05:6a21:78a2:b0:1a7:186:f976 with SMTP id bf34-20020a056a2178a200b001a70186f976mr10236830pzc.40.1713219460290; Mon, 15 Apr 2024 15:17:40 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id m13-20020aa78a0d000000b006eaaaf5e0a8sm7657990pfa.71.2024.04.15.15.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 15:17:40 -0700 (PDT) Date: Mon, 15 Apr 2024 15:17:38 -0700 From: Stephen Hemminger To: Tyler Retzlaff 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: <20240415151738.2b85fc05@hermes.local> In-Reply-To: <1713216746-25584-1-git-send-email-roretzla@linux.microsoft.com> References: <1713216746-25584-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 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.