net/mlx5e: Don't trigger IRQ multiple times on XSK wakeup to avoid WQ overruns
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Tue, 11 Feb 2020 14:02:35 +0000 (16:02 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 20 Apr 2020 21:30:22 +0000 (14:30 -0700)
commite7e0004abdd6f83ae4be5613b29ed396beff576c
tree2a3c111b8ca48478db96e1e7073eb97e864a88a6
parent70840b66da4d3b9a8962905d9111a53ee628beb3
net/mlx5e: Don't trigger IRQ multiple times on XSK wakeup to avoid WQ overruns

XSK wakeup function triggers NAPI by posting a NOP WQE to a special XSK
ICOSQ. When the application floods the driver with wakeup requests by
calling sendto() in a certain pattern that ends up in mlx5e_trigger_irq,
the XSK ICOSQ may overflow.

Multiple NOPs are not required and won't accelerate the process, so
avoid posting a second NOP if there is one already on the way. This way
we also avoid increasing the queue size (which might not help anyway).

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>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c