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 D1609A0542; Wed, 5 Oct 2022 09:46:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77EC340A7D; Wed, 5 Oct 2022 09:46:04 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id BC8B540694 for ; Wed, 5 Oct 2022 09:46:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664955963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YcNfgc8wK3hz2n0vIZz6ugIperGzbtrFaIrO6ep3lXM=; b=Xd/2WhAy84t9YqZozyxDp7Vp4S/X9LEdYekeQCVR67+LbNrnh7iL6IBglW8FpH9x6Bn567 zoIMcZhF2uvTRc8MRinFC//DVn/7b8yTlZjL/8lKQXyj4ueEEgHfyMI4AJR3hp5BJR1Smm HMPEgCxW3Wf/JSRZ4JUWSWNhuzgwZK4= Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-332-KlZzBnqpPh2pH157PcfD3w-1; Wed, 05 Oct 2022 03:46:02 -0400 X-MC-Unique: KlZzBnqpPh2pH157PcfD3w-1 Received: by mail-pj1-f72.google.com with SMTP id e60-20020a17090a6fc200b0020a8a65051eso633984pjk.9 for ; Wed, 05 Oct 2022 00:46:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=YcNfgc8wK3hz2n0vIZz6ugIperGzbtrFaIrO6ep3lXM=; b=eBEK34ZTBNdyYtIbyKjM1OPb+lhajMkTiD6PuU4HAREL+yYMm0280ZkAPWi0+kcsXg KFZoMS8q2Sv2e7jxXM09w7QsLVrfegPF23y5vNRhTimr0wxH+fznRMDOh+Hoj8nNIR+7 +rbPxe452O0MnahlYCJhTpcL3+M2SdgeTZtWB2aavvPa6UPZAYCJZ5KytuJHDNEKfa0v HlzTFQjW0OfvXNaiV6bNwmqwWahUwz+uHqmmFsejimeqHXhJowi9DRbkHHZgN5Cox6nZ G9tsta8iCMyT4PFqS7kcmlkV1cx+2Pc3K8qtuxRAERVdhAp7EAu8zTptcSqcL12uD+P2 VpDw== X-Gm-Message-State: ACrzQf3MRq9Y5lrVUvytM5u0Zl0wxryO6xx66U7tfmM8x0+bwZD132Ks sw1nKqshnpb7CJfiMtgx88XJgidqadY1OydHhxSKb8eSyRh8aVHIOphP7KEBQtVp6jFVFduFedH tM8gAQ+eVQLEsrURLWTs= X-Received: by 2002:a17:903:2302:b0:178:286c:86a8 with SMTP id d2-20020a170903230200b00178286c86a8mr29512533plh.172.1664955961030; Wed, 05 Oct 2022 00:46:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5g7mbVI4mzana7dOOx5CXa5Bori9xbdyBY/JR0xVAXg+NBVoqDmdXiftBzChddxIl1csaaFOobnf1id4pkakM= X-Received: by 2002:a17:903:2302:b0:178:286c:86a8 with SMTP id d2-20020a170903230200b00178286c86a8mr29512521plh.172.1664955960783; Wed, 05 Oct 2022 00:46:00 -0700 (PDT) MIME-Version: 1.0 References: <20220419161438.1837860-1-kevin.laatz@intel.com> <20221004165051.153751-1-kevin.laatz@intel.com> In-Reply-To: <20221004165051.153751-1-kevin.laatz@intel.com> From: David Marchand Date: Wed, 5 Oct 2022 09:45:49 +0200 Message-ID: Subject: Re: [PATCH v9] eal: add bus cleanup to eal cleanup To: Kevin Laatz Cc: dev@dpdk.org, bruce.richardson@intel.com, mb@smartsharesystems.com, lizh@nvidia.com, matan@nvidia.com, stephen@networkplumber.org, lihuisong@huawei.com, Parav Pandit , "Xueming(Steven) Li" , Rosen Xu , Hemant Agrawal , Sachin Saxena , Long Li , Thomas Monjalon , Ferruh Yigit X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Oct 4, 2022 at 6:47 PM 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 befor= e > 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 t= he > system, and b) code duplication across applications to ensure cleanup is > performed. An example of this is rte_eth_dev_close() which is commonly us= ed > 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 type= s > 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. Cc: maintainers for info. > Signed-off-by: Kevin Laatz > Acked-by: Morten Br=C3=B8rup > Reviewed-by: Bruce Richardson Applied, thanks. --=20 David Marchand