net: fix compilation with GRE header

Message ID 20181101124645.34952-1-shahafs@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net: fix compilation with GRE header |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Shahaf Shuler Nov. 1, 2018, 12:46 p.m. UTC
  The following error popped when compiling with -pedantic:

In file included from
/.autodirect/swgwork/shahafs/workspace/dpdk.org/drivers/net/
mlx5/mlx5_flow_dv.c:28:0:
/.autodirect/swgwork/shahafs/workspace/dpdk.org/
build/include/rte_gre.h:20:2:
error: type of bit-field 'res2' is a GCC  extension [-Werror=pedantic]
 uint16_t res2:4; /**< Reserved */

Fixing by adding the __extension__ attribute.

Fixes: 894f71a3805d ("net: add GRE header structure")
Cc: stable@dpdk.org
Cc: olivier.matz@6wind.com

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 lib/librte_net/rte_gre.h | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Ferruh Yigit Nov. 2, 2018, 2:56 p.m. UTC | #1
On 11/1/2018 12:46 PM, Shahaf Shuler wrote:
> The following error popped when compiling with -pedantic:
> 
> In file included from
> /.autodirect/swgwork/shahafs/workspace/dpdk.org/drivers/net/
> mlx5/mlx5_flow_dv.c:28:0:
> /.autodirect/swgwork/shahafs/workspace/dpdk.org/
> build/include/rte_gre.h:20:2:
> error: type of bit-field 'res2' is a GCC  extension [-Werror=pedantic]
>  uint16_t res2:4; /**< Reserved */
> 
> Fixing by adding the __extension__ attribute.
> 
> Fixes: 894f71a3805d ("net: add GRE header structure")
> Cc: stable@dpdk.org
> Cc: olivier.matz@6wind.com
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/lib/librte_net/rte_gre.h b/lib/librte_net/rte_gre.h
index 69499bb82a..05aa9d143e 100644
--- a/lib/librte_net/rte_gre.h
+++ b/lib/librte_net/rte_gre.h
@@ -15,6 +15,7 @@  extern "C" {
 /**
  * GRE Header
  */
+__extension__
 struct gre_hdr {
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
 	uint16_t res2:4; /**< Reserved */