From: Ophir Munk Date: Mon, 28 Dec 2020 09:54:08 +0000 (+0200) Subject: net/mlx5: fix freeing packet pacing X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b492e28882f7009421d133126aa7524c02339ba3;p=dpdk.git net/mlx5: fix freeing packet pacing 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: aef1e20ebeb2 ("net/mlx5: allocate packet pacing context") Cc: stable@dpdk.org Signed-off-by: Ophir Munk Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c index 2438bf1f1d..21675ab17a 100644 --- a/drivers/net/mlx5/mlx5_txpp.c +++ b/drivers/net/mlx5/mlx5_txpp.c @@ -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. */