From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 69DE45B38 for ; Tue, 30 Apr 2019 10:44:06 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2019 01:44:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,413,1549958400"; d="scan'208";a="342049146" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by fmsmga005.fm.intel.com with ESMTP; 30 Apr 2019 01:44:04 -0700 Date: Tue, 30 Apr 2019 16:37:31 +0800 From: Ye Xiaolong To: Ferruh Yigit Cc: dev@dpdk.org, Thomas Monjalon Message-ID: <20190430083731.GC37233@intel.com> References: <20190426050912.109813-1-xiaolong.ye@intel.com> <20190426050912.109813-2-xiaolong.ye@intel.com> <20190430020636.GB37233@intel.com> <570e0036-c0b8-3be7-3375-19f9992f53c3@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <570e0036-c0b8-3be7-3375-19f9992f53c3@intel.com> 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 08:44:06 -0000 On 04/30, Ferruh Yigit wrote: >On 4/30/2019 3:06 AM, Ye Xiaolong wrote: >> 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(). > >'eth_dev_close()' doesn't call the 'rte_eth_dev_release_port()', and it >shouldn't really, am I missing something? Sorry, it's the rte_eth_dev_close that calls rte_eth_dev_release_port, here in .remove we do need to call rte_eth_dev_release_port explicitly. will send a new version. Thanks, Xiaolong > >> >> 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 61355A0679 for ; Tue, 30 Apr 2019 10:44:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC67F5B40; Tue, 30 Apr 2019 10:44:07 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 69DE45B38 for ; Tue, 30 Apr 2019 10:44:06 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2019 01:44:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,413,1549958400"; d="scan'208";a="342049146" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by fmsmga005.fm.intel.com with ESMTP; 30 Apr 2019 01:44:04 -0700 Date: Tue, 30 Apr 2019 16:37:31 +0800 From: Ye Xiaolong To: Ferruh Yigit Cc: dev@dpdk.org, Thomas Monjalon Message-ID: <20190430083731.GC37233@intel.com> References: <20190426050912.109813-1-xiaolong.ye@intel.com> <20190426050912.109813-2-xiaolong.ye@intel.com> <20190430020636.GB37233@intel.com> <570e0036-c0b8-3be7-3375-19f9992f53c3@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <570e0036-c0b8-3be7-3375-19f9992f53c3@intel.com> 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: <20190430083731.-a3U8I9mHUxSjXni0rEPBxW2JXRQ0aK2DsFZWn5rqUc@z> On 04/30, Ferruh Yigit wrote: >On 4/30/2019 3:06 AM, Ye Xiaolong wrote: >> 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(). > >'eth_dev_close()' doesn't call the 'rte_eth_dev_release_port()', and it >shouldn't really, am I missing something? Sorry, it's the rte_eth_dev_close that calls rte_eth_dev_release_port, here in .remove we do need to call rte_eth_dev_release_port explicitly. will send a new version. Thanks, Xiaolong > >> >> Thanks, >> Xiaolong >> >>>> - >>>> + eth_dev_close(eth_dev); >>>> >>>> return 0; >>>> } >>>> >>> >