]> git.dujemihanovic.xyz Git - linux.git/commitdiff
net/mlx5e: Fix scheduling of IPsec ASO query while in atomic
authorLeon Romanovsky <leonro@nvidia.com>
Mon, 5 Jun 2023 08:09:52 +0000 (11:09 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 16 Jun 2023 19:59:20 +0000 (12:59 -0700)
ASO query can be scheduled in atomic context as such it can't use usleep.
Use udelay as recommended in Documentation/timers/timers-howto.rst.

Fixes: 76e463f6508b ("net/mlx5e: Overcome slow response for first IPsec ASO WQE")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c

index ca16cb9807ea5242fc88121e911c5ad556a2e381..a3554bde3e0758deaa7c9a4e03a133fabc9db84e 100644 (file)
@@ -606,7 +606,8 @@ int mlx5e_ipsec_aso_query(struct mlx5e_ipsec_sa_entry *sa_entry,
        do {
                ret = mlx5_aso_poll_cq(aso->aso, false);
                if (ret)
-                       usleep_range(2, 10);
+                       /* We are in atomic context */
+                       udelay(10);
        } while (ret && time_is_after_jiffies(expires));
        spin_unlock_bh(&aso->lock);
        return ret;