DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mvpp2: fix build with IPv6 address structure
@ 2024-10-18 20:11 Thomas Monjalon
  2024-10-18 20:20 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Monjalon @ 2024-10-18 20:11 UTC (permalink / raw)
  To: dev; +Cc: Liron Himi, Robin Jarry

A structure has been created for IPv6 addresses
replacing the byte arrays of the IPv6 header.

This change was failing the compilation:
mrvl_flow.c:1055:29: error: incompatible type for argument 1 of 'memcmp'

Instead of adapting the memcmp call, a new function is used
to compare an IPv6 address with an unspec (zero) address.

Fixes: 89b5642d0d45 ("net: use IPv6 address structure for packet headers")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mvpp2/mrvl_flow.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_flow.c b/drivers/net/mvpp2/mrvl_flow.c
index 098523ada6..9932e28edc 100644
--- a/drivers/net/mvpp2/mrvl_flow.c
+++ b/drivers/net/mvpp2/mrvl_flow.c
@@ -1031,7 +1031,6 @@ mrvl_parse_ip6(const struct rte_flow_item *item,
 	       struct rte_flow_error *error)
 {
 	const struct rte_flow_item_ipv6 *spec = NULL, *mask = NULL;
-	struct rte_ipv6_hdr zero;
 	uint32_t flow_mask;
 	int ret;
 
@@ -1043,8 +1042,6 @@ mrvl_parse_ip6(const struct rte_flow_item *item,
 	if (ret)
 		return ret;
 
-	memset(&zero, 0, sizeof(zero));
-
 	if (mask->hdr.payload_len ||
 	    mask->hdr.hop_limits) {
 		rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1052,15 +1049,13 @@ mrvl_parse_ip6(const struct rte_flow_item *item,
 		return -rte_errno;
 	}
 
-	if (memcmp(mask->hdr.src_addr,
-		   zero.src_addr, sizeof(mask->hdr.src_addr))) {
+	if (!rte_ipv6_addr_is_unspec(&mask->hdr.src_addr)) {
 		ret = mrvl_parse_ip6_sip(spec, mask, flow);
 		if (ret)
 			goto out;
 	}
 
-	if (memcmp(mask->hdr.dst_addr,
-		   zero.dst_addr, sizeof(mask->hdr.dst_addr))) {
+	if (!rte_ipv6_addr_is_unspec(&mask->hdr.dst_addr)) {
 		ret = mrvl_parse_ip6_dip(spec, mask, flow);
 		if (ret)
 			goto out;
-- 
2.46.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-18 20:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-18 20:11 [PATCH] net/mvpp2: fix build with IPv6 address structure Thomas Monjalon
2024-10-18 20:20 ` Thomas Monjalon

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).