DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/nfp: fix teardown of flows sharing a mask ID
@ 2023-01-24  7:16 Chaoyong He
  2023-01-26  9:14 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Chaoyong He @ 2023-01-24  7:16 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

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@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-26  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24  7:16 [PATCH] net/nfp: fix teardown of flows sharing a mask ID Chaoyong He
2023-01-26  9:14 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).