From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
Chaoyong He <chaoyong.he@corigine.com>,
stable@dpdk.org
Subject: [PATCH v2] net/nfp: fix set IPv6 flow action can't get right address
Date: Mon, 12 Jun 2023 10:24:24 +0800 [thread overview]
Message-ID: <20230612022424.1831291-1-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20230609061919.1307911-1-chaoyong.he@corigine.com>
The former logic of set IPv6 source/destination address flow action
can't get the right IPV6 address, a 32 bit big endian value is
expected while a 8 bit value is provided.
This caused the offloaded packets don't have the right IPv6 address
as expected.
Fixes: 596ae2217214 ("net/nfp: support IPv6 source flow action")
Fixes: 51384f79b264 ("net/nfp: support IPv6 destination flow action")
Cc: stable@dpdk.org
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
v2:
* Solve the compile warning about 'strict-aliasing'.
---
drivers/net/nfp/nfp_flow.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 14749f03a2..4ba49a9b49 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2164,6 +2164,7 @@ nfp_flow_action_set_ipv6(char *act_data,
bool ip_src_flag)
{
int i;
+ rte_be32_t tmp;
size_t act_size;
struct nfp_fl_act_set_ipv6_addr *set_ip;
const struct rte_flow_action_set_ipv6 *set_ipv6;
@@ -2181,7 +2182,8 @@ nfp_flow_action_set_ipv6(char *act_data,
set_ip->reserved = 0;
for (i = 0; i < 4; i++) {
- set_ip->ipv6[i].exact = set_ipv6->ipv6_addr[i * 4];
+ rte_memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4);
+ set_ip->ipv6[i].exact = tmp;
set_ip->ipv6[i].mask = RTE_BE32(0xffffffff);
}
}
--
2.39.1
next prev parent reply other threads:[~2023-06-12 2:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 6:19 [PATCH] " Chaoyong He
2023-06-09 13:43 ` Ferruh Yigit
2023-06-09 15:31 ` Ferruh Yigit
2023-06-12 2:24 ` Chaoyong He [this message]
2023-06-12 9:57 ` [PATCH v2] " Ferruh Yigit
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=20230612022424.1831291-1-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=niklas.soderlund@corigine.com \
--cc=oss-drivers@corigine.com \
--cc=stable@dpdk.org \
/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).