[PATCH 6/6] net/nfp: fix the set IPv4/v6 DSCP flow action

Chaoyong He chaoyong.he at corigine.com
Tue Feb 21 07:49:30 CET 2023


The former logic of set IPv4/v6 DSCP 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 IPv4/v6 DSCP as expected.

Fixes: 9c665d70f7a7 ("net/nfp: support IPv4 DSCP flow action")
Fixes: 3202b003bec1 ("net/nfp: support IPv6 DSCP 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 c6e19d8cac..c8c57bc363 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2300,6 +2300,7 @@ nfp_flow_action_set_tos(char *act_data,
 
 	tos_conf = (const struct rte_flow_action_set_dscp *)action->conf;
 	ttl_tos->ipv4_tos = tos_conf->dscp;
+	ttl_tos->ipv4_tos_mask = 0xff;
 	ttl_tos->reserved = 0;
 }
 
@@ -2323,6 +2324,7 @@ nfp_flow_action_set_tc(char *act_data,
 
 	tos_conf = (const struct rte_flow_action_set_dscp *)action->conf;
 	tc_hl->ipv6_tc = tos_conf->dscp;
+	tc_hl->ipv6_tc_mask = 0xff;
 	tc_hl->reserved = 0;
 }
 
-- 
2.29.3



More information about the stable mailing list