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 93811A00BE; Thu, 28 May 2020 15:24:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 10E2D1DA7D; Thu, 28 May 2020 15:24:18 +0200 (CEST) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by dpdk.org (Postfix) with ESMTP id 59B761DA63 for ; Thu, 28 May 2020 15:24:17 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id d7so5389138lfi.12 for ; Thu, 28 May 2020 06:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VjWw9vE/DH4KzbmzMe9rOSZV01YaJ+qJsBNvpe0NCf8=; b=EW8WaQlG4G35UF272N+qYholBY4oXnfMr1T2xctpL+Z++jxoL8BsJ4KMn3zARSArcc SmCijDzrl19Xfs1n62fKIzJ8axEBTPi0QTGB8fIAFXAPNkqJzsYfJfb3tug4cZCvQV1S RfK4sNSCIkoVni5gh7awKxCBbmDNVM9Zg+EYfkeMwyAb2nYSX/PtxNo5l8TPGarEk7rD A96rHG2zC2uOrNeCEflAXv4HdIARX9osgZ5kFU/i+DdY4WLliD8hy+ek4xX8Ol0TL7eL X9N3RBY7LyALtXY4pBJtKn03VWSvX/rcdybRWpn9Xs1t2HaA5AaOs3bLyHoQ3134TCjM EutQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VjWw9vE/DH4KzbmzMe9rOSZV01YaJ+qJsBNvpe0NCf8=; b=LzgYYc14eq7mUXH2XpSoFKTbFZ37Vq5n4YGTeXZEaYs9w1SwQfMwTp/WT/FhdjLHcI u1ZKKImoMf4a2laXxrYld5K06ukzFzGSjkeglHXgIZDw0v1du/NbWM059pUdip3LJoCl SVA0BZdtbVCTex9MQF//DhoMht6HTkHnOj/5zP2f0pDoAT6SGe1PlCXiD4jgmWZ7ZhYQ p0Q9wfkZVjpasVoWp2VG/pKSJPGdtHWZWuQ7F24rgEVFquhGQRpjxkd9S/LhvEV3mMpg 7kntHtMLUeXbv55vbRDxBEc3uM0RPsaRkbVk2TI4papcirahAvpNFpm+V2eiFrsnmeXd dh4Q== X-Gm-Message-State: AOAM5317Pf2nvkvQ6PdBkhbleDg8BAKzW/vKBkCpk91oiurWICE3EcPk jdV4KB2MQe0ITKmePdVhzAY= X-Google-Smtp-Source: ABdhPJxW0TxKjrMZ+Z7tZ+OXprIsiCVWlOVGgqUkMFJIS1CqGHA0moEvAnAInkSjkMAJYqIUclYUWw== X-Received: by 2002:a19:4854:: with SMTP id v81mr1664772lfa.189.1590672256847; Thu, 28 May 2020 06:24:16 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id d18sm431596lji.8.2020.05.28.06.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 06:24:16 -0700 (PDT) Date: Thu, 28 May 2020 16:24:15 +0300 From: Dmitry Kozlyuk To: "Burakov, Anatoly" Cc: dev@dpdk.org, Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman Message-ID: <20200528162415.082bc354@sovereign> In-Reply-To: References: <20200428235015.2820677-1-dmitry.kozliuk@gmail.com> <20200525003720.6410-1-dmitry.kozliuk@gmail.com> <20200525003720.6410-6-dmitry.kozliuk@gmail.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 05/11] eal/mem: extract common code for dynamic memory allocation 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" On Thu, 28 May 2020 13:21:06 +0100 "Burakov, Anatoly" wrote: > On 25-May-20 1:37 AM, Dmitry Kozlyuk wrote: > > Code in Linux EAL that supports dynamic memory allocation (as opposed to > > static allocation used by FreeBSD) is not OS-dependent and can be reused > > by Windows EAL. Move such code to a file compiled only for the OS that > > require it. > > > > Signed-off-by: Dmitry Kozlyuk > > --- > > I believe you forgot to add dynmem to Makefile. Right, thanks. > > > +eal_dynmem_calc_num_pages_per_socket( > > + uint64_t *memory, struct hugepage_info *hp_info, > > + struct hugepage_info *hp_used, unsigned int num_hp_info) > > +{ > > + unsigned int socket, j, i = 0; > > + unsigned int requested, available; > > + int total_num_pages = 0; > > + uint64_t remaining_mem, cur_mem; > > + uint64_t total_mem = internal_config.memory; > > + > > + if (num_hp_info == 0) > > + return -1; > > + > > + /* if specific memory amounts per socket weren't requested */ > > + if (internal_config.force_sockets == 0) { > > + size_t total_size; > > + int cpu_per_socket[RTE_MAX_NUMA_NODES]; > > + size_t default_size; > > + unsigned int lcore_id; > > Comparing code from eal_memory.c and this one, it seems like you've > dropped all 32-bit code from this function. Is that intentional? No, it's a mistake. -- Dmitry Kozlyuk