The former logic of set TP source/destination 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 TP as expected.

Fixes: fc185097bbe6 ("net/nfp: support TP source flow action")
Fixes: 87986df09d75 ("net/nfp: support TP destination flow action")
Cc: sta...@dpdk.org

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

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index d1fe744758..5be4c4f18a 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2190,10 +2190,13 @@ nfp_flow_action_set_tp(char *act_data,
        set_tp->reserved     = 0;
 
        set_tp_conf = (const struct rte_flow_action_set_tp *)action->conf;
-       if (tp_src_flag)
+       if (tp_src_flag) {
                set_tp->src_port = set_tp_conf->port;
-       else
+               set_tp->src_port_mask = RTE_BE16(0xffff);
+       } else {
                set_tp->dst_port = set_tp_conf->port;
+               set_tp->dst_port_mask = RTE_BE16(0xffff);
+       }
 }
 
 static int
-- 
2.29.3

Reply via email to