]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net/mlx5e: MACsec, add ASO poll loop in macsec_aso_set_arm_event
authorGal Pressman <gal@nvidia.com>
Wed, 18 Feb 2026 07:29:02 +0000 (09:29 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 Feb 2026 17:30:14 +0000 (09:30 -0800)
The macsec_aso_set_arm_event function calls mlx5_aso_poll_cq once
without a retry loop. If the CQE is not immediately available after
posting the WQE, the function fails unnecessarily.

Use read_poll_timeout() to poll 3-10 usecs for CQE, consistent with
other ASO polling code paths in the driver.

Fixes: 739cfa34518e ("net/mlx5: Make ASO poll CQ usable in atomic context")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Jacob Keller <Jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260218072904.1764634-5-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c

index 641cd3a2cdfab21faf96a9c928814075b03e287f..90b3bc5f9166fd57f2a757f98094bf2b8b7050bc 100644 (file)
@@ -1386,7 +1386,8 @@ static int macsec_aso_set_arm_event(struct mlx5_core_dev *mdev, struct mlx5e_mac
                           MLX5_ACCESS_ASO_OPC_MOD_MACSEC);
        macsec_aso_build_ctrl(aso, &aso_wqe->aso_ctrl, in);
        mlx5_aso_post_wqe(maso, false, &aso_wqe->ctrl);
-       err = mlx5_aso_poll_cq(maso, false);
+       read_poll_timeout(mlx5_aso_poll_cq, err, !err, 10, 10 * USEC_PER_MSEC,
+                         false, maso, false);
        mutex_unlock(&aso->aso_lock);
 
        return err;