Skip to contentSkip to conversation

Build with Gcc 15 fixes

PATCH Applied Stephen Hemminger 3 participants 6 messages Nov 10, 2024 – Nov 11, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

cover Build with Gcc 15 fixes

Ferruh had fixed most of these, but a couple more crept in. A couple more Gcc 15 fixes

Stephen Hemminger (2):
net/dpaa2: fix build with Gcc 15
net/mlx5: fix build with Gcc 15

 drivers/net/dpaa2/dpaa2_flow.c | 2 +-
 drivers/net/mlx5/mlx5_flow.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/2 net/dpaa2: fix build with Gcc 15

Compiler no longer allows initializing byte array with string.
warning: initializer-string for array of ‘unsigned char’ is too long
[-Wunterminated-string-initialization]
169 | .vni = "\xff\xff\xff",

      |                ^~~~~~~~~~~~~~
Fixes 39c8044ffb7b ("net/dpaa2: support VXLAN flow matching")
---
 drivers/net/dpaa2/dpaa2_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dpaa2/dpaa2_flow.c +1 -1
index cfbcb29df1..de850ae0cf 100644
@@ -166,7 +166,7 @@ static const struct rte_flow_item_gre dpaa2_flow_item_gre_mask = {
 
 static const struct rte_flow_item_vxlan dpaa2_flow_item_vxlan_mask = {
 	.flags = 0xff,
-	.vni = "\xff\xff\xff",
+	.vni = { 0xff, 0xff, 0xff },
 };
 
 static const struct rte_flow_item_ecpri dpaa2_flow_item_ecpri_mask = {
Signature · 1 line
2.45.2
Acked-by on v1 1/2 Applied
#2 lore raw

Re: [PATCH 1/2] net/dpaa2: fix build with Gcc 15

Quoted 11 lines · Stephen Hemminger

Compiler no longer allows initializing byte array with string.
warning: initializer-string for array of ‘unsigned char’ is too long
[-Wunterminated-string-initialization]
169 | .vni = "\xff\xff\xff",

      |                ^~~~~~~~~~~~~~
Fixes 39c8044ffb7b ("net/dpaa2: support VXLAN flow matching")

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

#3 lore raw

PATCH 2/2 net/mlx5: fix build with Gcc 15

In reply to Stephen Hemminger

Fixes warnings from Gcc 15 about using string for initialization.
../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_legacy_dmac_flow_create’:
../drivers/net/mlx5/mlx5_flow.c:8568:44: warning: initializer-string for array of ‘unsigned char’ is too long [-Wunterminated-string-initialization]
8568 | .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",

      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_legacy_dmac_vlan_flow_create’:
../drivers/net/mlx5/mlx5_flow.c:8583:44: warning: initializer-string for array of ‘unsigned char’ is too long [-Wunterminated-string-initialization]
 8583 |                 .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes cf99567fe566 ("net/mlx5: add legacy unicast flow rules management")
---
 drivers/net/mlx5/mlx5_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_flow.c +2 -2
index 9c43201e05..f8cfa661ec 100644
@@ -8565,7 +8565,7 @@ mlx5_legacy_dmac_flow_create(struct rte_eth_dev *dev, const struct rte_ether_add
 		.hdr.dst_addr = *addr,
 	};
 	struct rte_flow_item_eth unicast_mask = {
-		.hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+		.hdr.dst_addr.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
 	};
 
 	return mlx5_ctrl_flow(dev, &unicast, &unicast_mask);
@@ -8580,7 +8580,7 @@ mlx5_legacy_dmac_vlan_flow_create(struct rte_eth_dev *dev,
 		.hdr.dst_addr = *addr,
 	};
 	struct rte_flow_item_eth unicast_mask = {
-		.hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+		.hdr.dst_addr.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
 	};
 	struct rte_flow_item_vlan vlan_spec = {
 		.hdr.vlan_tci = rte_cpu_to_be_16(vid),
Signature · 1 line
2.45.2
#4 lore raw

Re: [PATCH 2/2] net/mlx5: fix build with Gcc 15

Quoted 10 lines · Stephen Hemminger

Fixes warnings from Gcc 15 about using string for initialization.
../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_legacy_dmac_flow_create’:
../drivers/net/mlx5/mlx5_flow.c:8568:44: warning: initializer-string for array of ‘unsigned char’ is too long [-Wunterminated-string-initialization]
8568 | .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",

      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/mlx5/mlx5_flow.c: In function ‘mlx5_legacy_dmac_vlan_flow_create’:
../drivers/net/mlx5/mlx5_flow.c:8583:44: warning: initializer-string for array of ‘unsigned char’ is too long [-Wunterminated-string-initialization]
 8583 |                 .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 5 lines
Fixes cf99567fe566 ("net/mlx5: add legacy unicast flow rules management")

Dariusz already sent a fix before, will get it:
https://patches.dpdk.org/project/dpdk/patch/[email protected]/