From 1f527a11520f9706fd5bb30828d36a666106d571 Mon Sep 17 00:00:00 2001 From: Yaacov Hazan Date: Fri, 30 Oct 2015 19:55:18 +0100 Subject: [PATCH] mlx5: fix build with GCC < 4.6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Seen with GCC < 4.6: error: unknown field ‘tcp_udp’ specified in initializer error: extra brace group at end of initializer Static initialization of anonymous structs/unions is a C11 feature properly supported only since GCC 4.6. Work around compilation errors with older versions by expanding struct ibv_exp_flow_spec into struct hash_rxq_init. Signed-off-by: Yaacov Hazan Signed-off-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5_rxtx.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 25e256f256..15c4bc85aa 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -153,7 +153,18 @@ struct hash_rxq_init { uint64_t hash_fields; /* Fields that participate in the hash. */ uint64_t dpdk_rss_hf; /* Matching DPDK RSS hash fields. */ unsigned int flow_priority; /* Flow priority to use. */ - struct ibv_exp_flow_spec flow_spec; /* Flow specification template. */ + union { + struct { + enum ibv_exp_flow_spec_type type; + uint16_t size; + } hdr; + struct ibv_exp_flow_spec_tcp_udp tcp_udp; + struct ibv_exp_flow_spec_ipv4 ipv4; +#ifdef HAVE_FLOW_SPEC_IPV6 + struct ibv_exp_flow_spec_ipv6 ipv6; +#endif /* HAVE_FLOW_SPEC_IPV6 */ + struct ibv_exp_flow_spec_eth eth; + } flow_spec; /* Flow specification template. */ const struct hash_rxq_init *underlayer; /* Pointer to underlayer. */ }; -- 2.20.1