Commit aaa553a6 authored by Saeed Mahameed's avatar Saeed Mahameed Committed by Leon Romanovsky

net/mlx5: EQ, Remove redundant completion EQ list lock

Completion EQs list is only modified on driver load/unload, locking is
not required, remove it.
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent 2883f352
...@@ -810,8 +810,6 @@ int mlx5_eq_init(struct mlx5_core_dev *dev) ...@@ -810,8 +810,6 @@ int mlx5_eq_init(struct mlx5_core_dev *dev)
{ {
int err; int err;
spin_lock_init(&dev->priv.eq_table.lock);
err = mlx5_eq_debugfs_init(dev); err = mlx5_eq_debugfs_init(dev);
return err; return err;
......
...@@ -704,7 +704,6 @@ int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, ...@@ -704,7 +704,6 @@ int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn,
int err = -ENOENT; int err = -ENOENT;
int i = 0; int i = 0;
spin_lock(&table->lock);
list_for_each_entry_safe(eq, n, &table->comp_eqs_list, list) { list_for_each_entry_safe(eq, n, &table->comp_eqs_list, list) {
if (i++ == vector) { if (i++ == vector) {
*eqn = eq->eqn; *eqn = eq->eqn;
...@@ -713,7 +712,6 @@ int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, ...@@ -713,7 +712,6 @@ int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn,
break; break;
} }
} }
spin_unlock(&table->lock);
return err; return err;
} }
...@@ -724,14 +722,11 @@ struct mlx5_eq *mlx5_eqn2eq(struct mlx5_core_dev *dev, int eqn) ...@@ -724,14 +722,11 @@ struct mlx5_eq *mlx5_eqn2eq(struct mlx5_core_dev *dev, int eqn)
struct mlx5_eq_table *table = &dev->priv.eq_table; struct mlx5_eq_table *table = &dev->priv.eq_table;
struct mlx5_eq *eq; struct mlx5_eq *eq;
spin_lock(&table->lock); list_for_each_entry(eq, &table->comp_eqs_list, list) {
list_for_each_entry(eq, &table->comp_eqs_list, list) if (eq->eqn == eqn)
if (eq->eqn == eqn) {
spin_unlock(&table->lock);
return eq; return eq;
} }
spin_unlock(&table->lock);
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
} }
...@@ -747,17 +742,13 @@ static void free_comp_eqs(struct mlx5_core_dev *dev) ...@@ -747,17 +742,13 @@ static void free_comp_eqs(struct mlx5_core_dev *dev)
dev->rmap = NULL; dev->rmap = NULL;
} }
#endif #endif
spin_lock(&table->lock);
list_for_each_entry_safe(eq, n, &table->comp_eqs_list, list) { list_for_each_entry_safe(eq, n, &table->comp_eqs_list, list) {
list_del(&eq->list); list_del(&eq->list);
spin_unlock(&table->lock);
if (mlx5_destroy_unmap_eq(dev, eq)) if (mlx5_destroy_unmap_eq(dev, eq))
mlx5_core_warn(dev, "failed to destroy EQ 0x%x\n", mlx5_core_warn(dev, "failed to destroy EQ 0x%x\n",
eq->eqn); eq->eqn);
kfree(eq); kfree(eq);
spin_lock(&table->lock);
} }
spin_unlock(&table->lock);
} }
static int alloc_comp_eqs(struct mlx5_core_dev *dev) static int alloc_comp_eqs(struct mlx5_core_dev *dev)
...@@ -798,9 +789,7 @@ static int alloc_comp_eqs(struct mlx5_core_dev *dev) ...@@ -798,9 +789,7 @@ static int alloc_comp_eqs(struct mlx5_core_dev *dev)
goto clean; goto clean;
} }
mlx5_core_dbg(dev, "allocated completion EQN %d\n", eq->eqn); mlx5_core_dbg(dev, "allocated completion EQN %d\n", eq->eqn);
spin_lock(&table->lock);
list_add_tail(&eq->list, &table->comp_eqs_list); list_add_tail(&eq->list, &table->comp_eqs_list);
spin_unlock(&table->lock);
} }
return 0; return 0;
......
...@@ -484,9 +484,6 @@ struct mlx5_eq_table { ...@@ -484,9 +484,6 @@ struct mlx5_eq_table {
struct mlx5_eq pfault_eq; struct mlx5_eq pfault_eq;
#endif #endif
int num_comp_vectors; int num_comp_vectors;
/* protect EQs list
*/
spinlock_t lock;
}; };
struct mlx5_uars_page { struct mlx5_uars_page {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment