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 8935DA0C43; Wed, 20 Oct 2021 11:29:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7141D40687; Wed, 20 Oct 2021 11:29:08 +0200 (CEST) Received: from mail-108-mta58.mxroute.com (mail-108-mta58.mxroute.com [136.175.108.58]) by mails.dpdk.org (Postfix) with ESMTP id 9AFD940142 for ; Wed, 20 Oct 2021 11:29:06 +0200 (CEST) Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta58.mxroute.com (ZoneMTA) with ESMTPSA id 17c9d085f300000b55.002 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Wed, 20 Oct 2021 09:29:04 +0000 X-Zone-Loop: c374332e626ef0c79845a7656b9b92abe56896dc6fc9 X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc: To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IiCy5stYmU5z8tzx+j9Uut8y5K3LEPsJI+muZg9uL4A=; b=e+9AkxFvFTJHC2P0Ws++hlazSl 0ntQrKdDFvPWEKRNRIg9RsCwjryUoASD+u6pRDLKB3IvYwzbd01TqbOifN50amGQAxOt78srjukZ/ b5/UNwfomo291QIaSK4+VBrA+kQqlOWBlA9yPbfd3Y3z6IPJ9v3K6Gqol9zd1n7IUA4thRmFttuS9 v4KjnRZNI5mDt/5vD8GHUnXZDlQEFmDkHImd0m+WMEMIDm+lL9S6Fk7AlLv76JLIc8zXTODjYyXjT M+B6qVZ9W93XlTnLOBLxrxtDsCpWg4ldKGQDCjS4ba5W8XUpeMrTueDpA+BzUe0Jx5R8KeOlmwUiN sgRXnMFg==; Message-ID: Date: Wed, 20 Oct 2021 10:29:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Content-Language: en-US To: Dmitry Kozlyuk , dev@dpdk.org Cc: David Marchand , Matan Azrad , Andrew Rybchenko , Olivier Matz References: <20211013110131.2909604-1-dkozlyuk@nvidia.com> <20211015160244.3097758-1-dkozlyuk@nvidia.com> <20211015160244.3097758-2-dkozlyuk@nvidia.com> From: "Kinsella, Ray" In-Reply-To: <20211015160244.3097758-2-dkozlyuk@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu X-Zone-Spam-Resolution: no action X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0, FROM_HAS_DN=0, TO_DN_SOME=0, MIME_GOOD=-0.1, FROM_EQ_ENVFROM=0, MIME_TRACE=0, RCVD_COUNT_ZERO=0, RCPT_COUNT_FIVE=0, MID_RHS_MATCH_FROM=0, NEURAL_SPAM=0] Subject: Re: [dpdk-dev] [PATCH v5 1/4] mempool: add event callbacks 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 Sender: "dev" On 15/10/2021 17:02, Dmitry Kozlyuk wrote: > Data path performance can benefit if the PMD knows which memory it will > need to handle in advance, before the first mbuf is sent to the PMD. > It is impractical, however, to consider all allocated memory for this > purpose. Most often mbuf memory comes from mempools that can come and > go. PMD can enumerate existing mempools on device start, but it also > needs to track creation and destruction of mempools after the forwarding > starts but before an mbuf from the new mempool is sent to the device. > > Add an API to register callback for mempool life cycle events: > * rte_mempool_event_callback_register() > * rte_mempool_event_callback_unregister() > Currently tracked events are: > * RTE_MEMPOOL_EVENT_READY (after populating a mempool) > * RTE_MEMPOOL_EVENT_DESTROY (before freeing a mempool) > Provide a unit test for the new API. > The new API is internal, because it is primarily demanded by PMDs that > may need to deal with any mempools and do not control their creation, > while an application, on the other hand, knows which mempools it creates > and doesn't care about internal mempools PMDs might create. > > Signed-off-by: Dmitry Kozlyuk > Acked-by: Matan Azrad > Reviewed-by: Andrew Rybchenko > --- Acked-by: Ray Kinsella