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 8BC7F43E7F; Tue, 16 Apr 2024 00:17:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36B49402DC; Tue, 16 Apr 2024 00:17:42 +0200 (CEST) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mails.dpdk.org (Postfix) with ESMTP id 22B6540293 for ; Tue, 16 Apr 2024 00:17:41 +0200 (CEST) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-5f415fd71f8so2907120a12.3 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=G2HDH1t0e3ZGqkf7knQDW5h+BUfb244d533u3JKldR7xEmw+K2KjvmLC7FzjiMLMeo KXDLKYqN8bV+ZBdzzkwJ6I9thjlM1zs8D45FhVUlv9unsiu/ewr4v5n3tAL6FH6Xc9JF Sl7xHp5CTIC6vcs9DgS6zKvVBwea4OFqhF4n6YBbKYOV/5zLAEI91DD0DcGtwYpn72yM kz6xOo6gTr56H76wS5v/GGkTDBrXjupd1MExiVZQ8p/y+pcWLekhlw5YhT6MqIT8J1dB yOhBwSzvvxPDg6lONIh5kU/HY2Tsk1cXD6t3PRK2UOlEaojtZP6vqqPGHNzZCihdmkMS Nx8Q== X-Gm-Message-State: AOJu0Yzjxn3eZQqE5KqhrBp9lI/o3KshzTQexAYORfE2d1l9BTejOYwd PeQRxB1NDvQvCDuygMHcCuoDBWYmh0EXQ6FWcfpP8fKxFm1uko+FURAFt26GauE= 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: 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 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.