[PATCH 11/17] net/nfp: fix flow position index problem

Chaoyong He chaoyong.he at corigine.com
Mon Jun 24 03:57:17 CEST 2024


From: Long Wu <long.wu at corigine.com>

The flow position acquire and free interfaces use different index,
and this will cause the flow free logic failed.

Fix this problem by using the same flow position index.

Fixes: 0b9079d24808 ("net/nfp: support flow API for CoreNIC firmware")
Cc: chaoyong.he at corigine.com
Cc: stable at dpdk.org

Signed-off-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
---
 drivers/net/nfp/nfp_net_flow.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_net_flow.c b/drivers/net/nfp/nfp_net_flow.c
index 2dab317a5f..2c7801ed41 100644
--- a/drivers/net/nfp/nfp_net_flow.c
+++ b/drivers/net/nfp/nfp_net_flow.c
@@ -123,7 +123,11 @@ static void
 nfp_net_flow_position_free(struct nfp_net_priv *priv,
 		struct rte_flow *nfp_flow)
 {
-	priv->flow_position[nfp_flow->position] = false;
+	uint32_t index;
+
+	index = NFP_NET_FLOW_LIMIT - 1 - nfp_flow->position;
+
+	priv->flow_position[index] = false;
 }
 
 static struct rte_flow *
-- 
2.39.1



More information about the dev mailing list