From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CBC7DA00BE; Tue, 28 Apr 2020 11:27:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B36A61D5EA; Tue, 28 Apr 2020 11:27:49 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 574D41D5CE for ; Tue, 28 Apr 2020 11:27:48 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B6AB65C009B; Tue, 28 Apr 2020 05:27:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 28 Apr 2020 05:27:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= SwHkM6vmqV6wbUF3mjaoi02wmy5tE+dO1TrXu8ly14k=; b=w6LfDgigCsqYaj2C njWK0QvBf8KK40LlePj9gJxKgLofOBCcw65O3iJIOLX8spp4mrfulMpRsqLkZBSy h4H9Z763+3iVhEzHvcs1f/KnVWd8pMaGK5GWABmP26fltRNwPg09bt9/pT2KoxVa 3zMlkHFx/ZCJMKO0BY0rKE/fTFeDO+j/aG0YRcxl/TIuxtjJOgzxz7EQev34gi1W EDmmZdJplOBoCuKL05UMHOAhcdkDCWG43B7MY8o9Hv5PaSaPpADF5+VCl9KbdkNe Gj6IMRXUp+NSEEtIQ7chDG76STGRuetio5LKkCGMl0hcYNimcfOQ8QOsuSqr+OjA B36iGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=SwHkM6vmqV6wbUF3mjaoi02wmy5tE+dO1TrXu8ly1 4k=; b=hzR42LSz1zqHnBLUnMdL1xIBzIE9iEIoxs5QeCwNfujAvGMkkeLoHsHDb wMXTkhGhnPXBgW29PiO0jYArEQ+6GYmwJSY/pLORGRJC10TsZZrWKoDoJYjaZL/Z HvbeexyT4k/J1tCaBI9/Z+sifFCVAMAZ1jF54QmiIoeowYhAc/CCDmBEkGAi+p7r e3o9m2OqkgeipXfvQsYpP4Uy+qut3keSrDM/ZtIpC3FNfMIOuEa/5WDxCcomxXq2 ngmhwolE+KytNYwHj1RM99bo0wcPelgSiwHLGk76GiAtEHGxq6VOC78SKEzMHIJJ OQB3+05F1D1mQO8jUKB57xzSWaqnQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedriedugdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 9FE383065E9E; Tue, 28 Apr 2020 05:27:45 -0400 (EDT) From: Thomas Monjalon To: David Marchand Cc: "Ananyev, Konstantin" , dev@dpdk.org, "Richardson, Bruce" , Ori Kam , "Yigit, Ferruh" , Andrew Rybchenko , "Zhang, Xiao" Date: Tue, 28 Apr 2020 11:27:44 +0200 Message-ID: <1847700.fxN4lLDhpz@thomas> In-Reply-To: References: <20200427132341.27681-1-david.marchand@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 3/3] ethdev: fix build warning on 64-bit value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 27/04/2020 16:00, David Marchand: > On Mon, Apr 27, 2020 at 3:47 PM Ananyev, Konstantin wrote: > > From: dev On Behalf Of David Marchand > > > On Mon, Apr 27, 2020 at 3:34 PM Bruce Richardson > > > wrote: > > > > On Mon, Apr 27, 2020 at 03:23:41PM +0200, David Marchand wrote: > > > > > Building OVS with dpdk, sparse complains about 64-bit constant being > > > > > passed as a normal integer that can't fit it: > > > > > error: constant 0xffffffffffffffff is so big it is unsigned long > > > > > > > > > > Fixes: ecbc8570131d ("ethdev: add PFCP header to flow API") > > > > > > > > > > Signed-off-by: David Marchand > > > > > --- > > > > > --- a/lib/librte_ethdev/rte_flow.h > > > > > +++ b/lib/librte_ethdev/rte_flow.h > > > > > static const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask = { > > > > > .s_field = 0x01, > > > > > - .seid = RTE_BE64(0xffffffffffffffff), > > > > > + .seid = RTE_BE64(UINT64_C(0xffffffffffffffff)), > > > > > > > > Rather than cast, why not put "ULL" at the end. If we are going to cast, > > > > why not just put "-1" in to save some digits. > > > > > > I preferred this form in the hope future developers who want > > > 0x0fffffffffffffff will copy/paste this. > > > > > > > As I remember there should be UINT64_MAX in stdint.h. > > Yes, we could go with: > + .seid = RTE_BE64(UINT64_MAX), > > And then next time, for any value like 0x0fff ffff ffff ffff (had to > group the digits of what I had written), pretty sure we will miss this > and I will catch it only when building ovs. I agree with David (in general and especially here). RTE_BE64 is required for static analyzers and is an explicit info. UINT64_C is better than ULL suffix because it - is generic - gives size explicitly UINT64_C(0xffffffffffffffff) is better than UINT64_MAX because - rte_flow.h has a lot of bitmasks - it is copy/paste safe Acked-by: Thomas Monjalon