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 A8889A0548; Wed, 1 Jun 2022 19:03:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83CCA40689; Wed, 1 Jun 2022 19:03:46 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 9CC454003F for ; Wed, 1 Jun 2022 19:03:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654103024; x=1685639024; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=J9n68I0Yi8JGb8jtRS6GlUyggnj813riqmHBZ1kMkfg=; b=VD5jxzEMyhFHGLrKtPPWHIA3S1VF9E6IkmhqZZzzadX2tvYrdTJEdXi4 hRTBam1oT/yCWfEO+mtLOWt64NVGZ3MciXN2cT4C0FyHQguK0acydmMyV YeqSsYVJdYNMT6eaJfqHZ3ZrlzTR76cy/ppJrAIxr7oWbK8lGETKSZ/h3 a2GoKxlMrH0k/DvQAkBQTQvZyMRd6s7SqGBv4Y1/rAWbolzvZHtbGWLd4 k9tlrbkqvpdgfeO7OtqfNgJqA94JyrR/U2i7MW93TeNr8ZJ8CtRPWUV4z aqHT3V2YmYdFWiK8iWjWT7EVcu46vUr8aM+c0THk1DJ2c8msQf6p/23tC g==; X-IronPort-AV: E=McAfee;i="6400,9594,10365"; a="275667808" X-IronPort-AV: E=Sophos;i="5.91,269,1647327600"; d="scan'208";a="275667808" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 10:03:43 -0700 X-IronPort-AV: E=Sophos;i="5.91,269,1647327600"; d="scan'208";a="606369152" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.7.112]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 01 Jun 2022 10:03:42 -0700 Date: Wed, 1 Jun 2022 18:03:39 +0100 From: Bruce Richardson To: Kevin Laatz Cc: dev@dpdk.org, Morten =?iso-8859-1?Q?Br=F8rup?= Subject: Re: [PATCH v6] eal: add bus cleanup to eal cleanup Message-ID: References: <20220419161438.1837860-1-kevin.laatz@intel.com> <20220601170234.11100-1-kevin.laatz@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220601170234.11100-1-kevin.laatz@intel.com> 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 On Wed, Jun 01, 2022 at 06:02:34PM +0100, Kevin Laatz wrote: > During EAL init, all buses are probed and the devices found are > initialized. On eal_cleanup(), the inverse does not happen, meaning any > allocated memory and other configuration will not be cleaned up > appropriately on exit. > > Currently, in order for device cleanup to take place, applications must > call the driver-relevant functions to ensure proper cleanup is done before > the application exits. Since initialization occurs for all devices on the > bus, not just the devices used by an application, it requires a) > application awareness of all bus devices that could have been probed on the > system, and b) code duplication across applications to ensure cleanup is > performed. An example of this is rte_eth_dev_close() which is commonly used > across the example applications. > > This patch proposes adding bus cleanup to the eal_cleanup() to make EAL's > init/exit more symmetrical, ensuring all bus devices are cleaned up > appropriately without the application needing to be aware of all bus types > that may have been probed during initialization. > > Contained in this patch are the changes required to perform cleanup for > devices on the PCI bus and VDEV bus during eal_cleanup(). There would be an > ask for bus maintainers to add the relevant cleanup for their buses since > they have the domain expertise. > > Signed-off-by: Kevin Laatz > Acked-by: Morten Brørup > Reviewed-by: Bruce Richardson