From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A0C842C40; Tue, 6 Jun 2023 16:27:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54D2D40697; Tue, 6 Jun 2023 16:27:05 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 77A1040223 for ; Tue, 6 Jun 2023 16:27:04 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 143E75C0086; Tue, 6 Jun 2023 10:27:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 06 Jun 2023 10:27:04 -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= 1686061624; x=1686148024; bh=gybCEmI8HSc7p6IQkqKTrroZZAcx78hQMlc vD6p0u3o=; b=uFbdUAFlNVJW6Aa1ziVBdjYg2AHJBlshIrEzzsyvEpzKwhdPSna 0Ig6/jGUyeTxg0JSLMOwSTeq/+a9rzCEMgMcWWIaj8A4acAVCl20yKYsYKO9pdHK ctYhJ2F98fTl680Cc7ZufSb3gf4aOJYkzP4nwbp0GkyitroO51oc1TtVjicpl6uG 0zO5nJ/y03R51HTnIbQJ3UZOlwOIzN/ebqjQBVNkw9h0pwEOdBG9eDQ8x3W11DI+ Mzx4lJnKTjNyJEY1yyl9baJJYGnakgS0/2nU/J2j1zjurh2B3n5s6YlaOX5pA1R8 5AK8JVe/71NuWp9azMlYd7C1QdP8uST221Q== 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= 1686061624; x=1686148024; bh=gybCEmI8HSc7p6IQkqKTrroZZAcx78hQMlc vD6p0u3o=; b=Rx0eLOTrAa6Fxg9DFFaGzbqSzdEeLhb5339fpZwWfvbnc4JvbKQ FrPPsbC3TSkhSahnbzJMll86tbzc75RJY+37R+w8HgjM1/XUcs3GQimJ111t+g/8 h4v7VrSN0IiXs1T4LtpsEySybvwc6UpkvEFggo+gBD9NwkceKvtnZO0fTNyAS7wm OWjFwoT9uSMmjFZ9EqnjaqUBfPMo3he6L6S374717zhYEasufFdd7zq00Ys3oLYu mfQ1ODE19/dl9SxLUe9B/MY+doKngOwtcSNafsChHwdS3PpgSrnY6CpKsjvRpaLk tfAVpXg48ea9se17qyrKy/VitNAGaGmrFAw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtuddgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Jun 2023 10:27:03 -0400 (EDT) From: Thomas Monjalon To: Long Li Cc: Ferruh Yigit , dev@dpdk.org, Ajay Sharma , longli@linuxonhyperv.com Subject: Re: [PATCH] bus/vmbus: add cleanup support Date: Tue, 06 Jun 2023 16:27:01 +0200 Message-ID: <3429539.WBkqHH8m98@thomas> In-Reply-To: <1679427105-31644-1-git-send-email-longli@linuxonhyperv.com> References: <1679427105-31644-1-git-send-email-longli@linuxonhyperv.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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 21/03/2023 20:31, longli@linuxonhyperv.com: > From: Long Li > > Implement VMBUS cleanup callback from eal_cleanup(). > > Signed-off-by: Long Li > --- > drivers/bus/vmbus/vmbus_common.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c > index 8d32d66504..a6277bfc06 100644 > --- a/drivers/bus/vmbus/vmbus_common.c > +++ b/drivers/bus/vmbus/vmbus_common.c > @@ -188,6 +188,34 @@ rte_vmbus_probe(void) > return (probed && probed == failed) ? -1 : 0; > } > > +static int > +rte_vmbus_cleanup(void) > +{ > + struct rte_vmbus_device *dev, *tmp_dev; > + int error = 0; > + > + RTE_TAILQ_FOREACH_SAFE(dev, &rte_vmbus_bus.device_list, next, tmp_dev) { > + > + const struct rte_vmbus_driver *drv = dev->driver; > + int ret; > + > + if (!drv || !drv->remove) Changed to "== NULL" comparisons for the style :) > + continue; > + > + ret = drv->remove(dev); > + if (ret < 0) > + error = -1; > + > + rte_vmbus_unmap_device(dev); > + > + dev->driver = NULL; > + dev->device.driver = NULL; > + free(dev); > + } > + > + return error; > +} Applied, thanks.