DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/nfp: fix set IPv6 flow action can't get right address
@ 2023-06-09  6:19 Chaoyong He
  2023-06-09 13:43 ` Ferruh Yigit
  2023-06-12  2:24 ` [PATCH v2] " Chaoyong He
  0 siblings, 2 replies; 5+ messages in thread
From: Chaoyong He @ 2023-06-09  6:19 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

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>
---
 drivers/net/nfp/nfp_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 41b722f4d8..0dd0d14f4a 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2166,7 +2166,7 @@ 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];
+		set_ip->ipv6[i].exact = *(const rte_be32_t *)&set_ipv6->ipv6_addr[i * 4];
 		set_ip->ipv6[i].mask = RTE_BE32(0xffffffff);
 	}
 }
-- 
2.39.1


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

* Re: [PATCH] net/nfp: fix set IPv6 flow action can't get right address
  2023-06-09  6:19 [PATCH] net/nfp: fix set IPv6 flow action can't get right address Chaoyong He
@ 2023-06-09 13:43 ` Ferruh Yigit
  2023-06-09 15:31   ` Ferruh Yigit
  2023-06-12  2:24 ` [PATCH v2] " Chaoyong He
  1 sibling, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2023-06-09 13:43 UTC (permalink / raw)
  To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund, stable

On 6/9/2023 7:19 AM, Chaoyong He wrote:
> 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>
> 

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


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

* Re: [PATCH] net/nfp: fix set IPv6 flow action can't get right address
  2023-06-09 13:43 ` Ferruh Yigit
@ 2023-06-09 15:31   ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2023-06-09 15:31 UTC (permalink / raw)
  To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund, stable, Thomas Monjalon

On 6/9/2023 2:43 PM, Ferruh Yigit wrote:
> On 6/9/2023 7:19 AM, Chaoyong He wrote:
>> 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>
>>
> 
> Applied to dpdk-next-net/main, thanks.
> 

Thomas highlighted the compiler warning from CI [1], dropping patch from
next-net, updated patchwork status.

Can you please check the warning?



[1]
https://mails.dpdk.org/archives/test-report/2023-June/407776.html

```
../drivers/net/nfp/nfp_flow.c: In function 'nfp_flow_action_set_ipv6':
../drivers/net/nfp/nfp_flow.c:2168:3:
  error:
  dereferencing type-punned pointer will break strict-aliasing rules
  [-Werror=strict-aliasing]

   set_ip->ipv6[i].exact = *(const rte_be32_t *)&set_ipv6->ipv6_addr[i * 4];
```


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

* [PATCH v2] net/nfp: fix set IPv6 flow action can't get right address
  2023-06-09  6:19 [PATCH] net/nfp: fix set IPv6 flow action can't get right address Chaoyong He
  2023-06-09 13:43 ` Ferruh Yigit
@ 2023-06-12  2:24 ` Chaoyong He
  2023-06-12  9:57   ` Ferruh Yigit
  1 sibling, 1 reply; 5+ messages in thread
From: Chaoyong He @ 2023-06-12  2:24 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

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


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

* Re: [PATCH v2] net/nfp: fix set IPv6 flow action can't get right address
  2023-06-12  2:24 ` [PATCH v2] " Chaoyong He
@ 2023-06-12  9:57   ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2023-06-12  9:57 UTC (permalink / raw)
  To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund, stable

On 6/12/2023 3:24 AM, Chaoyong He wrote:
> 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>
>

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


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

end of thread, other threads:[~2023-06-12  9:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-09  6:19 [PATCH] net/nfp: fix set IPv6 flow action can't get right address Chaoyong He
2023-06-09 13:43 ` Ferruh Yigit
2023-06-09 15:31   ` Ferruh Yigit
2023-06-12  2:24 ` [PATCH v2] " Chaoyong He
2023-06-12  9:57   ` Ferruh Yigit

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