From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 620A91D9E for ; Tue, 30 Apr 2019 04:13:10 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 19:13:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,412,1549958400"; d="scan'208";a="169143939" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by fmsmga001.fm.intel.com with ESMTP; 29 Apr 2019 19:13:08 -0700 Date: Tue, 30 Apr 2019 10:06:36 +0800 From: Ye Xiaolong To: Ferruh Yigit Cc: dev@dpdk.org, Thomas Monjalon Message-ID: <20190430020636.GB37233@intel.com> References: <20190426050912.109813-1-xiaolong.ye@intel.com> <20190426050912.109813-2-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v1 1/2] net/af_xdp: remove resources when port is closed 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: , X-List-Received-Date: Tue, 30 Apr 2019 02:13:10 -0000 Hi, Ferruh On 04/29, Ferruh Yigit wrote: >On 4/26/2019 6:09 AM, Xiaolong Ye wrote: >> Since 18.11, it is suggested that driver should release all its private >> resources at the dev_close routine. So all resources previously released >> in remove routine are now released at the dev_close routine, and the >> dev_close routine will be called in driver remove routine in order to >> support removing a device without closing its ports. >> >> Above behavior changes are supported by setting RTE_ETH_DEV_CLOSE_REMOVE >> flag during probe stage. >> >> Signed-off-by: Xiaolong Ye > ><...> > >> @@ -936,14 +940,7 @@ rte_pmd_af_xdp_remove(struct rte_vdev_device *dev) >> if (eth_dev == NULL) >> return -1; >> >> - internals = eth_dev->data->dev_private; >> - >> - rte_ring_free(internals->umem->buf_ring); >> - rte_memzone_free(internals->umem->mz); >> - rte_free(internals->umem); >> - >> - rte_eth_dev_release_port(eth_dev); > >I thinks we should keep 'rte_eth_dev_release_port()' in '.remove()' path, >the 'RTE_ETH_DEV_CLOSE_REMOVE' flag will take care of this in >'rte_eth_dev_close()' but still needed in '.remove()' path. > remove() would call eth_dev_close which includes the rte_eth_dev_release_port(). Thanks, Xiaolong >> - >> + eth_dev_close(eth_dev); >> >> return 0; >> } >> > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1127FA0679 for ; Tue, 30 Apr 2019 04:13:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F40E46833; Tue, 30 Apr 2019 04:13:11 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 620A91D9E for ; Tue, 30 Apr 2019 04:13:10 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 19:13:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,412,1549958400"; d="scan'208";a="169143939" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by fmsmga001.fm.intel.com with ESMTP; 29 Apr 2019 19:13:08 -0700 Date: Tue, 30 Apr 2019 10:06:36 +0800 From: Ye Xiaolong To: Ferruh Yigit Cc: dev@dpdk.org, Thomas Monjalon Message-ID: <20190430020636.GB37233@intel.com> References: <20190426050912.109813-1-xiaolong.ye@intel.com> <20190426050912.109813-2-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v1 1/2] net/af_xdp: remove resources when port is closed 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" Message-ID: <20190430020636.ejf4Fx5DYZOBOaHfUk-wtmHA1_8TJmQlKYcrN8NVeD8@z> Hi, Ferruh On 04/29, Ferruh Yigit wrote: >On 4/26/2019 6:09 AM, Xiaolong Ye wrote: >> Since 18.11, it is suggested that driver should release all its private >> resources at the dev_close routine. So all resources previously released >> in remove routine are now released at the dev_close routine, and the >> dev_close routine will be called in driver remove routine in order to >> support removing a device without closing its ports. >> >> Above behavior changes are supported by setting RTE_ETH_DEV_CLOSE_REMOVE >> flag during probe stage. >> >> Signed-off-by: Xiaolong Ye > ><...> > >> @@ -936,14 +940,7 @@ rte_pmd_af_xdp_remove(struct rte_vdev_device *dev) >> if (eth_dev == NULL) >> return -1; >> >> - internals = eth_dev->data->dev_private; >> - >> - rte_ring_free(internals->umem->buf_ring); >> - rte_memzone_free(internals->umem->mz); >> - rte_free(internals->umem); >> - >> - rte_eth_dev_release_port(eth_dev); > >I thinks we should keep 'rte_eth_dev_release_port()' in '.remove()' path, >the 'RTE_ETH_DEV_CLOSE_REMOVE' flag will take care of this in >'rte_eth_dev_close()' but still needed in '.remove()' path. > remove() would call eth_dev_close which includes the rte_eth_dev_release_port(). Thanks, Xiaolong >> - >> + eth_dev_close(eth_dev); >> >> return 0; >> } >> >