From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by dpdk.org (Postfix) with ESMTP id 6FFB25F51 for ; Mon, 29 Apr 2019 22:14:22 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id EE22DC42; Mon, 29 Apr 2019 16:14:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 29 Apr 2019 16:14:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=KVP6yCWhiGIk8qt3PsXHcUTkYeSnA9L4Js7dac973S8=; b=iVpe3cNNHqRh ctz0knDM8le2/PxbD33rWaZfrRIEDCT7zNzWyG/HcFHmifuLHOEekWO7DpFGAgCa shc3sPw8VIJc4pg2JCpQx9GY6TPVdI1RqvFn0RTCM62IN0RLwOPFv/Jw+Ss5WXMY ngej9R8Ih4w177M06B/fUUI88gMmJno= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=KVP6yCWhiGIk8qt3PsXHcUTkYeSnA9L4Js7dac973 S8=; b=j7olgC70gGfDC50o/+jYbya8VN2sJ8H85b/JsKlb+D7BQD85pmBH/jgI8 +MWEbCi+ZKGzQn2C8MrRVHZvJdiyCUzwYKA/xOGxP1yKMVD9CEHjeHrQMDp/xVp0 QyNnaRelbDWXHt3malgiN5QVnvaSbc+32OY8MvrmBLu1ki26YSY80O/v1+mZvH0m OoXaiSTPM2Rv9eGBTTgA9LXKHIIPAvgB3c1Fue/qu30kW4K2ff8IBF02Or1Galk/ IL7Wo+lI+NOGWsDY1OPn+id6vCDJZa48kkFthiGCxhcrRn8DICbopn2HJc0P8Qsk 2t0dHRO3khZlu0GyqlSWH4D5KDipw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddriedvgddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukf hppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghmpehmrghilhhfrhhomhepthhh ohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 3FFAD10319; Mon, 29 Apr 2019 16:14:17 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: Xiaolong Ye , dev@dpdk.org Date: Mon, 29 Apr 2019 22:14:15 +0200 Message-ID: <4288940.mimLx63fH2@xps> In-Reply-To: References: <20190426050912.109813-1-xiaolong.ye@intel.com> <20190426050912.109813-2-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Mon, 29 Apr 2019 20:14:22 -0000 29/04/2019 19:00, Ferruh Yigit: > 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. I don't understand your comment. Calling the close function looks the right thing to do in "remove". > > - > > + eth_dev_close(eth_dev); 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 BA7EBA0679 for ; Mon, 29 Apr 2019 22:14:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A49035F62; Mon, 29 Apr 2019 22:14:23 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by dpdk.org (Postfix) with ESMTP id 6FFB25F51 for ; Mon, 29 Apr 2019 22:14:22 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id EE22DC42; Mon, 29 Apr 2019 16:14:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 29 Apr 2019 16:14:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=KVP6yCWhiGIk8qt3PsXHcUTkYeSnA9L4Js7dac973S8=; b=iVpe3cNNHqRh ctz0knDM8le2/PxbD33rWaZfrRIEDCT7zNzWyG/HcFHmifuLHOEekWO7DpFGAgCa shc3sPw8VIJc4pg2JCpQx9GY6TPVdI1RqvFn0RTCM62IN0RLwOPFv/Jw+Ss5WXMY ngej9R8Ih4w177M06B/fUUI88gMmJno= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=KVP6yCWhiGIk8qt3PsXHcUTkYeSnA9L4Js7dac973 S8=; b=j7olgC70gGfDC50o/+jYbya8VN2sJ8H85b/JsKlb+D7BQD85pmBH/jgI8 +MWEbCi+ZKGzQn2C8MrRVHZvJdiyCUzwYKA/xOGxP1yKMVD9CEHjeHrQMDp/xVp0 QyNnaRelbDWXHt3malgiN5QVnvaSbc+32OY8MvrmBLu1ki26YSY80O/v1+mZvH0m OoXaiSTPM2Rv9eGBTTgA9LXKHIIPAvgB3c1Fue/qu30kW4K2ff8IBF02Or1Galk/ IL7Wo+lI+NOGWsDY1OPn+id6vCDJZa48kkFthiGCxhcrRn8DICbopn2HJc0P8Qsk 2t0dHRO3khZlu0GyqlSWH4D5KDipw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddriedvgddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukf hppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghmpehmrghilhhfrhhomhepthhh ohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 3FFAD10319; Mon, 29 Apr 2019 16:14:17 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: Xiaolong Ye , dev@dpdk.org Date: Mon, 29 Apr 2019 22:14:15 +0200 Message-ID: <4288940.mimLx63fH2@xps> In-Reply-To: References: <20190426050912.109813-1-xiaolong.ye@intel.com> <20190426050912.109813-2-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" 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: <20190429201415.K4m7cSmlbnnDcxnmP8GcMmssCq7w_6Ldg85L_2LcT5g@z> 29/04/2019 19:00, Ferruh Yigit: > 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. I don't understand your comment. Calling the close function looks the right thing to do in "remove". > > - > > + eth_dev_close(eth_dev);