[PATCH] net/nfp: fix teardown of flows sharing a mask ID

Chaoyong He chaoyong.he at corigine.com
Tue Jan 24 08:16:31 CET 2023


The same data in mask section of different flow add/delete control
messages will share the same mask ID of mask table.  The first flow
add control message and the last flow delete control message for a
specific mask ID should have the NFP_FL_META_FLAG_MANAGE_MASK flag set,
this will indicate to the flower firmware to allocate/deallocate the
mask table entry.

The original logic wrongly process the flow delete control message,
and caused the first flow delete control message to have the
NFP_FL_META_FLAG_MANAGE_MASK flagset, thus the flower firmware
deallocate the mask table entry on the first delete. This in turn
prevented all the other flows sharing the same mask ID from offloading.

Fixes: ac09376096d8 ("net/nfp: add structures and functions for flow offload")
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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index d6c8c89921..ff2e21c817 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -285,7 +285,7 @@ nfp_check_mask_remove(struct nfp_flow_priv *priv,
 
 		rte_free(mask_entry);
 		if (meta_flags)
-			*meta_flags &= ~NFP_FL_META_FLAG_MANAGE_MASK;
+			*meta_flags |= NFP_FL_META_FLAG_MANAGE_MASK;
 	}
 
 	return true;
@@ -3653,6 +3653,7 @@ nfp_flow_teardown(struct nfp_flow_priv *priv,
 	nfp_flow_meta = nfp_flow->payload.meta;
 	mask_data = nfp_flow->payload.mask_data;
 	mask_len = nfp_flow_meta->mask_len << NFP_FL_LW_SIZ;
+	nfp_flow_meta->flags &= ~NFP_FL_META_FLAG_MANAGE_MASK;
 	if (!nfp_check_mask_remove(priv, mask_data, mask_len,
 			&nfp_flow_meta->flags)) {
 		PMD_DRV_LOG(ERR, "nfp mask del check failed.");
-- 
2.29.3



More information about the stable mailing list