patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
	Chaoyong He <chaoyong.he@corigine.com>,
	stable@dpdk.org
Subject: [PATCH] net/nfp: fix teardown of flows sharing a mask ID
Date: Tue, 24 Jan 2023 15:16:31 +0800	[thread overview]
Message-ID: <20230124071631.38272-1-chaoyong.he@corigine.com> (raw)

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


             reply	other threads:[~2023-01-24  7:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24  7:16 Chaoyong He [this message]
2023-01-26  9:14 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230124071631.38272-1-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=niklas.soderlund@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).