net/nfp: fix set IPv6 flow action can't get right address
Checks
Commit Message
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(-)
Comments
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.
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];
```
@@ -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);
}
}