From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Cc: <dev@dpdk.org>, Ferruh Yigit <ferruh.yigit@amd.com>
Subject: [PATCH] net/mlx5: fix MAC address initialization
Date: Fri, 8 Nov 2024 17:07:24 +0100 [thread overview]
Message-ID: <20241108160724.730989-1-dsosnowski@nvidia.com> (raw)
Offending patch added code which broke compilation on GCC 15,
where MAC address was initialized with a string, causing the following
errors:
../drivers/net/mlx5/mlx5_flow.c:
In function ‘mlx5_legacy_dmac_flow_create’:
../drivers/net/mlx5/mlx5_flow.c:8568:44:
error: initializer-string for array of ‘unsigned char’ is too long
[-Werror=unterminated-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:
error: initializer-string for array of ‘unsigned char’ is too long
[-Werror=unterminated-string-initialization]
8583 | .hdr.dst_addr.addr_bytes =
"\xff\xff\xff\xff\xff\xff",
|
^~~~~~~~~~~~~~~~~~~~~~~~~~
This patch fixes this issue by converting it to array initialization.
Fixes: cf99567fe566 ("net/mlx5: add legacy unicast flow rules management")
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/net/mlx5/mlx5_flow.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 9c43201e05..f8cfa661ec 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -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),
--
2.39.5
reply other threads:[~2024-11-08 16:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20241108160724.730989-1-dsosnowski@nvidia.com \
--to=dsosnowski@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.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).