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 538C5A04EF; Mon, 1 Jun 2020 22:47:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 656941BFCE; Mon, 1 Jun 2020 22:47:07 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id CF4CE1BFCD for ; Mon, 1 Jun 2020 22:47:05 +0200 (CEST) IronPort-SDR: Hc/GJYbO78MKcflvDo2lGGi0A3iN6H7erlGcJwJP+zKptjBLVttsrKJ5vP/fxAp8hYNeNNumGD kMHaTRcG46xw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2020 13:47:04 -0700 IronPort-SDR: v041MTwF5cikpNPHDWr6ijKEZpqfDdxM/FCiS0komVOiDtXBwblh1BJqFVDkVaQ+0F30Cq1r4M TyMW21jyYdNQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,462,1583222400"; d="scan'208";a="304003280" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga008.jf.intel.com with ESMTP; 01 Jun 2020 13:47:04 -0700 Received: from [10.166.30.253] (10.166.30.253) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 1 Jun 2020 13:47:04 -0700 To: Dmitry Kozlyuk , Fady Bader CC: , , , , , , , , , , , References: <20200601103139.8612-1-fady@mellanox.com> <20200601103139.8612-3-fady@mellanox.com> <20200601225921.371ebfa6@sovereign> From: Ranjit Menon Message-ID: <059d7ca6-4de6-a5cd-9182-a6bda70af470@intel.com> Date: Mon, 1 Jun 2020 13:47:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200601225921.371ebfa6@sovereign> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.166.30.253] Subject: Re: [dpdk-dev] [PATCH v2 2/4] mempool: use generic 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 6/1/2020 12:59 PM, Dmitry Kozlyuk wrote: > On Mon, 1 Jun 2020 13:31:37 +0300 > Fady Bader wrote: > > [snip] >> /* populate the mempool with an anonymous mapping */ >> @@ -740,20 +739,20 @@ rte_mempool_populate_anon(struct rte_mempool *mp) >> } >> >> /* get chunk of virtually continuous memory */ >> - addr = mmap(NULL, size, PROT_READ | PROT_WRITE, >> - MAP_SHARED | MAP_ANONYMOUS, -1, 0); >> - if (addr == MAP_FAILED) { >> + addr = rte_mem_map(NULL, size, RTE_PROT_READ | RTE_PROT_WRITE, >> + RTE_MAP_SHARED | RTE_MAP_ANONYMOUS, -1, 0); >> + if (addr == NULL) { >> rte_errno = errno; > rte_mem_map() sets rte_errno, on Windows using errno here is invalid. > >> return 0; >> } >> /* can't use MMAP_LOCKED, it does not exist on BSD */ >> - if (mlock(addr, size) < 0) { >> + if (rte_mem_lock(addr, size) < 0) { >> rte_errno = errno; > Same as above. > > [snip] > > Two more things: > > 1. What do you think about changing rte_ to rte_eal_ prefix for memory > management wrappers in MM series as Andrew Rybchenko suggested for v1? Since > the functions are DPDK-internal, this sounds reasonable to me. I fully support this. ranjit m.