From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 79A155F29 for ; Wed, 17 Oct 2018 09:14:39 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 0CDA5B82470; Wed, 17 Oct 2018 07:14:38 +0000 (UTC) Received: from [192.168.38.17] (91.220.146.112) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 17 Oct 2018 08:14:32 +0100 To: Thomas Monjalon , CC: , References: <20180907233929.21950-1-thomas@monjalon.net> <20181017015450.15783-1-thomas@monjalon.net> <20181017015450.15783-3-thomas@monjalon.net> From: Andrew Rybchenko Message-ID: <7fcb80d5-7abd-3034-f271-bb87fea72de4@solarflare.com> Date: Wed, 17 Oct 2018 10:13:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20181017015450.15783-3-thomas@monjalon.net> Content-Language: en-GB X-Originating-IP: [91.220.146.112] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24160.003 X-TM-AS-Result: No-12.861500-8.000000-10 X-TMASE-MatchedRID: X4bcv0S75KkOwH4pD14DsPHkpkyUphL97yWPaQc4INT9nZJIPtHyFDuY BlClHjLc4MlnMHmZOwoYbwMqNgMVX294Ipa1otxobc297PAGtWZD3kXYiJVSRBhKPOnt5+r6gQF VOfepm/bysOOoIPjR+oI8rUNjgeglZHEsO8YpjZZ05zsoB1UKTuWNJG9IamrcUCgEErrUGFzDEB RCLZxj5uj8fBHMxSkpsywp1M9zB2OMNoAzq9nHoX9NanCUA4VeVF5mUd6sIMazLO3s2nenYvNO7 flRFqXmIGSHKu90xKWSU848M/hs6Me4Woyb+kVFyDp+jSvEtWsl3afZehJEWedlU2K5Jm9bggBA sUW5uWTOH38lNbOoTFxI2ZZX9m4X319rGX8jiaGeAiCmPx4NwLTrdaH1ZWqC1B0Hk1Q1KyLUZxE AlFPo8wi890LaFSrRuVwMId3S/Vbm/8G+PNZwYxhSZIkjKD3JDSkrgMJqSD0zwMc+UXhV8wkU5q XuqRTsXTglRWtvJ0jBGDNbXFHqWJ8Zef0uUnqs X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--12.861500-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24160.003 X-MDID: 1539760478-0K4SdLomF28h Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3 2/4] ethdev: free all common data when releasing port X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2018 07:14:39 -0000 On 10/17/18 4:54 AM, Thomas Monjalon wrote: > This is a clean-up of common ethdev data freeing. > All data freeing are moved to rte_eth_dev_release_port() > and done only in case of primary process. > > It is probably fixing some memory leaks for PMDs which were > not freeing all data. > > Signed-off-by: Thomas Monjalon [...] > diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h > index ca31b5777..a1398a80c 100644 > --- a/lib/librte_ethdev/rte_ethdev_driver.h > +++ b/lib/librte_ethdev/rte_ethdev_driver.h > @@ -58,7 +58,16 @@ struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name); > > /** > * @internal > - * Release the specified ethdev port. > + * Notify RTE_ETH_EVENT_DESTROY and release the specified ethdev port. > + * > + * The following data fields will be freed: > + * - rx_queues > + * - tx_queues I think rx_queues and tx_queues from should not be mentioned here. They are managed by ethdev and there is no options here. > + * - mac_addrs > + * - hash_mac_addrs > + * - dev_private > + * If one of these fields should not be freed, > + * it must be reset to NULL by the caller. I'm afraid nobody will find it here. Let's add @see rte_eth_dev_release_port() to these members description in rte_ethdev_core.h struct rte_eth_dev_data. Also I think "by the caller" is misleading here. Let's highlight that it is PMD responsibility, i.e. "by the PMD" may be with "typically in dev_close method implementation". Andrew.