]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: Fix condition when retrieving PTP-rqn
authorAya Levin <ayal@nvidia.com>
Sun, 29 Aug 2021 10:41:08 +0000 (13:41 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 7 Sep 2021 21:17:02 +0000 (14:17 -0700)
When activating the PTP-RQ, redirect the RQT from drop-RQ to PTP-RQ.
Use mlx5e_channels_get_ptp_rqn to retrieve the rqn. This helper returns
a boolean (not status), hence caller should consider return value 0 as a
fail. Change the caller interpretation of the return value.

Fixes: edc0094ca2ac ("net/mlx5e: Hide all implementation details of mlx5e_rx_res")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c

index bf0313e2682bafb098f5685181716e856835b956..13056cb9757d4b117ff7fbb83dd5a1cec3be40d0 100644 (file)
@@ -572,7 +572,7 @@ void mlx5e_rx_res_channels_activate(struct mlx5e_rx_res *res, struct mlx5e_chann
        if (res->features & MLX5E_RX_RES_FEATURE_PTP) {
                u32 rqn;
 
-               if (mlx5e_channels_get_ptp_rqn(chs, &rqn))
+               if (!mlx5e_channels_get_ptp_rqn(chs, &rqn))
                        rqn = res->drop_rqn;
 
                err = mlx5e_rqt_redirect_direct(&res->ptp.rqt, rqn);