]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: Use spin_lock_bh for async_icosq_lock
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Thu, 8 Oct 2020 08:34:03 +0000 (11:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:17 +0000 (19:22 +0100)
commit493434d8d46fa09e99e0f1e65138500db5cb0b59
tree2392a9e134d2c924c777a38e82191f563db14bf9
parent45b7bae55b98b96dc80b5eab10e1fe53942e8a30
net/mlx5e: Use spin_lock_bh for async_icosq_lock

[ Upstream commit f42139ba49791ab6b12443c60044872705b74a1e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c