From: Suanming Mou <suanmingm@nvidia.com>
To: Matan Azrad <matan@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>
Subject: [PATCH] net/mlx5: fix GENEVE resource overwritten
Date: Wed, 23 Nov 2022 13:57:12 +0200 [thread overview]
Message-ID: <20221123115712.808661-1-suanmingm@nvidia.com> (raw)
Currently, one rte_flow may be split to multiple sub mlx5_flows.
While GENEVE option resource was allocated in the first mlx5_flow,
the flag will be overwritten by next sub mlx5_flow. This caused
GENEVE option resource leakage.
This commit adds the check of GENEVE option resource to avoid the
GENEVE option flag be overwritten.
Fixes: cd4ab742064a ("net/mlx5: split flow item matcher and value translation")
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 62c38b87a1..7ca909999b 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -13717,7 +13717,12 @@ flow_dv_translate_items_sws(struct rte_eth_dev *dev,
* is the suffix flow.
*/
dev_flow->handle->layers |= wks.item_flags;
- dev_flow->flow->geneve_tlv_option = wks.geneve_tlv_option;
+ /*
+ * Update geneve_tlv_option flag only it is set in workspace.
+ * Avoid be overwritten by other sub mlx5_flows.
+ */
+ if (wks.geneve_tlv_option)
+ dev_flow->flow->geneve_tlv_option = wks.geneve_tlv_option;
return 0;
}
--
2.25.1
next reply other threads:[~2022-11-23 11:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-23 11:57 Suanming Mou [this message]
2022-12-18 12:05 ` 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:
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=20221123115712.808661-1-suanmingm@nvidia.com \
--to=suanmingm@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=rasland@nvidia.com \
--cc=viacheslavo@nvidia.com \
/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).