diff options
author | Maxim Mikityanskiy <maximmi@mellanox.com> | 2019-08-02 13:42:14 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2019-08-15 20:43:56 +0200 |
commit | e0d57d9c7e7a223f3c2ff8b7b63ec1bf63f11ed4 (patch) | |
tree | 03c817cb3915e48d1ff361f94cd8fc4eceef7817 /drivers/net/ethernet | |
parent | selftests: net: tcp_fastopen_backup_key.sh: fix shellcheck issue (diff) | |
download | linux-e0d57d9c7e7a223f3c2ff8b7b63ec1bf63f11ed4.tar.xz linux-e0d57d9c7e7a223f3c2ff8b7b63ec1bf63f11ed4.zip |
net/mlx5e: Fix a race with XSKICOSQ in XSK wakeup flow
Add a missing spinlock around XSKICOSQ usage at the activation stage,
because there is a race between a configuration change and the
application calling sendto().
Fixes: db05815b36cb ("net/mlx5e: Add XSK zero-copy support")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c | 3 |
1 files changed, 3 insertions, 0 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 aaffa6f68dc0..7f78c004d12f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c @@ -143,7 +143,10 @@ 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->xskicosq_lock); mlx5e_trigger_irq(&c->xskicosq); + spin_unlock(&c->xskicosq_lock); } void mlx5e_deactivate_xsk(struct mlx5e_channel *c) |