From: Ferruh Yigit <ferruh.yigit@intel.com>
To: David Marchand <david.marchand@redhat.com>,
"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>,
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
Date: Mon, 27 Apr 2020 15:07:10 +0100 [thread overview]
Message-ID: <0cf3b3a6-948e-6e96-0928-f0d9a53300f8@intel.com> (raw)
In-Reply-To: <CAJFAV8wkVZ5TiYaXR5QPV89kZ6t4+xOcMLkDEkENgD3eSrCxWA@mail.gmail.com>
On 4/27/2020 3:00 PM, David Marchand wrote:
> 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 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 <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_flow.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 = {
>>>>> .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),
This is something else but if the value is 'UINT64_MAX', do we need 'RTE_BE64'
macro?
>
> 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
>
next prev parent reply other threads:[~2020-04-27 14:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 13:23 [dpdk-dev] [PATCH 0/3] 20.05-rc1 fixes for OVS David Marchand
2020-04-27 13:23 ` [dpdk-dev] [PATCH 1/3] ring: fix build with -Wswitch-enum David Marchand
2020-04-27 14:55 ` Ananyev, Konstantin
2020-04-27 13:23 ` [dpdk-dev] [PATCH 2/3] eal: fix typo in endian conversion macros David Marchand
2020-04-27 13:35 ` Bruce Richardson
2020-04-27 13:23 ` [dpdk-dev] [PATCH 3/3] ethdev: fix build warning on 64-bit value David Marchand
2020-04-27 13:33 ` Andrew Rybchenko
2020-04-27 13:34 ` Bruce Richardson
2020-04-27 13:36 ` David Marchand
2020-04-27 13:46 ` Ananyev, Konstantin
2020-04-27 14:00 ` David Marchand
2020-04-27 14:07 ` Ferruh Yigit [this message]
2020-04-27 14:12 ` David Marchand
2020-04-27 14:14 ` Ferruh Yigit
2020-04-28 9:27 ` Thomas Monjalon
2020-05-06 14:37 ` Morten Brørup
2020-04-27 13:39 ` Andrew Rybchenko
2020-04-27 13:40 ` David Marchand
2020-04-27 13:43 ` Bruce Richardson
2020-04-28 9:53 ` [dpdk-dev] [PATCH 0/3] 20.05-rc1 fixes for OVS David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0cf3b3a6-948e-6e96-0928-f0d9a53300f8@intel.com \
--to=ferruh.yigit@intel.com \
--cc=arybchenko@solarflare.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=orika@mellanox.com \
--cc=thomas@monjalon.net \
--cc=xiao.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).