[dpdk-stable] [PATCH v1] net/ice: fix memzone leak when device init failed

David Marchand david.marchand at redhat.com
Tue Aug 17 11:19:02 CEST 2021


On Fri, Aug 13, 2021 at 8:45 AM Haiyue Wang <haiyue.wang at intel.com> wrote:
>
> When flow engine initialization or FXP resource reset failed, it needs
> to free the memory zone and unregister the interrupt callback.
>
> Bugzilla ID: 752
> Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
> Fixes: 7615a6895009 ("net/ice: rework for generic flow enabling")
> Fixes: 7edc7158d771 ("net/ice: cleanup RSS/FDIR profile on device init")
> Cc: stable at dpdk.org
>
> Reported-by: David Marchand <david.marchand at redhat.com>
> Signed-off-by: Haiyue Wang <haiyue.wang at intel.com>
> ---
>  drivers/net/ice/ice_ethdev.c      | 10 ++++++++--
>  drivers/net/ice/ice_fdir_filter.c |  2 ++
>  2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
> index 64ee569525..8d62b84805 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -2139,20 +2139,26 @@ ice_dev_init(struct rte_eth_dev *dev)
>                 ret = ice_flow_init(ad);
>                 if (ret) {
>                         PMD_INIT_LOG(ERR, "Failed to initialize flow");
> -                       return ret;
> +                       goto err_flow_init;

Is it safe to call flow engine uninit callbacks when ice_flow_init() fails?


>                 }
>         }
>
>         ret = ice_reset_fxp_resource(hw);
>         if (ret) {
>                 PMD_INIT_LOG(ERR, "Failed to reset fxp resource");
> -               return ret;
> +               goto err_flow_init;
>         }
>
>         pf->supported_rxdid = ice_get_supported_rxdid(hw);
>
>         return 0;
>
> +err_flow_init:
> +       ice_flow_uninit(ad);
> +       rte_intr_disable(intr_handle);
> +       ice_pf_disable_irq0(hw);
> +       rte_intr_callback_unregister(intr_handle,
> +                                    ice_interrupt_handler, dev);
>  err_pf_setup:
>         ice_res_pool_destroy(&pf->msix_pool);
>  err_msix_pool_init:


-- 
David Marchand



More information about the stable mailing list