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 0996AA3295 for ; Wed, 23 Oct 2019 16:04:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A3D601C205; Wed, 23 Oct 2019 16:04:46 +0200 (CEST) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 5D8821C202 for ; Wed, 23 Oct 2019 16:04:44 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 3A6D733584F; Wed, 23 Oct 2019 16:04:44 +0200 (CEST) Date: Wed, 23 Oct 2019 16:04:44 +0200 From: Olivier Matz To: Kiran Kumar Kokkilagadda Cc: Raslan Darawsheh , Ferruh Yigit , Adrien Mazarguil , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic , Thomas Monjalon , Andrew Rybchenko , "dev@dpdk.org" , "ajit.khaparde@broadcom.com" Message-ID: <20191023140444.GN25286@glumotte.dev.6wind.com> References: <20191021091617.11290-1-kirankumark@marvell.com> <20191022041648.4812-1-kirankumark@marvell.com> <8339b371-b0db-480c-426c-2f1cae244d3b@intel.com> <20191023113913.GK25286@glumotte.dev.6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v10] ethdev: add HIGIG2 key field to flow API 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 Wed, Oct 23, 2019 at 11:43:58AM +0000, Kiran Kumar Kokkilagadda wrote: > > -----Original Message----- > > From: Olivier Matz > > Sent: Wednesday, October 23, 2019 5:09 PM > > To: Raslan Darawsheh > > Cc: Ferruh Yigit ; Kiran Kumar Kokkilagadda > > ; Adrien Mazarguil > > ; Wenzhuo Lu ; > > Jingjing Wu ; Bernard Iremonger > > ; John McNamara > > ; Marko Kovacevic ; > > Thomas Monjalon ; Andrew Rybchenko > > ; 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.