Skip to contentSkip to conversation

net/mlx5: fix internal SQ item definition

PATCH In review Gregory Etelson 2 participants 2 messages Oct 27, 2024 – Oct 28, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix internal SQ item definition

When DPDK copies flow items with the rte_flow_conv call, it assumes that size of PMD private data has pointer size - see patch [1]

MLX5 PMD defined struct mlx5_rte_flow_item_sq as 32 bits. As the result, on 64 bits systems, when DPDK copied MLX5_RTE_FLOW_ITEM_TYPE_SQ item, the target buffer was assigned additional 32 bits.

The patch expands size of struct mlx5_rte_flow_item_sq to 64 bits on 64 bits systems.

[1]:
commit 6cf72047332b ("ethdev: support flow elements with variable length")

Fixes 75a00812b18f ("net/mlx5: add hardware steering item translation")
---
 drivers/net/mlx5/mlx5_flow.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/mlx5/mlx5_flow.h +3 -0
index db56ae051d..9cf54c3a6a 100644
@@ -168,6 +168,9 @@ struct mlx5_flow_action_copy_mreg {
 /* Matches on source queue. */
 struct mlx5_rte_flow_item_sq {
 	uint32_t queue; /* DevX SQ number */
+#ifdef RTE_ARCH_64
+	uint32_t reserved;
+#endif
 };
 
 /* Map from registers to modify fields. */
Signature · 1 line
2.43.0
Acked-by Dariusz Sosnowski on v1 1/1
#1 lore raw

Hi,

From: Gregory Etelson <[email protected]>
Sent: Sunday, October 27, 2024 4:09 PM
To: [email protected]
Cc: Gregory Etelson; Maayan Kashani; Raslan Darawsheh; [email protected]; Dariusz Sosnowski; Slava Ovsiienko; Bing Zhao; Ori Kam; Suanming Mou; Matan Azrad
Subject: [PATCH] net/mlx5: fix internal SQ item definition

When DPDK copies flow items with the rte_flow_conv call, it assumes that size of PMD private data has pointer size - see patch [1]

MLX5 PMD defined struct mlx5_rte_flow_item_sq as 32 bits. As the result, on 64 bits systems, when DPDK copied MLX5_RTE_FLOW_ITEM_TYPE_SQ item, the target buffer was assigned additional 32 bits.

The patch expands size of struct mlx5_rte_flow_item_sq to 64 bits on 64 bits systems.

[1]:
commit 6cf72047332b ("ethdev: support flow elements with variable length")

Fixes 75a00812b18f ("net/mlx5: add hardware steering item translation")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh