From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id A88D542BF1;
	Mon,  5 Jun 2023 18:12:56 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 7DDBE4021F;
	Mon,  5 Jun 2023 18:12:56 +0200 (CEST)
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com
 [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 9B2A04003C;
 Mon,  5 Jun 2023 18:12:54 +0200 (CEST)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 302305C00B6;
 Mon,  5 Jun 2023 12:12:54 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Mon, 05 Jun 2023 12:12:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:sender:subject:subject:to:to; s=fm1; t=
 1685981574; x=1686067974; bh=UELkaBXIwoFApmaT3lMNQpaaiHV72mHaZp5
 78wBdBA4=; b=sIJdQNvSfG4a7uMK0UAvDAwpc39a7qDWOu54uC7oZAccRHLYfBw
 vir1tneEGrLHVZmMnLZyoEn1LyhegIxsPQxmn/gGVSJgDdmChUD8ssxk3cdCinCF
 LIbfC3m92bcN1D3sBaRsOGoM4mlN9Txyualp7yCOYso+z2YXNZVsRY+KipVIpSH0
 ab/f506+4Iw9A2gEfd2Hw3/JhdcOJY8W+VtbhLYNvtDpg9m3LRxPYNMmYvv7ipv/
 WSUMY/+HvcNwJZn2parWfdIgOcN3mSv/OFB9a0EdSVKC9jvat5kvynEERitUOZaR
 +5KlH7oP7EoZa+opT7kvn5WNJvOB8CG+5tQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:sender:subject:subject:to:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=
 1685981574; x=1686067974; bh=UELkaBXIwoFApmaT3lMNQpaaiHV72mHaZp5
 78wBdBA4=; b=C/kDIk8hjIS+l5+ZSA1hw2P4T2bK7GuazvvYJDQXxdCgtl6EZq4
 vu2ASpzFn/Q3LcGXfNYetYqQiHLI5OGnTn834IDWCxFf5TUr7kjiUpVWdj7sVkqw
 YdaP2vLObweGPRFvQ1YzBKqs8h2zBLCy+shtC5Yc3PbplRrcZ9m5R4B+v04vQOIm
 gENVOAKSuQ8r8gg2Ps/Yrm80BU0KjhhUDc+9UtCjqe+Ynhj0X7ca59By127joDT6
 8oD0AlWlqHbOgrGWCrh0Hm+HcLw/f9ApRQCVP579idRvxqp9NgAnwuQEOIA5dUQs
 c4B0tPjp4uso+nwmBeRuWDB6LAOZfSkUSGA==
X-ME-Sender: <xms:hQl-ZNnlsphCyFUjb_ggldTcUxylmycspWx47UWjphCxKvpTFEVaow>
 <xme:hQl-ZI3vrhjvfQJxc6KVJdtZQvp5BK8MKtwd-AchDEvN3CKN70DiLdWvVQIKjoP0F
 kAFNSS9zfV_fOa7NQ>
X-ME-Received: <xmr:hQl-ZDoFEcFJHduMQKOgmq61meRBVhjNJxk9UbtRDzhGTMY-CvDa78_7NQcO1qBnBXqQ1UTQibJqYLa6gulmYGHd8w>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeelledgleelucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm
 rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc
 ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei
 kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh
 hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:hgl-ZNnBTOFKUkfS0AVXvI1xQqbybiik7tJbRi6NrUUkVShQblKE_A>
 <xmx:hgl-ZL1DJwK-DYJ8iLFQymqMWGS3Sy5aO9xf5drctLPqQwBpmTloQw>
 <xmx:hgl-ZMtBtgojDWlmoAEHclfOLrKpr2QtJ7D_NYlp5tX5wub7b-kmDg>
 <xmx:hgl-ZL_bQFbzVYWL7qVINbROlJBeiYFPsqbydZZ2HdU8-dwxfS7JfA>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 5 Jun 2023 12:12:52 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org, david.marchand@redhat.com,
 Tyler Retzlaff <roretzla@linux.microsoft.com>, dmitry.kozliuk@gmail.com,
 Tal Shnaiderman <talshn@nvidia.com>
Subject: Re: [PATCH] eal: fix calling cleanup function twice
Date: Mon, 05 Jun 2023 18:12:51 +0200
Message-ID: <16531816.0ZKypZ73Fx@thomas>
In-Reply-To: <20230601160855.119801-1-bruce.richardson@intel.com>
References: <20230601160855.119801-1-bruce.richardson@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
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

01/06/2023 18:08, Bruce Richardson:
> If an app calls rte_eal_cleanup() inside it's own code, then cleanup
> could be called a second time automatically when the app exits. While
> mostly harmless, we can avoid any potential issues by guaranteeing that
> cleanup only gets called once, in the same way that eal_init only ever
> gets called once.
> 
> Note: This patch only touches Linux and FreeBSD. Windows EAL does not
> have run-once guard on the init function, so omitting it in the cleanup
> function.
> 
> Fixes: aec9c13c5257 ("eal: add function to release internal resources")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.

Please we should keep the same behavior in Linux, FreeBSD and Windows.
Is there any volunteer to add run-once guards in init and cleanup
for Windows EAL?