From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 70CA6A00BE;
	Mon, 27 Apr 2020 16:00:40 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 561891D54D;
	Mon, 27 Apr 2020 16:00:40 +0200 (CEST)
Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com
 [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 8836B1BF59
 for <dev@dpdk.org>; Mon, 27 Apr 2020 16:00:39 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1587996038;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=S1c5XLys7r7n7Z5tbsDhjsacEEbW0qBF+rZfGEml9xg=;
 b=e1x7fxac5mOKh/te4Yw6O7BHnkZrYFOqfpb94ALeFbJMLJtThu7SIb1EN2PTSVWuCimlBL
 D6EUZRDKxoZ/Pb8ri2MS/UijQflD1M4l4nNXHQngzGGmwdShwppYAt2hTqple/LV4B23U3
 yP/6MWOTZlu3/FsXNm4VesfHYtLcMbk=
Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com
 [209.85.222.69]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-385-sLJLMXxUN0mC_quOoJtijA-1; Mon, 27 Apr 2020 10:00:35 -0400
X-MC-Unique: sLJLMXxUN0mC_quOoJtijA-1
Received: by mail-ua1-f69.google.com with SMTP id q18so9753230uap.4
 for <dev@dpdk.org>; Mon, 27 Apr 2020 07:00:35 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=TeBfurBc0Pgsai/y5ej9hBiXpHgd4U4pizS7SbVMqCo=;
 b=VqE4/TsPskKERSFvZclL3NZMCPPgehVV9KChbFl6krOgNml/fjYEUt4d96es3+ZO5Y
 wivOEn5O+Q2rllyb7fILvhI7u/HX/XGY0mihwdfBU6YgUiJaYEniE2VHnivqn8Ypztc6
 Dij8lgr8DTCBmSgC8jG48DVbqHgTqKcsA8plzEBGPj9VNESSuQlfngC0emmrLBYmeF4b
 MTaVBhbB+zEuZMByKEhtAMGQk+zCV5ZZAvH6cWTwk+RGXrORFd/crci1pVeCyUczJ96r
 7QZo1/H9JfydwHZrGt8TFcerIiZvz2mKyNlZ8Hva/oadaLf+8uCdhtyE7Qcw530ntwYP
 rUYA==
X-Gm-Message-State: AGi0Puba/+7WZ9Ieu279mgfDBvZ8/z1+imIb5YBzJSQV878cuVERXg25
 gRRipOXpfGY6CXvxX/8lDPv6+Ez36uP23n1wjhne1IOJNrJZVWG4sZnHBq57Upon4D54DfmGnK9
 7PnYeOwxKRUTeobhWwCw=
X-Received: by 2002:a05:6102:4d:: with SMTP id
 k13mr17114051vsp.198.1587996034587; 
 Mon, 27 Apr 2020 07:00:34 -0700 (PDT)
X-Google-Smtp-Source: APiQypKBcHYLL3ErDRf9kJEVcePt4KVe4ksRvrRALBkLrsd6kaCeQLukcXKYvJmidO7R6sD8evfdwoglgHRnzCFbVDU=
X-Received: by 2002:a05:6102:4d:: with SMTP id
 k13mr17114023vsp.198.1587996034341; 
 Mon, 27 Apr 2020 07:00:34 -0700 (PDT)
MIME-Version: 1.0
References: <20200427132341.27681-1-david.marchand@redhat.com>
 <20200427132341.27681-4-david.marchand@redhat.com>
 <20200427133413.GA1848@bricha3-MOBL.ger.corp.intel.com>
 <CAJFAV8zeh7nuC3wDZa6BsKyQ_G30G7DUr3oZHWLomKCev4CPcw@mail.gmail.com>
 <BYAPR11MB3301D40FDA491E333E9D1D7F9AAF0@BYAPR11MB3301.namprd11.prod.outlook.com>
In-Reply-To: <BYAPR11MB3301D40FDA491E333E9D1D7F9AAF0@BYAPR11MB3301.namprd11.prod.outlook.com>
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 27 Apr 2020 16:00:23 +0200
Message-ID: <CAJFAV8wkVZ5TiYaXR5QPV89kZ6t4+xOcMLkDEkENgD3eSrCxWA@mail.gmail.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: "Richardson, Bruce" <bruce.richardson@intel.com>, dev <dev@dpdk.org>, 
 Ori Kam <orika@mellanox.com>, Thomas Monjalon <thomas@monjalon.net>, 
 "Yigit, Ferruh" <ferruh.yigit@intel.com>,
 Andrew Rybchenko <arybchenko@solarflare.com>, 
 "Zhang, Xiao" <xiao.zhang@intel.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Mon, Apr 27, 2020 at 3:47 PM Ananyev, Konstantin
<konstantin.ananyev@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of David Marchand
> > Sent: Monday, April 27, 2020 2:37 PM
> > To: Richardson, Bruce <bruce.richardson@intel.com>
> > Cc: dev <dev@dpdk.org>; Ori Kam <orika@mellanox.com>; Thomas Monjalon <=
thomas@monjalon.net>; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>;=
 Zhang, Xiao <xiao.zhang@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH 3/3] ethdev: fix build warning on 64-bit=
 value
> >
> > On Mon, Apr 27, 2020 at 3:34 PM Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > On Mon, Apr 27, 2020 at 03:23:41PM +0200, David Marchand wrote:
> > > > Building OVS with dpdk, sparse complains about 64-bit constant bein=
g
> > > > 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 <david.marchand@redhat.com>
> > > > ---
> > > >  lib/librte_ethdev/rte_flow.h | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_f=
low.h
> > > > index 132b44edc6..1fb94f35e8 100644
> > > > --- a/lib/librte_ethdev/rte_flow.h
> > > > +++ b/lib/librte_ethdev/rte_flow.h
> > > > @@ -1534,7 +1534,7 @@ struct rte_flow_item_pfcp {
> > > >  #ifndef __cplusplus
> > > >  static const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask =3D=
 {
> > > >       .s_field =3D 0x01,
> > > > -     .seid =3D RTE_BE64(0xffffffffffffffff),
> > > > +     .seid =3D RTE_BE64(UINT64_C(0xffffffffffffffff)),
> > >
> > > Rather than cast, why not put "ULL" at the end. If we are going to ca=
st,
> > > 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 =3D 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.


--
David Marchand