[3/6] net/nfp: fix the set IPv6 flow action

Message ID 20230221064930.3399-4-chaoyong.he@corigine.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series fix the set flow actions |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Chaoyong He Feb. 21, 2023, 6:49 a.m. UTC
  The former logic of set IPv6 source/destination address flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and 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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 39493ce98d..a4561b08e8 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2163,8 +2163,10 @@  nfp_flow_action_set_ipv6(char *act_data,
 	set_ip->head.len_lw = act_size >> NFP_FL_LW_SIZ;
 	set_ip->reserved = 0;
 
-	for (i = 0; i < 4; i++)
-		set_ip->ipv6[i].exact = set_ipv6->ipv6_addr[i];
+	for (i = 0; i < 4; i++) {
+		set_ip->ipv6[i].exact = *(const rte_be32_t *)&set_ipv6->ipv6_addr[i * 4];
+		set_ip->ipv6[i].mask = RTE_BE32(0xffffffff);
+	}
 }
 
 static void