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 DE257A00C5; Sun, 5 Jul 2020 17:26:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC1021D614; Sun, 5 Jul 2020 17:26:23 +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 8EBCB1D5FC for ; Sun, 5 Jul 2020 17:26:22 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id t74so21184714lff.2 for ; Sun, 05 Jul 2020 08:26:22 -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=7CZeIL5+grl/AjG284UJE8ppKSW6S1sLuDlb1+RoZlI=; b=DsJm/DXCtWOz8aDAtlUh+gPsQe43YCTjwK0AGVUCYibNQE9QA+JBBZoecGqZ5FuLnU vXaHjUO/UqBbmvmRlqpafqDBxTKPN5z93ZncUbNz2tSPO5V3djXYNH5+KcA+0q2xoVWL p1SZzMLGzHKOiW8fDFInOcZp028L4jFsqIQhuQufQMWbkA5fWAIfuVlMx/9IUuFZzdRc rz8icCp7PY/nCjtOXS2yvdE/U/+O2dVMeC+hZKPlLRuCZ18TX+PVI9Hz+vAS0EVfBBVy cymFdRlS9iwUzml3aT4npWsE6s7C21XauqnLZ0EAGoDY9LOjhZR3Don9Cw+SJOktQnq9 fIrA== 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=7CZeIL5+grl/AjG284UJE8ppKSW6S1sLuDlb1+RoZlI=; b=UzmQdLll+FbmjEN6UXpGQXqDlWni9Lhchxh+i/iWqiH5LVL0X7raUF2Dr9qk5VxLVv 2iKRzXNlRYH54hHxMzEsA0Y72oRH/3bdEC91gNEBBESk251f9AoGBGdEV9R14rkqbhfE 2OJprbrkcFxB6ZZ4qidgs+4TnhBB1/V7H7xT1fWnoPuZGHkHE2E9N0D8fnthfqZsKkbR +gKosvCu0Y2r1hSzWOxJPmMXxkqkB8Eqld9ngmD50D2pJ3v36WU513a/RAj9XpC+H8At vYIEKJXxuZSWLnm2IlQvXc1X5lyPET8tJPQkTuc9E6RtX3tCNWvhBhyPTJMmeS62Wh3e zt+A== X-Gm-Message-State: AOAM530RBmCT5V5v6/ZqxKkYUCQLtarfJ4Z+KzJrRwW+2kGCG6/9XJT0 qlDocvB51nKb4bz3rAl6TCQ= X-Google-Smtp-Source: ABdhPJz99y58NBN/H5ZiWYIz3qvJ4G59r22KEltb2z740pP/r0MnHaXoXnCZyUFj6adMBQqPLstmaw== X-Received: by 2002:ac2:548a:: with SMTP id t10mr28008347lfk.142.1593962782044; Sun, 05 Jul 2020 08:26:22 -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 w19sm6087986ljm.120.2020.07.05.08.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 08:26:21 -0700 (PDT) Date: Sun, 5 Jul 2020 18:26:19 +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: <20200705182619.1ba7b558@sovereign> In-Reply-To: <20200705134746.26240-3-fady@mellanox.com> References: <20200705114629.2152-1-fady@mellanox.com> <20200705134746.26240-1-fady@mellanox.com> <20200705134746.26240-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 v6 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 16:47:45 +0300, Fady Bader wrote: > Using generic memory management calls instead of Unix memory management > calls for mempool. > > Signed-off-by: Fady Bader [snip] > /* populate the mempool with an anonymous mapping */ > @@ -740,20 +741,17 @@ 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) { > - rte_errno = errno; > + addr = rte_mem_map(NULL, size, RTE_PROT_READ | RTE_PROT_WRITE, > + RTE_MAP_SHARED | RTE_MAP_ANONYMOUS, -1, 0); > + if (addr == NULL) > return 0; > - } > /* can't use MMAP_LOCKED, it does not exist on BSD */ This comment is for removed mmap(), OTOH, it explains why map+lock approach is used, so perhaps it can be kept. Reviewed-by: Dmitry Kozlyuk -- Dmitry Kozlyuk