From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D0DBC43219 for ; Tue, 30 Apr 2019 02:13:13 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 1697D21655 for ; Tue, 30 Apr 2019 02:13:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1697D21655 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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=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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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; >> } >> >