Skip to contentSkip to conversation

net/mlx5: fix missing thread safety flag for flow API

PATCH In review Dariusz Sosnowski 2 participants 2 messages Oct 23, 2023 – Oct 31, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix missing thread safety flag for flow API

When mlx5 port was configured with HW Steering flow engine (devarg dv_flow_en set to 2), PMD did not set RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE in device flags. This caused certain flow API calls, such as rte_flow_query(), to obtain a port-wide lock, which is not needed.

This patch adds missing code for setting this flag.

Fixes d84c3cf7662c ("net/mlx5: introduce hardware steering enable routine")
---
 drivers/net/mlx5/linux/mlx5_os.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/mlx5/linux/mlx5_os.c +1 -0
index d5ef695e6d..1caece5405 100644
@@ -1643,6 +1643,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 					 "matching is disabled",
 				eth_dev->data->port_id);
 		}
+		eth_dev->data->dev_flags |= RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE;
 		return eth_dev;
 #else
 		DRV_LOG(ERR, "DV support is missing for HWS.");
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Quoted 15 lines

-----Original Message-----
From: Dariusz Sosnowski <[email protected]>
Sent: Monday, October 23, 2023 1:23 PM
To: Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>
Cc: [email protected]; [email protected]
Subject: [PATCH] net/mlx5: fix missing thread safety flag for flow API

When mlx5 port was configured with HW Steering flow engine (devarg dv_flow_en set to 2), PMD did not set RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE in device flags.
This caused certain flow API calls, such as rte_flow_query(), to obtain a port- wide lock, which is not needed.

Quoted 8 lines

This patch adds missing code for setting this flag.

Fixes d84c3cf7662c ("net/mlx5: introduce hardware steering enable routine")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh