summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c
diff options
context:
space:
mode:
authorMaxim Mikityanskiy <maximmi@nvidia.com>2022-01-25 12:52:54 +0200
committerSaeed Mahameed <saeedm@nvidia.com>2022-02-14 22:30:50 -0800
commit3ab45777a27c5f53a55a2c353b70648449ca7a33 (patch)
treea1e55ab4a78130552aba37e6ff1c56b4a758bf85 /drivers/net/ethernet/mellanox/mlx5/core/en/qos.c
parent6b23f6ab86a4f3a608b9bfa98616e99a34bb650c (diff)
downloadlinux-stable-3ab45777a27c5f53a55a2c353b70648449ca7a33.tar.gz
linux-stable-3ab45777a27c5f53a55a2c353b70648449ca7a33.tar.bz2
linux-stable-3ab45777a27c5f53a55a2c353b70648449ca7a33.zip
net/mlx5e: Use select queue parameters to sync with control flow
Start using the select queue parameters introduced in the previous commit to have proper synchronization with changing the configuration (such as number of channels and queues). It ensures that the state that mlx5e_select_queue() sees is always consistent and stays the same while the function is running. Also it allows mlx5e_select_queue to stop using data structures that weren't synchronized properly: txq2sq, channel_tc2realtxq, port_ptp_tc2realtxq. The last two are removed completely, as they were used only in mlx5e_select_queue. Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en/qos.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en/qos.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c
index ccfc8ae2fa71..9db677e9ca9c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/qos.c
@@ -549,11 +549,15 @@ int mlx5e_htb_root_del(struct mlx5e_priv *priv)
qos_dbg(priv->mdev, "TC_HTB_DESTROY\n");
+ /* Wait until real_num_tx_queues is updated for mlx5e_select_queue,
+ * so that we can safely switch to its non-HTB non-PTP fastpath.
+ */
+ synchronize_net();
+
mlx5e_selq_prepare(&priv->selq, &priv->channels.params, false);
mlx5e_selq_apply(&priv->selq);
WRITE_ONCE(priv->htb.maj_id, 0);
- synchronize_rcu(); /* Sync with mlx5e_select_htb_queue and TX data path. */
root = mlx5e_sw_node_find(priv, MLX5E_HTB_CLASSID_ROOT);
if (!root) {