patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Michael Baum <>
To: <>
Cc: Matan Azrad <>,
	Dariusz Sosnowski <>,
	 Raslan Darawsheh <>,
	Viacheslav Ovsiienko <>,
	Ori Kam <>, Suanming Mou <>,
	<>, <>
Subject: [PATCH] net/mlx5: fix GENEVE TLV option management
Date: Mon, 15 Jan 2024 14:13:26 +0200	[thread overview]
Message-ID: <> (raw)

In SW steering, the GENEVE TLV option matching flows must be created
using a translation function.
This function checks whether this option has already created a DevX
object for the matching and either creates the objects or updates the
reference counter.
After translation, a flag in flow structure is turned on indicating the
destroy function to release this DevX object.

When the flow rule has meter, the rule may be split, and call translate
function more than once per flow causing object reference counter to
increase each time without updating the flow flag accordingly.

This patch uses this flag as a reference counter which is increased
every translation and indicates the destroy function how many destroy
DevX to do.

Fixes: f15f0c3806d0 ("net/mlx5: create GENEVE TLV option management")
Fixes: e440d6cf589e ("net/mlx5: add GENEVE TLV option flow translation")

Signed-off-by: Michael Baum <>
Acked-by: Matan Azrad <>
 drivers/net/mlx5/mlx5_flow_dv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 97f55003c3..7cc1729145 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -14318,7 +14318,7 @@ flow_dv_translate_items_sws(struct rte_eth_dev *dev,
 	 * Avoid be overwritten by other sub mlx5_flows.
 	if (wks.geneve_tlv_option)
-		dev_flow->flow->geneve_tlv_option = wks.geneve_tlv_option;
+		dev_flow->flow->geneve_tlv_option += wks.geneve_tlv_option;
 	return 0;
@@ -15922,9 +15922,9 @@ flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
 		flow_dv_aso_ct_release(dev, flow->ct, NULL);
 	else if (flow->age)
 		flow_dv_aso_age_release(dev, flow->age);
-	if (flow->geneve_tlv_option) {
+	while (flow->geneve_tlv_option) {
-		flow->geneve_tlv_option = 0;
+		flow->geneve_tlv_option--;
 	while (flow->dev_handles) {
 		uint32_t tmp_idx = flow->dev_handles;

             reply	other threads:[~2024-01-15 12:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 12:13 Michael Baum [this message]
2024-01-17 17:14 ` Raslan Darawsheh

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \

* 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).