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 E997DA04B1; Fri, 1 May 2020 21:19:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C7F591D9D7; Fri, 1 May 2020 21:19:36 +0200 (CEST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id 6EBA81D96B for ; Fri, 1 May 2020 21:19:35 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id f18so3491388lja.13 for ; Fri, 01 May 2020 12:19:35 -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=ofqHrEZj0O06rwpIR9DYj7uARQ9eTKg17Q3KyjsF45E=; b=ObRw127ET3WNF5LDxL6TLZwmv3wq2vFxdJIxg/BJ4aasy995+FI4WkTKOfvCvJhYYV 6CJpobYhXvFdZQjTdMyCQsD2wkLzZa4R8LBfzx2m2dJRoaKvwyckBHZpumGWUCDj931O 2mFCU6M8j/7TWo8T1I2P9FMlBMIOEOlupUomLZHzjQJn8TaEQqvAxDhPkKp4LmY4OD9l 1Hdi1C0wuDEC2fo5idbfWddiqh+xLHt6CgXP9IiRcKMSUIHiytTiTqYR8yufwu7FDF39 me8MsCz4jF+S/8oRbPrt6bzy6+64wISIDVKHJZHm2mp5jwL1O+4slVnDj65hqlJKqc+S xmNw== 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=ofqHrEZj0O06rwpIR9DYj7uARQ9eTKg17Q3KyjsF45E=; b=QBF27O+EN8EcnTJihdr9LMvdm/uCaQJgpo0q5Bgw9p656E4YbLSSloNsM4/cCwhuit fD7/Y+nvht76k2BbPpjKrcDNYBasyovBoCdGiAhnALhJ6nVAOeTXCgNk/GE1WjlvHyqY dM/0wdNDIE5ZW2VqyFi7tRUrxJMBQFoC3NkAJi9x5S0j+cuN9ykxCVeaj1yhSbRo9biE BaSnjjkYAr9OgrISVkp1jsyMi1q7JC/N4nBNxFlOpS2LSQLunKbCu5nfRIdGyFg+zzZG EZnFydaZ00ddW8Po93eUwUoIyQ1pDIDCtx4w333zeMO5QkOw0t4FZmOSoYE/yqxh46pX MjYg== X-Gm-Message-State: AGi0PuZz0mIiRGCn0NhVJrvp2qGjJzrQVqRBkL2aVRoyGBBsEoRASEV9 RCCRPKltq/xUhO+y55ZUKco= X-Google-Smtp-Source: APiQypJCyboQ8V2nKQqGuaxFsebyBx9tWEM8bMRUrSUCAa5bPW+eZfDFjlFnVqr5ew4T+hIslmfp/w== X-Received: by 2002:a2e:a549:: with SMTP id e9mr3161947ljn.283.1588360774965; Fri, 01 May 2020 12:19:34 -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 z64sm2777906lfa.50.2020.05.01.12.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2020 12:19:34 -0700 (PDT) Date: Fri, 1 May 2020 22:19:33 +0300 From: Dmitry Kozlyuk To: Ranjit Menon Cc: dev@dpdk.org, "Dmitry Malloy (MESHCHANINOV)" , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Thomas Monjalon , Harini Ramakrishnan , Omar Cardona , Pallavi Kadam , John McNamara , Marko Kovacevic , Anatoly Burakov Message-ID: <20200501221933.58a4d25c@Sovereign> In-Reply-To: <93aab43e-8e36-023a-651a-fb82bc12c186@intel.com> References: <20200410164342.1194634-1-dmitry.kozliuk@gmail.com> <20200428235015.2820677-1-dmitry.kozliuk@gmail.com> <20200428235015.2820677-9-dmitry.kozliuk@gmail.com> <93aab43e-8e36-023a-651a-fb82bc12c186@intel.com> X-Mailer: Claws Mail 3.17.5 (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 v4 8/8] eal/windows: implement basic memory management 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 2020-04-28 18:18 GMT-0700 Ranjit Menon wrote: > On 4/28/2020 4:50 PM, Dmitry Kozlyuk wrote: [snip] > > +void * > > +eal_mem_reserve(void *requested_addr, size_t size, int flags) > > +{ > > + void *virt; > > + > > + /* Windows requires hugepages to be committed. */ > > + if (flags & EAL_RESERVE_HUGEPAGES) { > > + rte_errno = ENOTSUP; > > + return NULL; > > + } > > + > > + virt = VirtualAlloc2(GetCurrentProcess(), requested_addr, size, > > + MEM_RESERVE | MEM_RESERVE_PLACEHOLDER, PAGE_NOACCESS, > > + NULL, 0); > > + if (virt == NULL) { > > + DWORD err = GetLastError(); > > + RTE_LOG_WIN32_ERR("VirtualAlloc2()"); > > + set_errno_from_win32_alloc_error(err); return NULL; is also missing here, thanks for making me re-check this part. > > + } > > + > > + if ((flags & EAL_RESERVE_FORCE_ADDRESS) && (virt != requested_addr)) { > > + if (!VirtualFree(virt, 0, MEM_RELEASE)) > > Shouldn't this be VirtualFreeEx() here? You're right, there were a few more places like this within the file. -- Dmitry Kozlyuk