[PATCH v2 06/10] net/mlx5: shared init of control flow rules
Dariusz Sosnowski
dsosnowski at nvidia.com
Tue Oct 22 14:06:14 CEST 2024
Control flow rules lists and control flow rule lock
can be reused between all flow engines, but their initialization
was done in flow_hw_configure() implementation.
This patch moves it to mlx5_dev_spawn(),
which is called for Verbs, DV and HWS flow engines.
Signed-off-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
drivers/net/mlx5/linux/mlx5_os.c | 3 +++
drivers/net/mlx5/mlx5_flow_hw.c | 3 ---
drivers/net/mlx5/windows/mlx5_os.c | 3 +++
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 0a8de88759..c8d7fdb8dd 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1701,6 +1701,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
(sh->config.dv_flow_en == 1 && mlx5_flow_discover_ipv6_tc_support(eth_dev)))
sh->phdev->config.ipv6_tc_fallback = MLX5_IPV6_TC_FALLBACK;
}
+ rte_spinlock_init(&priv->hw_ctrl_lock);
+ LIST_INIT(&priv->hw_ctrl_flows);
+ LIST_INIT(&priv->hw_ext_ctrl_flows);
if (priv->sh->config.dv_flow_en == 2) {
#ifdef HAVE_MLX5_HWS_SUPPORT
if (priv->sh->config.dv_esw_en) {
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 228dc677c0..5b34154bf1 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -11830,9 +11830,6 @@ __flow_hw_configure(struct rte_eth_dev *dev,
if (!priv->dr_ctx)
goto err;
priv->nb_queue = nb_q_updated;
- rte_spinlock_init(&priv->hw_ctrl_lock);
- LIST_INIT(&priv->hw_ctrl_flows);
- LIST_INIT(&priv->hw_ext_ctrl_flows);
ret = flow_hw_action_template_drop_init(dev, error);
if (ret)
goto err;
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 0ebd233595..80f1679388 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -600,6 +600,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
}
mlx5_flow_counter_mode_config(eth_dev);
mlx5_queue_counter_id_prepare(eth_dev);
+ rte_spinlock_init(&priv->hw_ctrl_lock);
+ LIST_INIT(&priv->hw_ctrl_flows);
+ LIST_INIT(&priv->hw_ext_ctrl_flows);
return eth_dev;
error:
if (priv) {
--
2.39.5
More information about the dev
mailing list