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 826C1A00BE; Mon, 27 Apr 2020 16:13:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DD2A71D506; Mon, 27 Apr 2020 16:13:12 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 565D31D452 for ; Mon, 27 Apr 2020 16:13:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587996790; 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=QwvLyIUqIgJm6tWYghb0rkno0rPUTgGNYuRJC19dq58=; b=MbSR3ZSoPRyNq1Q17+4hHDEC/QB4XJXR49nVpWhf0HJu493xwR0aFjUn6cu24YI8jlxAOs 0wDaM3jIo19rnxJawaIfCfEN/qzb4KIC3Yv7FFToQLdqLO98HWQnPm6lmDw7UJQm653Yk9 3kTzuddakvHBTsQW+uTFjAsTAfEbLEI= 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-74-J0ZivKmuPqOaTm94xREw3A-1; Mon, 27 Apr 2020 10:13:09 -0400 X-MC-Unique: J0ZivKmuPqOaTm94xREw3A-1 Received: by mail-ua1-f69.google.com with SMTP id x6so9754685uaj.13 for ; Mon, 27 Apr 2020 07:13:08 -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=Vdz/S6JiMHss8ymUMsX69iS+fz2QTUAJMiYty5hpL/k=; b=oFo61c6YGra+4aXZUR4iax+XHaGOwOzgV91e44v6jzw97ejCwczqQbp/yoA6JVgjKl 1FCUYQHTcv8xOhJr76k4sSfqVONFwsiHlr9cQ8Cq9+JNWdQE9qDAGbQOy2oQOlWxOmgP fdeE66GhijRUX/WrLIUbWMoGyVVKbgy2NlJKNA1psn5ylBKC867ycXp184VMfyBHlPM4 ZQ7aoLSjvp+atZ4DK7DnBMUIN3+JKP1KfZuFoAppWYb8IutB9pwJV/s8nyRxX6huOPOe MpFajUBschuSTaXUx6pjmau8xwWZeITFUYUGTfkuxBT46Lv6y0gz4PUsZRzrZNcOrYOd hBtA== X-Gm-Message-State: AGi0PuZLmGKpbBTcCRaPhpodzyS4WgoPtiJh46Q3wydzDyHSemOUDrG4 NcDYWLpvdpe2zxeFaENf6bYyQWFTXRBmOFaLqJQzw8vgJSDOMkTK86oErHhY4uPhlqBWEuryFbY 9/jzyNOsUWKa+agvMBas= X-Received: by 2002:a05:6102:382:: with SMTP id m2mr16860084vsq.141.1587996788467; Mon, 27 Apr 2020 07:13:08 -0700 (PDT) X-Google-Smtp-Source: APiQypI8hTDMUr2/bjL6g4nZdGSgemImr6sWWFv/Yiy9+vAeqgT1IHRFea7u1aPuoegXsUCR6huzJF99zsEEAG30TpI= X-Received: by 2002:a05:6102:382:: with SMTP id m2mr16860054vsq.141.1587996788036; Mon, 27 Apr 2020 07:13:08 -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> <0cf3b3a6-948e-6e96-0928-f0d9a53300f8@intel.com> In-Reply-To: <0cf3b3a6-948e-6e96-0928-f0d9a53300f8@intel.com> From: David Marchand Date: Mon, 27 Apr 2020 16:12:57 +0200 Message-ID: To: Ferruh Yigit Cc: "Ananyev, Konstantin" , "Richardson, Bruce" , dev , Ori Kam , Thomas Monjalon , Andrew Rybchenko , "Zhang, Xiao" 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Apr 27, 2020 at 4:07 PM Ferruh Yigit wrote= : > > On 4/27/2020 3:00 PM, David Marchand wrote: > > On Mon, Apr 27, 2020 at 3:47 PM Ananyev, Konstantin > > wrote: > >> > >> > >> > >>> -----Original Message----- > >>> From: dev On Behalf Of David Marchand > >>> Sent: Monday, April 27, 2020 2:37 PM > >>> To: Richardson, Bruce > >>> Cc: dev ; Ori Kam ; Thomas Monjalon= ; Yigit, Ferruh > >>> ; Andrew Rybchenko ; Zhang, Xiao > >>> Subject: Re: [dpdk-dev] [PATCH 3/3] ethdev: fix build warning on 64-b= it value > >>> > >>> 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 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 > >>>>> --- > >>>>> 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 c= ast, > >>>> 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), > > This is something else but if the value is 'UINT64_MAX', do we need 'RTE_= BE64' > macro? In OVS case, sparse validates that a rte_be64_t value (mapped to ovs_be64_t) is passed to .seid. .../build/install/usr/local/include/rte_flow.h:1537:17: error: incorrect type in initializer (different base types) .../build/install/usr/local/include/rte_flow.h:1537:17: expected restricted ovs_be64 [usertype] seid .../build/install/usr/local/include/rte_flow.h:1537:17: got unsigned lon= g --=20 David Marchand