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 9E83CA0C47; Tue, 12 Oct 2021 17:22:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82BB141198; Tue, 12 Oct 2021 17:22:40 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 41A2441196 for ; Tue, 12 Oct 2021 17:22:39 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D1F9C5C00F8; Tue, 12 Oct 2021 11:22:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 12 Oct 2021 11:22:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= OT3cqdFen9Gji1YcA59yQgdXqlxt6CSAEMF97azU82I=; b=opJqN1fVkmTNVHmo FC8RjEoLwrB8Q1eDvibfYYNYOKLtfjEj/NtM55z+DeepWB9xqVfREkak3Klk7fJg l45mFFt4J2fy4RGTVWlqnawac5DGfmqSNR7GVUXZC5EZg3u82OwVepCBlO/8kYKm dehnsFwylrZKzPJIMcUH18uvAN01Ip8w7BTrXAg8iMNHrYhbXinYUukzqMvwSxPL GK4gXTVeqUhA/fNcl+oq41I831ah3IoO6c1RY6qTIjJZsDoz3OLEOCy9eNejsVvx zDRpvYMIHrKdryOL30H+5GFD7u2vVJWe3k3WQrwvfEYDh8vOe0mnh7iRcg9h7j0L /xRMDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=OT3cqdFen9Gji1YcA59yQgdXqlxt6CSAEMF97azU8 2I=; b=ki7rvWPVkjKVamz3fU579U3i20tyCd56wC9hlzKmPWRWc+2EqR8OXcZ+7 oM3iRLp+Gk9Foq7djVLQfZSA46wdU1wuIlGDaOdoH9q4y7+j92jsC6P+50FMiEkK kmkuedfks7VGfQJEQX+WnbQFvcyV60V2XbvsZRh6tBAZzTEUVHqrBH2FasptufvZ bq+mIS49ukEA6ukazsxwBjNTSy1CaOmyPAXtBkOMfQ0dAqQ8U/KCSGrPSUYji8rV i5DPX+CnXELDpNcfDN5YMmF8640zlnC3KDSr0NJ0xOSuXE8hPl4K3PYR0mPheiPx qtnwE7fn0oIkkdTOR6OB1tLvM3quQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtkedgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Oct 2021 11:22:35 -0400 (EDT) From: Thomas Monjalon To: Harman Kalra Cc: Raslan Darawsheh , dev@dpdk.org, Ray Kinsella , Dmitry Kozlyuk , David Marchand , viacheslavo@nvidia.com, matan@nvidia.com Date: Tue, 12 Oct 2021 17:22:32 +0200 Message-ID: <14591983.bG23H4Sf1D@thomas> In-Reply-To: References: <20210826145726.102081-1-hkalra@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v1 2/7] eal/interrupts: implement get set APIs 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" 04/10/2021 11:57, David Marchand: > On Mon, Oct 4, 2021 at 10:51 AM Harman Kalra wrote: > > > > +struct rte_intr_handle *rte_intr_handle_instance_alloc(int size, > > > > + bool > > > > +from_hugepage) { > > > > + struct rte_intr_handle *intr_handle; > > > > + int i; > > > > + > > > > + if (from_hugepage) > > > > + intr_handle = rte_zmalloc(NULL, > > > > + size * sizeof(struct rte_intr_handle), > > > > + 0); > > > > + else > > > > + intr_handle = calloc(1, size * sizeof(struct > > > > + rte_intr_handle)); > > > > > > We can call DPDK allocator in all cases. > > > That would avoid headaches on why multiprocess does not work in some > > > rarely tested cases. > > > Wdyt? > > > > > > Plus "from_hugepage" is misleading, you could be in --no-huge mode, > > > rte_zmalloc still works. > > > > In mellanox 5 driver interrupt handle instance is freed in destructor > > " mlx5_pmd_interrupt_handler_uninstall()" while DPDK memory allocators > > are already cleaned up in "rte_eal_cleanup". Hence I allocated interrupt > > instances for such cases from normal heap. There could be other such cases > > so I think its ok to keep this support. > > This is surprising. > Why would the mlx5 driver wait to release in a destructor? > It should be done once no interrupt handler is necessary (like when > stopping all ports), and that would be before rte_eal_cleanup(). I agree with David. I prefer a simpler API which always use rte_malloc, and make sure interrupts are always handled between rte_eal_init and rte_eal_cleanup. The mlx5 PMD could be reworked to match this requirement. In any case we should not any memory management in constructors/destructors.