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 93C8EA04BB; Thu, 17 Sep 2020 14:46:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0696C1BEA1; Thu, 17 Sep 2020 14:46:35 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 713CE160 for ; Thu, 17 Sep 2020 14:46:33 +0200 (CEST) IronPort-SDR: GcIX4R+8G4lllRWDFs7dVWuQk8K+ENkrgExno0X0lXs/mOa2JTy5G4n+KNWgEipGeRefEmmo1U 99zZb9aDiCjA== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="147433961" X-IronPort-AV: E=Sophos;i="5.76,436,1592895600"; d="scan'208";a="147433961" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2020 05:46:30 -0700 IronPort-SDR: l+o7unD3pyr1s9dydGLPQiHxr/u5nvs/2cD4bOD1bzKwr//xRBK6nTPsbJejD0Gg6er7rxH2D3 oXcQnSzBr90A== X-IronPort-AV: E=Sophos;i="5.76,436,1592895600"; d="scan'208";a="483731135" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.251.82.126]) ([10.251.82.126]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2020 05:46:28 -0700 To: Rahul Lakkireddy , dev@dpdk.org Cc: kaara.satwik@chelsio.com References: From: Ferruh Yigit Message-ID: <8fb4bbbf-9bbd-b3e0-b96b-aae6647fe211@intel.com> Date: Thu, 17 Sep 2020 13:46:24 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/2] net/cxgbe: release port resources during port 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/1/2020 6:16 PM, Rahul Lakkireddy wrote: > Enable RTE_ETH_DEV_CLOSE_REMOVE during PCI probe for all ports > enumerated under the PF. Free up the underlying port Virtual > Identifier (VI) and associated resources during port close. > Once all the ports under the PF are closed, free up the PF-wide > shared resources. Invoke port close function of all ports under > the PF, in PCI remove too. > > Signed-off-by: Rahul Lakkireddy <...> > @@ -1204,11 +1222,13 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev) > > static int eth_cxgbe_dev_uninit(struct rte_eth_dev *eth_dev) > { > - struct port_info *pi = eth_dev->data->dev_private; > - struct adapter *adap = pi->adapter; > + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); > + uint16_t port_id; > > /* Free up other ports and all resources */ > - cxgbe_close(adap); > + RTE_ETH_FOREACH_DEV_OF(port_id, &pci_dev->device) > + rte_eth_dev_close(port_id); Is there a reason to call the ethdev wrapper API here? Why not calling 'cxgbe_dev_close()' directly?