From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 66B18A04C0;
	Fri, 25 Sep 2020 15:13:17 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id ED0481E928;
	Fri, 25 Sep 2020 15:13:15 +0200 (CEST)
Received: from wout2-smtp.messagingengine.com (unknown [64.147.123.25])
 by dpdk.org (Postfix) with ESMTP id D15841C2BB
 for <dev@dpdk.org>; Fri, 25 Sep 2020 15:13:14 +0200 (CEST)
Received: from compute7.internal (compute7.nyi.internal [10.202.2.47])
 by mailout.west.internal (Postfix) with ESMTP id A1DBAB59;
 Fri, 25 Sep 2020 09:13:04 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute7.internal (MEProxy); Fri, 25 Sep 2020 09:13:05 -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=
 rBNSfCxzUkvtKu+x65xtuPafwsfPi2jUYjnBlrld67k=; b=wrRxL6QN2uqmXMWG
 bxPrsdHnUCIU0S0NbiQlpz6sMsiz3wSLF7zWZqoCuWA4FTkTYCYmC037PSL91i/z
 ylwIF5+jvSPc1Pfh1NUNZxmYyr2WkD1i9/xiCAs9nJ6uLMErFY5luRE966p8Lb/r
 10w0MiKLz85xYqtlq58orsgthvardy+y8mqCeiV/O/WQTl2fYrNTvMqimUPTJkmL
 BKuiSdhLtxu/hl+j9f+8nC0TxM/hECXhj5Dm3xzu0x6nQfQ/ToRdUE7vuHXbktLx
 tuW8AHxM1gSq8bVbHjF0JxKvwFEMDOF9G1pxDXNhZuswOWcKCUPCWpHMANEBD3Wv
 Z6rRhw==
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=rBNSfCxzUkvtKu+x65xtuPafwsfPi2jUYjnBlrld6
 7k=; b=BTl4Z3tKbhXZ0QlV3a4BQ78nfgJvocecVw59xyiKlJ8hnD2eXmRiUgft8
 zbyCQQBXJkHN2HNtqmdp3PvM5Gat5wTFL9AUnXwUej0GmijWYau8P7r1yan+WuKj
 zuEde8FHdPMarBQWoLuKXTuX2dYOiszEFzArdk4ZELm1IO9JWiZQ3rxnXkqJP/UO
 SlpGb+2zoIeCt9JjuXxxiOu1OYCCxf6lwPVtA2E7rcrVno6YmUipOyQUugIQiGYB
 rlfP0OEt5Sr/GJ3qSJRfRHqmGQioLrMRl9qQZKf3SrY/yOEV5fS0tt8JLHlg++KM
 S9q7Vb6zm2DY4F4qgaRN4UM+Ug+bA==
X-ME-Sender: <xms:3-xtXzYG7KVd-kYhFK5f8aRC86oTEXY0zsmuxMIkMkhNZlp9ROKXZQ>
 <xme:3-xtXyZF0Yhl6e5R2umc6zKkdnJiICByP4F20mkHnSjG-Y4tt53x-Whq_nJYsM236
 WxiSZAQEvQKyHv5ew>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtgdeitdcutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf
 frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei
 iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih
 iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho
 nhdrnhgvth
X-ME-Proxy: <xmx:3-xtX1_tou_pDPFXTp9SFYmuZ8f_USoAmqG17rBeNeWHMr8s_dQoIQ>
 <xmx:3-xtX5rXGeQlk5R1XDF1LUt5e8-jh1qVV6-OMLITfoONfemNcqd1UA>
 <xmx:3-xtX-rs8OD7_26JXuAhwAXTuqX6lZPH4XdHSbzDt8cob9QQn_X2Sg>
 <xmx:4OxtX13t0PKBdCrfqq0G_JHM4DjJGSGta3YuKvvCa0BcK827e_VjxQ>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 3C4323064680;
 Fri, 25 Sep 2020 09:13:03 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, arybchenko@solarflare.com,
 Tetsuya Mukawa <mtetsuyah@gmail.com>,
 Anatoly Burakov <anatoly.burakov@intel.com>
Date: Fri, 25 Sep 2020 15:13:00 +0200
Message-ID: <3329999.HcEyS4PmmF@thomas>
In-Reply-To: <315841ef-2f36-6a43-0855-416a8e1b3b4b@intel.com>
References: <20200913220711.3768597-1-thomas@monjalon.net>
 <9908596.DBVW2PyNQy@thomas> <315841ef-2f36-6a43-0855-416a8e1b3b4b@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH 10/20] net/null: release port upon close
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

25/09/2020 10:52, Ferruh Yigit:
> On 9/24/2020 10:58 PM, Thomas Monjalon wrote:
> > 23/09/2020 22:47, Thomas Monjalon:
> >> 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().
> >>>>
> >>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> >>>> ---
> >>>> --- a/drivers/net/null/rte_eth_null.c
> >>>> +++ b/drivers/net/null/rte_eth_null.c
> >>>> +static int
> >>>> +eth_dev_close(struct rte_eth_dev *dev)
> >>>> +{
> >>>> +	PMD_LOG(INFO, "Closing null ethdev on NUMA socket %u",
> >>>> +			rte_socket_id());
> >>>> +
> >>>> +	/* mac_addrs must not be freed alone because part of dev_private */
> >>>> +	dev->data->mac_addrs = NULL;
> >>>> +
> >>>> +	return 0;
> >>>> +}
> >>>
> >>> should check 'RTE_PROC_PRIMARY' in 'eth_dev_close()'?
> >>
> >> Yes, looks to be a miss for this new function.
> > 
> > Sorry no, this function is not freeing any shared data,
> > so no restriction on secondary process.
> 
> "dev->data->mac_addrs = NULL", won't this change the shared data?

Absolutely, you're right.
Will fix in v2.