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 B88AEA00C5; Sun, 5 Jul 2020 14:08:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E56BA1DC3B; Sun, 5 Jul 2020 14:08:29 +0200 (CEST) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id 336381DC1C for ; Sun, 5 Jul 2020 14:08:29 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id h19so42080434ljg.13 for ; Sun, 05 Jul 2020 05:08:29 -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=WngYTj6ChHU9vCamhBj0xvcCoHUxSaYuKyLNnQTliwk=; b=RSq7S/G99gZPrABsQGu60lUOMRvY9Fawv2G03YJUahKnoP8p8ZawiEyFKy+JULvPVH hAxzrSnXDjNsctEToPX7v5w32W+4SaPLlHA55q8vNEfNbuTX3S490Ox36UL+qets44i2 O1WBUrJFS0zFLjnLn6rVZ4lQz+rzi2MDJ98CUa2TxFBBzkbn0t5flNZ5Sgqizfos1Rsf u0tkiOxGnCPCfkhVpTyqNJHp+/xqx7RenAicueX401WYagllCTdU4l5sbgcUjrXv6Te1 eaDtsXE2W9ZzbrKudIDbB+GVPVwyYEdq+QNJWD1INfdcLFEfw1SpveSjHgqr0N1J5Ha4 h+Kg== 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=WngYTj6ChHU9vCamhBj0xvcCoHUxSaYuKyLNnQTliwk=; b=IF1RgqFt2ifJoR0dnAvQ3685Q2+QfknmkPPMvlj3vyZkGDsw3VGYjYApyB4ZQBmGVL iyw3+51mc/rXLrE2JEGiBN+A27ks8qonbb7NUQ/1lF3x3I3JHA4368PMTae7ojoKa5tX TmCMwP6ISRLR7q9VKujSZIC2k49ujfKT7fFxVI9oCAHV2dwXmiI/imTYPiEelK/xF/kh 4UmeN3nkD9Gm7WDX44il5Y97/h4Zh/anu/2r0MAmdzRqsWDaR3j/QFUL9vLZL4JtaRrM HKOOwgp0LNfO56dwPEriDO3T2RaHOu51Cz+dRejZJB635l8vErgX4W8DwXWtqd45kcd5 WcJQ== X-Gm-Message-State: AOAM5328zBhO6d5rXS6kFpWzR5pUFjm0LyAsWDk2tNsX0gPSzNDkbzZi VmW84VnVR1DnednzMtiL+jM= X-Google-Smtp-Source: ABdhPJxLgcYTjetHFR6SpXguqYwEqQZchdtPP9YSvJQ6aGij7w3WaGyUls3pCl0kv3xtboN+GhSuww== X-Received: by 2002:a2e:3c03:: with SMTP id j3mr18570592lja.12.1593950908692; Sun, 05 Jul 2020 05:08:28 -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 q21sm4627066ljj.67.2020.07.05.05.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 05:08:28 -0700 (PDT) Date: Sun, 5 Jul 2020 15:08:26 +0300 From: Dmitry Kozlyuk To: Fady Bader Cc: dev@dpdk.org, thomas@monjalon.net, tbashar@mellanox.com, talshn@mellanox.com, yohadt@mellanox.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, pallavi.kadam@intel.com, ranjit.menon@intel.com, olivier.matz@6wind.com, arybchenko@solarflare.com, mdr@ashroe.eu, nhorman@tuxdriver.com Message-ID: <20200705150826.30f0b143@sovereign> In-Reply-To: <20200705114629.2152-3-fady@mellanox.com> References: <20200702131409.17964-2-fady@mellanox.com> <20200705114629.2152-1-fady@mellanox.com> <20200705114629.2152-3-fady@mellanox.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 2/3] 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 Sun, 5 Jul 2020 14:46:28 +0300, Fady Bader wrote: [snip] > /* populate the mempool with an anonymous mapping */ > @@ -740,20 +741,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_errno is set by rte_mem_map(), using errno here is incorrect on Windows. > 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; Ditto. [snip] -- Dmitry Kozlyuk