Skip to content

Commit

Permalink
net/mlx5: fix freeing packet pacing
Browse files Browse the repository at this point in the history
[ upstream commit b492e28 ]

Packet pacing is allocated under condition #ifdef HAVE_MLX5DV_PP_ALLOC.
In a similar way - free packet pacing index under the same condition.
This update is required to successfully compile under operating systems
which do not support packet pacing.

Fixes: aef1e20 ("net/mlx5: allocate packet pacing context")

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
  • Loading branch information
OphirMunk authored and bluca committed Feb 2, 2021
1 parent 89e0cd5 commit c9de97e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/mlx5/mlx5_txpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ mlx5_txpp_create_event_channel(struct mlx5_dev_ctx_shared *sh)
static void
mlx5_txpp_free_pp_index(struct mlx5_dev_ctx_shared *sh)
{
#ifdef HAVE_MLX5DV_PP_ALLOC
if (sh->txpp.pp) {
mlx5_glue->dv_free_pp(sh->txpp.pp);
sh->txpp.pp = NULL;
sh->txpp.pp_id = 0;
}
#else
RTE_SET_USED(sh);
DRV_LOG(ERR, "Freeing pacing index is not supported.");
#endif
}

/* Allocate Packet Pacing index from kernel via mlx5dv call. */
Expand Down

0 comments on commit c9de97e

Please sign in to comment.