[PATCH v2 5/6] net/nfp: fix the set TTL flow action

Chaoyong He chaoyong.he at corigine.com
Tue Feb 21 11:35:12 CET 2023


The former logic of set TTL 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 TTL as expected.

Fixes: ac12e126c482 ("net/nfp: support TTL flow action")
Cc: stable at dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 5be4c4f18a..77f249e2b9 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2252,6 +2252,7 @@ nfp_flow_action_set_ttl(char *act_data,
 
 	ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf;
 	ttl_tos->ipv4_ttl = ttl_conf->ttl_value;
+	ttl_tos->ipv4_ttl_mask = 0xff;
 	ttl_tos->reserved = 0;
 }
 
@@ -2275,6 +2276,7 @@ nfp_flow_action_set_hl(char *act_data,
 
 	ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf;
 	tc_hl->ipv6_hop_limit = ttl_conf->ttl_value;
+	tc_hl->ipv6_hop_limit_mask = 0xff;
 	tc_hl->reserved = 0;
 }
 
-- 
2.29.3



More information about the dev mailing list