From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F057A00BE; Fri, 12 Jun 2020 17:39:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 571241BFA9; Fri, 12 Jun 2020 17:39:19 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id A313D1BF8C for ; Fri, 12 Jun 2020 17:39:17 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 86A735C01A2; Fri, 12 Jun 2020 11:39:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Fri, 12 Jun 2020 11:39:14 -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=fm1; bh= KG3fnQU2p7VMb+xmz2pNVIgm13j1gb6MDyY/EMUsDkI=; b=J3PR7mQkhBnDGGsV nfDUKdRJYh4N+1GHCGSs7AuNk75VpM7hOPXsaKvaKwA9hcOKFBIBFSU+7plPNx1d UMGqn8pJI2pxBXa4pMWTsPdtopy8V7Bsk4pOZNHitiJlgvcNy5oDaxcmWXPtC/EB 5x4uzgAwSmhlmNAOg7VhT5wt7iFtdnpOcVT4IHZx8XLn20P9KXl36DjipSs6dTTV nCCXFKgB/iNGjRK590VGuHI/E45IeYvtzn2BB/KNNuyhSFU92QMYvw2/z7+Ah8U4 as9kfYzmfbxMOcoek/Pgn0RAvVH/Ehnsg1W16qKjZtQeVbhDLiPrAPJEs7GspIHB wXvFgw== 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=fm3; bh=KG3fnQU2p7VMb+xmz2pNVIgm13j1gb6MDyY/EMUsD kI=; b=pfl3yXo3JujbqmJB8SRm9z2hVcGyNc2oW+K/swLgO+/yGXK1E4LD9qnhF Rginx6IRZUkzQwrfKjfAIMFkPv9+2jWkcuhaH0Y6kmrq5vvfhyWxzU/s0QJUNZ+n ++1AvHiza0KTyXtPu5c6Nr9NiBEeO+Ap92lhTtRGapk+FwZrP7Oia8zp9iqF8p61 IRW7GaqCB+U2QaRPy6U9xb2jK3FKdqSeZxXnGRLZSoE6Sl/cPdL1nBkEqQNSsgVy l0ngZqtZraxz5XVGzuPNjmEzYtPXh40do/7X8xXmrSL4IQ2bcO9ANn1MlvhN+yqF BDjDz14HPMHq6GaLp6JFuXuLrmizg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeiuddgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 528733280059; Fri, 12 Jun 2020 11:39:13 -0400 (EDT) From: Thomas Monjalon To: Dmitry Kozlyuk Cc: dev@dpdk.org, Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Anatoly Burakov , Bruce Richardson Date: Fri, 12 Jun 2020 17:39:11 +0200 Message-ID: <6953062.XLqS06YVaP@thomas> In-Reply-To: <20200610142730.31376-5-dmitry.kozliuk@gmail.com> References: <20200608074153.29611-1-dmitry.kozliuk@gmail.com> <20200610142730.31376-1-dmitry.kozliuk@gmail.com> <20200610142730.31376-5-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v8 04/11] eal/mem: extract common code for memseg list initialization 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 10/06/2020 16:27, Dmitry Kozlyuk: > +eal_memseg_list_init_named(struct rte_memseg_list *msl, const char *name, > + uint64_t page_sz, int n_segs, int socket_id, bool heap) > +{ > + if (rte_fbarray_init(&msl->memseg_arr, name, n_segs, > + sizeof(struct rte_memseg))) { > + RTE_LOG(ERR, EAL, "Cannot allocate memseg list: %s\n", > + rte_strerror(rte_errno)); > + return -1; > + } > + > + msl->page_sz = page_sz; > + msl->socket_id = socket_id; > + msl->base_va = NULL; > + msl->heap = heap; > + > + RTE_LOG(DEBUG, EAL, > + "Memseg list allocated at socket %i, page size 0x%zxkB\n", > + socket_id, (size_t)page_sz >> 10); page_sz is uint64_t, so the right printf specifier is PRIx64. [...] > +#ifndef RTE_EXEC_ENV_WINDOWS > + /* The hint would be misleading on Windows, but this function Would be better to explain the reason of misleading in this comment. > + * is called from many places, including common code, > + * so don't duplicate the message. > + */ > + if (rte_errno == EADDRNOTAVAIL) > + RTE_LOG(ERR, EAL, "Cannot reserve %llu bytes at [%p] - " > + "please use '--" OPT_BASE_VIRTADDR "' option\n", > + (unsigned long long)mem_sz, msl->base_va); > +#endif [...] > + if (memseg_list_alloc(msl) < 0) { > + RTE_LOG(ERR, EAL, > + "Cannot preallocate %zukB hugepages\n", > + page_sz >> 10); page_sz is uint64_t, so the right printf specifier is PRIx64.