Skip to contentSkip to conversation

net/mlx5: fix GENEVE resource overwritten

PATCH In review Suanming Mou 2 participants 2 messages Nov 23, 2022 – Dec 18, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix GENEVE resource overwritten

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")
---
 drivers/net/mlx5/mlx5_flow_dv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_dv.c +6 -1
index 62c38b87a1..7ca909999b 100644
@@ -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;
 }
 
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Quoted 13 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Wednesday, November 23, 2022 1:57 PM
To: Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>
Subject: [PATCH] net/mlx5: fix GENEVE resource overwritten

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.

Quoted 8 lines

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")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh