diff options
author | Maxim Mikityanskiy <maximmi@mellanox.com> | 2020-10-08 11:34:03 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2020-11-05 12:17:05 -0800 |
commit | f42139ba49791ab6b12443c60044872705b74a1e (patch) | |
tree | c2e27d54e28d2071b139ce2e73ba586e7ed3dd8a /drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c | |
parent | 78c906e430b13d30a8cfbdef4ccbbe1686841a9e (diff) | |
download | linux-f42139ba49791ab6b12443c60044872705b74a1e.tar.gz linux-f42139ba49791ab6b12443c60044872705b74a1e.tar.xz |
net/mlx5e: Use spin_lock_bh for async_icosq_lock
async_icosq_lock may be taken from softirq and non-softirq contexts. It
requires protection with spin_lock_bh, otherwise a softirq may be
triggered in the middle of the critical section, and it may deadlock if
it tries to take the same lock. This patch fixes such a scenario by
using spin_lock_bh to disable softirqs on that CPU while inside the
critical section.
Fixes: 8d94b590f1e4 ("net/mlx5e: Turn XSK ICOSQ into a general asynchronous one")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.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/xsk/setup.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c index 4e574ac73019..be3465ba38ca 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c @@ -122,9 +122,9 @@ void mlx5e_activate_xsk(struct mlx5e_channel *c) set_bit(MLX5E_RQ_STATE_ENABLED, &c->xskrq.state); /* TX queue is created active. */ - spin_lock(&c->async_icosq_lock); + spin_lock_bh(&c->async_icosq_lock); mlx5e_trigger_irq(&c->async_icosq); - spin_unlock(&c->async_icosq_lock); + spin_unlock_bh(&c->async_icosq_lock); } void mlx5e_deactivate_xsk(struct mlx5e_channel *c) |