From: Dariusz Sosnowski <dsosnow...@nvidia.com> Move mlx5_flex_parser_ecpri_release() from main source file to the file dedicated for flex parser logic. Also, make the function non-static so the function can be used in flow steering clean up introduced in follow up patches.
Signed-off-by: Dariusz Sosnowski <dsosnow...@nvidia.com> --- drivers/net/mlx5/mlx5.c | 18 ------------------ drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow_flex.c | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 1321be779bb..ece29fb2164 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1044,24 +1044,6 @@ mlx5_flex_parser_ecpri_alloc(struct rte_eth_dev *dev) return (rte_errno == 0) ? -ENODEV : -rte_errno; } -/* - * Destroy the flex parser node, including the parser itself, input / output - * arcs and DW samples. Resources could be reused then. - * - * @param dev - * Pointer to Ethernet device structure. - */ -static void -mlx5_flex_parser_ecpri_release(struct rte_eth_dev *dev) -{ - struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_ecpri_parser_profile *prf = &priv->sh->ecpri_parser; - - if (prf->obj) - mlx5_devx_cmd_destroy(prf->obj); - prf->obj = NULL; -} - /* * Allocation of a flex parser for srh. Once refcnt is zero, the resources held * by this parser will be freed. diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 53f0a27445a..32f98f969ce 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -2735,6 +2735,7 @@ int mlx5_flex_acquire_index(struct rte_eth_dev *dev, struct rte_flow_item_flex_handle *handle, bool acquire); int mlx5_flex_release_index(struct rte_eth_dev *dev, int index); +void mlx5_flex_parser_ecpri_release(struct rte_eth_dev *dev); /* Flex parser list callbacks. */ struct mlx5_list_entry *mlx5_flex_parser_create_cb(void *list_ctx, void *ctx); diff --git a/drivers/net/mlx5/mlx5_flow_flex.c b/drivers/net/mlx5/mlx5_flow_flex.c index afed16985ac..b1174fe0eda 100644 --- a/drivers/net/mlx5/mlx5_flow_flex.c +++ b/drivers/net/mlx5/mlx5_flow_flex.c @@ -1557,3 +1557,21 @@ mlx5_flex_parser_clone_free_cb(void *list_ctx, struct mlx5_list_entry *entry) RTE_SET_USED(list_ctx); mlx5_free(fp); } + +/* + * Destroy the flex parser node, including the parser itself, input / output + * arcs and DW samples. Resources could be reused then. + * + * @param dev + * Pointer to Ethernet device structure. + */ +void +mlx5_flex_parser_ecpri_release(struct rte_eth_dev *dev) +{ + struct mlx5_priv *priv = dev->data->dev_private; + struct mlx5_ecpri_parser_profile *prf = &priv->sh->ecpri_parser; + + if (prf->obj) + mlx5_devx_cmd_destroy(prf->obj); + prf->obj = NULL; +} -- 2.21.0