From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 96B9DA04B1; Wed, 23 Sep 2020 18:47:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 84B6F1DA45; Wed, 23 Sep 2020 18:47:16 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id D1BB51D8E9 for ; Wed, 23 Sep 2020 18:47:13 +0200 (CEST) IronPort-SDR: xd/9t9Ml8cxw1WuJp4Fb/XUrU4UYdlNdf2FQG0Incn/jgsg3uv72sxBG6ISWTLWDddUf/84pci sYm/SFqKHmmA== X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="148689163" X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="148689163" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 09:42:07 -0700 IronPort-SDR: v4uUEI8RZfaL8ZdK5YDQHS/GQIJP2zKJI73LmuoQftPlXTfLkkn+H9+S5hKUt4CsFTZDT5FLvs yw5oDE00MURg== X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="305447534" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.218.147]) ([10.213.218.147]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 09:42:05 -0700 To: Thomas Monjalon , dev@dpdk.org Cc: arybchenko@solarflare.com, Igor Russkikh , Pavel Belous , Anatoly Burakov References: <20200913220711.3768597-1-thomas@monjalon.net> <20200913220711.3768597-5-thomas@monjalon.net> From: Ferruh Yigit Message-ID: <75c03f9f-7073-7d67-b559-5f5d8564cb07@intel.com> Date: Wed, 23 Sep 2020 17:42:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <20200913220711.3768597-5-thomas@monjalon.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 04/20] net/atlantic: release port upon close X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 9/13/2020 11:06 PM, Thomas Monjalon wrote: > The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources > can be freed by rte_eth_dev_close(). > > Freeing of private port resources is moved > from the ".remove(device)" to the ".dev_close(port)" operation. > > Signed-off-by: Thomas Monjalon <...> > @@ -721,12 +687,32 @@ atl_dev_set_link_down(struct rte_eth_dev *dev) > static int > atl_dev_close(struct rte_eth_dev *dev) > { > + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); > + struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; > + struct aq_hw_s *hw; > + > PMD_INIT_FUNC_TRACE(); > > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) > + return -EPERM; Is this case an error, or should it return 0. > + > + hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + > atl_dev_stop(dev); > > atl_free_queues(dev); > > + dev->dev_ops = NULL; > + dev->rx_pkt_burst = NULL; > + dev->tx_pkt_burst = NULL; What do you think moving above cleanup to 'rte_eth_dev_release_port()'?