OSDN Git Service

net/mlx5e: xsk: Use mlx5e_trigger_napi_icosq for XSK wakeup
authorMaxim Mikityanskiy <maximmi@nvidia.com>
Fri, 30 Sep 2022 16:28:48 +0000 (09:28 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 1 Oct 2022 20:30:19 +0000 (13:30 -0700)
mlx5e_xsk_wakeup triggers an IRQ by posting a NOP to async_icosq, taking
a spinlock to protect from concurrent access. There is already a
function that does the same: mlx5e_trigger_napi_icosq. Use this function
in mlx5e_xsk_wakeup.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c

index 4902ef7..1203d7d 100644 (file)
@@ -36,9 +36,7 @@ int mlx5e_xsk_wakeup(struct net_device *dev, u32 qid, u32 flags)
                if (test_and_set_bit(MLX5E_SQ_STATE_PENDING_XSK_TX, &c->async_icosq.state))
                        return 0;
 
-               spin_lock_bh(&c->async_icosq_lock);
-               mlx5e_trigger_irq(&c->async_icosq);
-               spin_unlock_bh(&c->async_icosq_lock);
+               mlx5e_trigger_napi_icosq(c);
        }
 
        return 0;