DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Liron Himi <lironh@marvell.com>, Robin Jarry <rjarry@redhat.com>
Subject: [PATCH] net/mvpp2: fix build with IPv6 address structure
Date: Fri, 18 Oct 2024 22:11:12 +0200	[thread overview]
Message-ID: <20241018201112.159332-1-thomas@monjalon.net> (raw)

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


             reply	other threads:[~2024-10-18 20:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 20:11 Thomas Monjalon [this message]
2024-10-18 20:20 ` Thomas Monjalon

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=20241018201112.159332-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=lironh@marvell.com \
    --cc=rjarry@redhat.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).