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 09A28A04B1; Wed, 23 Sep 2020 22:44:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B05B01DB36; Wed, 23 Sep 2020 22:44:13 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 5176F1D94A for ; Wed, 23 Sep 2020 22:44:12 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6B23E5C00BE; Wed, 23 Sep 2020 16:44:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 23 Sep 2020 16:44:10 -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=fm2; bh= gdwFPM6D8dEQt92SnFXb0n17F+IrNl2oAKqj5F8F3J4=; b=QSpDz1pBh068c6yE Y8aBbGw7t0jaDtC6nKk4S2zopRH0nae0oME4TSBiFmpSr2qROKUs41r2l8bknkVb Ee9WJVuIdPSKu7SFT4ptrKHoeOU/jS6+P1PrNpTkA5CaKBz76VryvrKZHRq3fpVW kzQvCggtSy773o6f7wWVZ0XUySC6CywxCJEvj0hzydQ7i7IyRkGjg9jTQcmZet3U 9igEWQtT1G/nC3KIB2Ko9fqjPPjyLiU/EkBCecQmkfZ3/6RDgB/P0Jo5vOJyhxC1 nsQOCB/vmkPFHxiHvA1bGolW0baojs67sL0kNMgbX1AxaEWB4zAA6/G4/lh18m9d 0QRrUA== 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=fm3; bh=gdwFPM6D8dEQt92SnFXb0n17F+IrNl2oAKqj5F8F3 J4=; b=ZSKg9sV00FmR5BniZ/INFsf8chDlX1mNucCaPuA553zd//ZSAM1liGFG8 3fBie2YiuIpX7LvdN3RgYgJXIAXQv+OpBjBT2TWLOzE7h/w2pRdDrFqpHw5WOKau 86pnRdvJD/Wqq4IGQDfYP/Iv6GBJFq2rGJI7q8gxPkF+HBioVA/+pS14I0yMOXSD NqoyPQgo8FRgqExWCbUqqsCzlwCVoXnTeZQbkTj0/jIYlrRJj7VrD/WYqwjg4KAq mwW7CkdRKhcXe4mzNzZ6L17flhSNg7m+xbeAOKWdeXClH4ppI6Cyh+6xWHi5u4k9 i7br9YKZtAxshicYi1uusRFfreG+Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeigdduheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght 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 B885A306467D; Wed, 23 Sep 2020 16:44:09 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org, arybchenko@solarflare.com, Anatoly Burakov Date: Wed, 23 Sep 2020 22:44:08 +0200 Message-ID: <6917397.Q1i2GfNnKL@thomas> In-Reply-To: <721acbe3-9f67-c98c-e964-6be2e1ec3f2c@intel.com> References: <20200913220711.3768597-1-thomas@monjalon.net> <20200913220711.3768597-13-thomas@monjalon.net> <721acbe3-9f67-c98c-e964-6be2e1ec3f2c@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 12/20] net/pcap: release port upon 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" 23/09/2020 18:44, Ferruh Yigit: > On 9/13/2020 11:07 PM, Thomas Monjalon wrote: > > The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources > > can be freed by rte_eth_dev_close(). > > > > Freeing of private port resources is moved > > from the ".remove(device)" to the ".dev_close(port)" operation. > > > > Signed-off-by: Thomas Monjalon > > --- > > drivers/net/pcap/rte_eth_pcap.c | 29 ++++++++++++++--------------- > > 1 file changed, 14 insertions(+), 15 deletions(-) > > > > diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c > > index 76e704a65a..a946fa9a1a 100644 > > --- a/drivers/net/pcap/rte_eth_pcap.c > > +++ b/drivers/net/pcap/rte_eth_pcap.c > > @@ -734,6 +734,12 @@ eth_dev_close(struct rte_eth_dev *dev) > > unsigned int i; > > struct pmd_internals *internals = dev->data->dev_private; > > > > + if (internals == NULL) > > + return 0; > > Not sure if this check needed, can 'internals' be null at this stage? I think yes we need to protect against a double close. > But perhaps need to add 'RTE_PROC_PRIMARY' check. Yes but that's not the goal of this patch. > > + rte_free(dev->process_private); > > Can we move freeing 'process_private' to 'rte_eth_dev_release_port()' Yes we could.