DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>,
	Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
Cc: Raslan Darawsheh <rasland@mellanox.com>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>,
	John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"ajit.khaparde@broadcom.com" <ajit.khaparde@broadcom.com>
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v10] ethdev: add HIGIG2 key field to flow API
Date: Wed, 23 Oct 2019 15:14:32 +0100	[thread overview]
Message-ID: <dfd57d07-182a-45ad-f35e-a1cb5e97244d@intel.com> (raw)
In-Reply-To: <20191023140444.GN25286@glumotte.dev.6wind.com>

On 10/23/2019 3:04 PM, Olivier Matz wrote:
> On Wed, Oct 23, 2019 at 11:43:58AM +0000, Kiran Kumar Kokkilagadda wrote:
>>> -----Original Message-----
>>> From: Olivier Matz <olivier.matz@6wind.com>
>>> Sent: Wednesday, October 23, 2019 5:09 PM
>>> To: Raslan Darawsheh <rasland@mellanox.com>
>>> Cc: Ferruh Yigit <ferruh.yigit@intel.com>; Kiran Kumar Kokkilagadda
>>> <kirankumark@marvell.com>; Adrien Mazarguil
>>> <adrien.mazarguil@6wind.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>;
>>> Jingjing Wu <jingjing.wu@intel.com>; Bernard Iremonger
>>> <bernard.iremonger@intel.com>; John McNamara
>>> <john.mcnamara@intel.com>; Marko Kovacevic <marko.kovacevic@intel.com>;
>>> Thomas Monjalon <thomas@monjalon.net>; Andrew Rybchenko
>>> <arybchenko@solarflare.com>; dev@dpdk.org; ajit.khaparde@broadcom.com
>>> Subject: [EXT] Re: [dpdk-dev] [PATCH v10] ethdev: add HIGIG2 key field to flow
>>> API
>>>
>>> External Email
>>>
>>> ----------------------------------------------------------------------
>>> Hi,
>>>
>>>
>>>
>>> On Wed, Oct 23, 2019 at 10:50:52AM +0000, Raslan Darawsheh wrote:
>>>
>>>> Hi,
>>>
>>>>
>>>
>>>> This patch broke the compilation of MLX5 PMD in debug mode:
>>>
>>>>
>>>
>>>>                  from /root/dpdk/x86_64-native-linux-
>>> gcc/include/rte_ethdev_driver.h:18,
>>>
>>>>                  from /root/dpdk/drivers/net/mlx5/mlx5_mp.c:11:
>>>
>>>> /root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:112:2: error: type of
>>> bit-field 'opcode' is a GCC extension [-Werror=pedantic]
>>>
>>>>   uint16_t opcode:3;
>>>
>>>>   ^
>>>
>>>> /root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:113:2: error: type of
>>> bit-field 'resv1' is a GCC extension [-Werror=pedantic]
>>>
>>>>   uint16_t resv1:2;
>>>
>>>>   ^
>>>
>>>> /root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:114:2: error: type of
>>> bit-field 'src_t' is a GCC extension [-Werror=pedantic]
>>>
>>>>   uint16_t src_t:1;
>>>
>>>>   ^
>>>
>>>> /root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:115:2: error: type of
>>> bit-field 'pfm' is a GCC extension [-Werror=pedantic]
>>>
>>>>   uint16_t pfm:2;
>>>
>>>>   ^
>>>
>>>> /root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:116:2: error: type of
>>> bit-field 'resv2' is a GCC extension [-Werror=pedantic]
>>>
>>>>   uint16_t resv2:5;
>>>
>>>>   ^
>>>
>>>> /root/dpdk/x86_64-native-linux-gcc/include/rte_higig.h:117:2: error: type of
>>> bit-field 'hdr_ext_len' is a GCC extension [-Werror=pedantic]
>>>
>>>>   uint16_t hdr_ext_len:3;
>>>
>>>>
>>>
>>>> and this is with gcc 4.8.5
>>>
>>>
>>>
>>> From https://urldefense.proofpoint.com/v2/url?u=https-
>>> 3A__stackoverflow.com_questions_10906238_warning-2Dwhen-2Dusing-
>>> 2Dbitfield-2Dwith-2Dunsigned-
>>> 2Dchar&d=DwIBAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=owEKckYY4FTmil1Z6oBUR
>>> wkTThyuRbLAY9LdfiaT6HA&m=GZ-
>>> 6cngPycaUlGJT20VEOf9oTcp5PMwk7j1JV1vAQfs&s=SCg5yVPS4zZa8GSn9bl_eUtI
>>> vBmoDzi35PspWUttIUY&e=
>>>
>>> it seems that it is allowed in c99, so I guess it's a gcc 4.8 bug.
>>>
>>>
>>>
>>> Adding __extension__ above the struct solves the warnings, I suggest to
>>>
>>> add it.
>>
>> /**
>>  *
>>  * higig2 ppt type1 header.
>>  */
>> RTE_STD_C11
>> struct rte_higig2_ppt_type1 {
>>         uint16_t classification;
>>         uint16_t resv;
>>         uint16_t vid;
>> #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
>>         uint16_t opcode:3;
>>         uint16_t resv1:2;
>>         uint16_t src_t:1;
>>         uint16_t pfm:2;
>>         uint16_t resv2:5;
>>         uint16_t hdr_ext_len:3;
>> #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
>>         uint16_t pfm:2;
>>         uint16_t src_t:1;
>>         uint16_t resv1:2;
>>         uint16_t opcode:3;
>>         uint16_t hdr_ext_len:3;
>>         uint16_t resv2:5;
>> #endif
>> };
>>
>> I have already added it. RTE_STD_C11 , this is a macro for __extension__. 
>> /** C extension macro for environments lacking C11 features. */
>> #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
>> #define RTE_STD_C11 __extension__
>> #else
>> #define RTE_STD_C11
>> #endif
> 
> The __extension__ is only added if compiled for < c11.
> But there is apparently a problem with gcc-4.8: even in c11, it does
> not support bitfields on u16. See: https://godbolt.org/z/hRIbgg
> 
> On gcc-4.9, the problem disappeared: https://godbolt.org/z/kkzz9v
> 
> So as a workaround, using __extension__ should work, probably with a short
> explanation.
> 

Thanks Olivier, this was also our finding with Raslan and he sent the fix already.
https://patches.dpdk.org/patch/61748/

Also it looks like gcc4.8 thinks this is not c11 standard but extension only for
uint16_t type, structs with uint32_t bit-fieds works as expected.

  reply	other threads:[~2019-10-23 14:14 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14  4:29 [dpdk-dev] [PATCH] " kirankumark
2019-10-14  7:08 ` Andrew Rybchenko
2019-10-15  4:23   ` [dpdk-dev] [EXT] " Kiran Kumar Kokkilagadda
2019-10-15  6:20 ` [dpdk-dev] " kirankumark
2019-10-15  6:27   ` Jerin Jacob
2019-10-15  6:57     ` [dpdk-dev] [EXT] " Kiran Kumar Kokkilagadda
2019-10-15  8:22     ` [dpdk-dev] " Ananyev, Konstantin
2019-10-15  8:32   ` [dpdk-dev] [PATCH v3] " kirankumark
2019-10-17  4:15     ` [dpdk-dev] [PATCH v4] " kirankumark
2019-10-17  9:08       ` Andrew Rybchenko
2019-10-18  4:13       ` [dpdk-dev] [PATCH v5] " kirankumark
2019-10-18  7:36         ` Andrew Rybchenko
2019-10-18 17:36         ` Ferruh Yigit
2019-10-19  4:51           ` [dpdk-dev] [EXT] " Kiran Kumar Kokkilagadda
2019-10-19  4:56         ` [dpdk-dev] [PATCH v6] " kirankumark
2019-10-19  9:47           ` Jerin Jacob
2019-10-20  4:52           ` [dpdk-dev] [PATCH v7] " kirankumark
2019-10-20 13:56             ` Jerin Jacob
2019-10-21  3:52             ` [dpdk-dev] [PATCH v8] " kirankumark
2019-10-21  9:16               ` [dpdk-dev] [PATCH v9] " kirankumark
2019-10-21 16:48                 ` Olivier Matz
2019-10-22  4:16                 ` [dpdk-dev] [PATCH v10] " kirankumark
2019-10-22  9:19                   ` Ferruh Yigit
2019-10-23 10:50                     ` Raslan Darawsheh
2019-10-23 11:39                       ` Olivier Matz
2019-10-23 11:43                         ` [dpdk-dev] [EXT] " Kiran Kumar Kokkilagadda
2019-10-23 14:04                           ` Olivier Matz
2019-10-23 14:14                             ` Ferruh Yigit [this message]
2019-10-23 22:04                   ` [dpdk-dev] " Thomas Monjalon
2019-10-15 16:47 ` [dpdk-dev] [PATCH] " Stephen Hemminger
2019-10-16  3:14   ` [dpdk-dev] [EXT] " Kiran Kumar Kokkilagadda

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=dfd57d07-182a-45ad-f35e-a1cb5e97244d@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=arybchenko@solarflare.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=kirankumark@marvell.com \
    --cc=marko.kovacevic@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=rasland@mellanox.com \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@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).