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 01C26A034E; Tue, 1 Feb 2022 08:43:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 766C640691; Tue, 1 Feb 2022 08:43:30 +0100 (CET) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by mails.dpdk.org (Postfix) with ESMTP id E564B40685 for ; Tue, 1 Feb 2022 08:43:28 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 0CA8E580287; Tue, 1 Feb 2022 02:43:26 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 01 Feb 2022 02:43:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding: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=fm3; bh=mRluGnaCj/uc99 kVDrLPRXDy3UGkEXwUAkQqGksITZw=; b=inyiI9SYQnJqI+vCsRILUx3syhl/qw rxK9bWzxM83L/v/Ili4z8IdPp53kBx6hxi/yzbAOgb5Lz4WtYOGGEix2lBtzb8nM 0Fsv+q1u+QLgnvkbV7G59SfVvz5qSlgUuqEjDEVYiFGPPeX5+zaRIzaeAO91ZdeF qxV5g1g3+GIArLm3zVjf83o5CmNTZlSSQLQ2v+0zyHOA9Csq0gxExahg8M2v6dPc iwlSLGCKmgwTIhWE/DUN2am1z0h2WhUWkcGAOTJ7lVGCIZg38yaOl+CztvZ5m1L2 20wWAnwe1zH3TXybShPaC9jey+ZBHfy1V1kShE3siWL/AjReuroRNJbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date: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=fm2; bh=mRluGnaCj/uc99kVDrLPRXDy3UGkEXwUAkQqGksIT Zw=; b=eq7WwrytM/GF+Z6w1ehl0cDTgYjCuni999wDl/mn+4mqse6865N+MWCQR w5YM1Y0G1etMjFsxuy5hY6rPf8gdBEuKrZ4dvx6ddeBoyKIa1VkctCU9DAdyzOa+ HRtx98zkzRUw4hcfu7j0vUdEZK9yfvtbA0VrHXC1f/MRDU626xAXBem2KiIc6f1K eQdnASQhSDVnukcJXirKjX08lpHWp0kBQ+/rzy6FEC19ZamiOAYjXLqkwBT4C/xO 1swRz2wFzpYxY1xOj399N371gJCWPQHMEcp/F+iSh+q7U4VSImhF4AY2Yyv/pqcU a22bHB+1J7VRBD+3LXIPLivnIdfKw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrgedvgdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Feb 2022 02:43:24 -0500 (EST) From: Thomas Monjalon To: Rohit Raj Cc: Bruce Richardson , Ray Kinsella , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , "dev@dpdk.org" , Nipun Gupta , Sachin Saxena , Hemant Agrawal , "ferruh.yigit@intel.com" , "david.marchand@redhat.com" Subject: Re: [EXT] Re: [PATCH v5 1/2] eal: add API for bus close Date: Tue, 01 Feb 2022 08:43:22 +0100 Message-ID: <2030926.bB369e8A3T@thomas> In-Reply-To: References: <20201008153048.19369-1-rohit.raj@nxp.com> <16764163.5WZRyvrzyv@thomas> 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 01/02/2022 06:40, Rohit Raj: > From: Thomas Monjalon > > 20/01/2022 15:51, Rohit Raj: > > > Hi Thomas, > > > > > > This "rte_bus_close" API is introduced to do the opposite of what > > "rte_bus_probe" does. Just like there are plug and unplug APIs for plugging and > > unplugging a single device. > > > > > > The API you mentioned, "rte_dev_remove" supports only rte_device. But we > > also need to close/remove private devices of dpaa and fslmc buses which are > > not exposed directly to user (eg: mempool device). > > > Note that these private devices/bus objects are not associated with a > > particular rte_device but they are available as a resource to be used by any of > > the device based on these hardware specific buses. > > > So, to close these devices, we need a new API which can do this for us. That is > > why "rte_bus_close" is required. > > > > You mean some resources are associated to a bus but not to a device? > > It lools very weird. A resource on a bus *is* a device. > > > > PS: please avoid top-post > > FSLMC bus has hardware resources for memory pools, queues, hardware access lock(called portal). > These are common resources, which can be associated with any device. So they don't belong to a specific device. > Eg: mempool resource can be used by both eth and crypto device. So, we cannot close mempool while closing just one of the device(It can happen in multiprocess applications). So, these resources should be specifically closed/freed with the bus instead with a device. > > There is no need to expose these devices to users and their usages is limited to other devices on the bus. There is no reason to create yet another type of device in DPDK to expose these internal only resources. OK I understand better now, thanks. > > > From: Thomas Monjalon > > > > 10/01/2022 06:26, rohit.raj@nxp.com: > > > > > From: Rohit Raj > > > > > > > > > > As per the current code we have API for bus probe, but the bus > > > > > close API is missing. This breaks the multi process scenarios as > > > > > objects are not cleaned while terminating the secondary processes. > > > > > > > > > > This patch adds a new API rte_bus_close() for cleanup of bus > > > > > objects which were acquired during probe. > > > > > > > > I don't understand how closing all devices of a bus will help better > > > > than just closing all devices. > > > > > > > > As Ferruh already suggested in the past, we could force closing all > > > > devices in rte_eal_cleanup(). > > > > And we already have the function rte_dev_remove().