Skip to contentSkip to conversation

net/mlx5: fix entry size in HWS construct data ipool

PATCH In review Michael Baum 2 participants 2 messages Jun 2, 2022 – Jun 5, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix entry size in HWS construct data ipool

The mlx5_action_construct_data structure memory is managed by ipool named acts_ipool.

The size of one entry in this ipool is mistakenly defined as size of rte_flow_hw structure.
This size is used to reset in the allocated part. When the size is incorrect it resets memory that does not belong to it.

This patch defines the correct size.

Fixes f13fab23922b ("net/mlx5: add flow jump action")
---
 drivers/net/mlx5/mlx5_flow_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_hw.c +1 -1
index 2c2bd0feef..12498794a5 100644
@@ -2044,7 +2044,7 @@ flow_hw_configure(struct rte_eth_dev *dev,
 	struct mlx5_hw_q_job *job = NULL;
 	uint32_t mem_size, i, j;
 	struct mlx5_indexed_pool_config cfg = {
-		.size = sizeof(struct rte_flow_hw),
+		.size = sizeof(struct mlx5_action_construct_data),
 		.trunk_size = 4096,
 		.need_lock = 1,
 		.release_mem_en = !!priv->sh->config.reclaim_mode,
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Quoted 17 lines

-----Original Message-----
From: Michael Baum <[email protected]>
Sent: Thursday, June 2, 2022 2:39 PM
To: [email protected]
Cc: Matan Azrad <[email protected]>; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Suanming Mou <[email protected]>; [email protected]
Subject: [PATCH] net/mlx5: fix entry size in HWS construct data ipool

The mlx5_action_construct_data structure memory is managed by ipool named acts_ipool.

The size of one entry in this ipool is mistakenly defined as size of rte_flow_hw structure.
This size is used to reset in the allocated part. When the size is incorrect it resets memory that does not belong to it.

Quoted 8 lines

This patch defines the correct size.

Fixes f13fab23922b ("net/mlx5: add flow jump action")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh