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 E878EA0C41; Tue, 19 Oct 2021 17:53:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC005411E0; Tue, 19 Oct 2021 17:53:15 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 80575411C1 for ; Tue, 19 Oct 2021 17:53:14 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 226E53201B5C; Tue, 19 Oct 2021 11:53:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 19 Oct 2021 11:53:13 -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= NA4xXR4gddrNOYdSf89wJ0Vz9xvZwdzrUl4LwnOOIgI=; b=WXYaEOePYhhtnMx7 4jbHEgjzNejT8vOFNrOuLMNzF7quebNHYSlqmu2wnMIS8g7er2kxsB8vrCRUZt4f Euh9BpG+8pnD/+NASoguw5yj1SN/OxnJiVhF4CkvsuuD8IL/Wq0ztWgnMh7P1ss8 sbrjqvB9C3UXcsIIBQXmQdqhA5AI615944frk0peGa9Naahw8wuwWxEinMJ4cWMq xiTJvgC3qP+vQMNHPBIGfBhcHTVbVdigdd6oLRz7+Uvkvfq2IPYW6seI4TmfYVJW 6KqNVHhJHPH+L/u84HWOHJC8Yx0oj/Oz/2/j1uEWdZ81/6HAXaDCxAvyT/ZbPONH RMpW1Q== 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=NA4xXR4gddrNOYdSf89wJ0Vz9xvZwdzrUl4LwnOOI gI=; b=hbfs9q6wZzoPgfeM3lx9xpOdEa6lAJ87mtQO7fbAAYXam+71lhSbThNgL Le9bq7D0tYYJ4LGBspSLdTHQC5Nn2eucbmKfS/s2sjPNSPHXEkChv7r08IAkXn1u IWEA4UQqEOhvO4+2Jp0mmyzvc26R4xTSFi7rrRYNJLadjsliWA59EUJEWSs0ClsM yJgA9ndv7K7tJwwF0mPPDwFLAsFPfxYcs3p9B5ZitMtvSOFMShhFbY6bmrTJgPQH QwRKGoWu2fqF/hHlsG+aGSkG0MCzog9xoac4sTC3ujKIlO3qvFQAtZgHxgL/P7Vs u/ecLZDbfPbwkEwLRHHsVlnYHU6ZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddvvddgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Oct 2021 11:53:11 -0400 (EDT) From: Thomas Monjalon To: Harman Kalra Cc: dev@dpdk.org, Anatoly Burakov , david.marchand@redhat.com, dmitry.kozliuk@gmail.com, mdr@ashroe.eu Date: Tue, 19 Oct 2021 17:53:08 +0200 Message-ID: <8983873.EMGNrGMadD@thomas> In-Reply-To: <20211018193707.123559-2-hkalra@marvell.com> References: <20210826145726.102081-1-hkalra@marvell.com> <20211018193707.123559-1-hkalra@marvell.com> <20211018193707.123559-2-hkalra@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 1/7] malloc: introduce malloc is ready API 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" 18/10/2021 21:37, Harman Kalra: > @@ -1328,6 +1330,7 @@ rte_eal_malloc_heap_init(void) > { > struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config; > unsigned int i; > + int ret; > const struct internal_config *internal_conf = > eal_get_internal_configuration(); > > @@ -1369,5 +1372,16 @@ rte_eal_malloc_heap_init(void) > return 0; > > /* add all IOVA-contiguous areas to the heap */ > - return rte_memseg_contig_walk(malloc_add_seg, NULL); > + ret = rte_memseg_contig_walk(malloc_add_seg, NULL); > + > + if (!ret) Style: It should be "if (ret == 0)" because ret is not a bool. > + malloc_ready = true; > + > + return ret; > +} > + > +bool > +rte_malloc_is_ready(void) > +{ > + return malloc_ready == true; > } > --- a/lib/eal/common/malloc_heap.h > +++ b/lib/eal/common/malloc_heap.h > @@ -96,4 +96,7 @@ malloc_socket_to_heap_id(unsigned int socket_id); > int > rte_eal_malloc_heap_init(void); > Please insert a comment here to document what we can expect. > +bool > +rte_malloc_is_ready(void);