From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13CC6A0548; Tue, 17 Aug 2021 11:19:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D64E40DF5; Tue, 17 Aug 2021 11:19:16 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 99BBF4014E for ; Tue, 17 Aug 2021 11:19:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629191955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n0E+iETpFNM3z1QjBqwxqf32cS4oYnhNmUJIBAe3brw=; b=WaSxbfqxqZLJ/rB8S+RqbsLUbOCUSI55nQA26lZLM7YHjk+z6nwwm9sKwoyjv8ldifmToa RNlWv1PDkm9EqY700k3Yd2Nq71hFe7HsZ7WCDcUVxF74B7Bh7LkkbDFzjyKhiAj1tNxvR1 XRNvUDedvuqB+XvUobTGnSc18yoLVn8= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-250-MaMvfXAMPqGqRLSgyPnCNQ-1; Tue, 17 Aug 2021 05:19:13 -0400 X-MC-Unique: MaMvfXAMPqGqRLSgyPnCNQ-1 Received: by mail-vs1-f71.google.com with SMTP id l14-20020a67ba0e0000b02902c10effe47fso2867900vsn.17 for ; Tue, 17 Aug 2021 02:19:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n0E+iETpFNM3z1QjBqwxqf32cS4oYnhNmUJIBAe3brw=; b=WppmkzTbIMuIOKt04KpYYnKx0t+WyevkPRmXM7iNs5ID/UHHj2p2G/adSJYYiTIyTz cw9896/amqLk6LZ/RNIII57V8O0Odsztez5DHhLGOa2zqrTaS+eyQwQA6CdfezKExNir CBCQxwsss5EK8lIj8yHhCgtVJcebEk2Wuogme0ViLt8YbyQ63H1Y8wOOiRkvJPxH67VJ Huz02GCFjgBw9hAtUB/BpHl311JJ8u61We9/sFAKA/HFbO8JLvj4R3EjL5NcJ/JHDu7k hPNQtWfGm6iRriQvkyY/xxUxVSVSdvFfxR9Jw7LILYsf6ENUBy0OmksX+RxF10ffukCm QPqw== X-Gm-Message-State: AOAM531TH8DL7eIe0UR686OhFH/diPQ9heU0+kKqUSPscsnN5NVjSNXD 3nK+I/DT4pXtBN8bzp4zybK4pZ287c4nUCveC3uBTNuxF7Klupk8amg8+PJk+VAOYTCwXUH/D13 sXU8kgdDleZiuHqFwQfo= X-Received: by 2002:a67:7206:: with SMTP id n6mr1678777vsc.27.1629191953433; Tue, 17 Aug 2021 02:19:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJD2OCTDrmmxspQ44WNesCmXkzXxn8Lld3VYWeYSSgsLiGAz63er0FqLRHUCsliA9Rr65fw2U3wQrIgKQB6FY= X-Received: by 2002:a67:7206:: with SMTP id n6mr1678764vsc.27.1629191953232; Tue, 17 Aug 2021 02:19:13 -0700 (PDT) MIME-Version: 1.0 References: <20210813062154.62985-1-haiyue.wang@intel.com> In-Reply-To: <20210813062154.62985-1-haiyue.wang@intel.com> From: David Marchand Date: Tue, 17 Aug 2021 11:19:02 +0200 Message-ID: To: Haiyue Wang Cc: dev , Qi Zhang , dpdk stable , Qiming Yang , Xiaolong Ye , Beilei Xing , Ying A Wang Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v1] net/ice: fix memzone leak when device init failed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Aug 13, 2021 at 8:45 AM Haiyue Wang 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@dpdk.org > > Reported-by: David Marchand > Signed-off-by: Haiyue Wang > --- > 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