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 CD662A04EF; Mon, 1 Jun 2020 21:59:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD1481BFF7; Mon, 1 Jun 2020 21:59:25 +0200 (CEST) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by dpdk.org (Postfix) with ESMTP id 2258E1BFF6 for ; Mon, 1 Jun 2020 21:59:24 +0200 (CEST) Received: by mail-lj1-f194.google.com with SMTP id b6so9770869ljj.1 for ; Mon, 01 Jun 2020 12:59:24 -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=XPADxefHwpq78oRYvJ3WeHSNeKNLeoREwkn4Vr9Fsk0=; b=u0kfRW6wmscewjGUO/sKt4XW9kZz05/QgMnzvf+kzSgNbx34ildwRCQgsHPEjX4yVn d0WMf9YUSv5hMWRJJn8dR/s/QC3TaIoH8Dq+Js87OSDfPepns7mZemUu75uua6bFEuuI EkQGXn1WUee3S5Yk8T/5OZhy4LAhuaS0aXAmpXOXnLZ9b91cKD8dnnvTWHfTV5a1fLz7 NtTgP79NJUkRKYY1UwcpvMLVBWr0BOVN3ScqBRAxXlwSe+/V1Fh8h/JtyPgGSpKf9paz kKiGJkuMhjwpg35tmchUyTEe1JR7LIA0dVKv0MogNFvYRAudovks0jCKV6WBb99MvVpX PMsA== 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=XPADxefHwpq78oRYvJ3WeHSNeKNLeoREwkn4Vr9Fsk0=; b=CRRPHcwjDm188gkM8RKMV+BPH+SJYHebjOR915VRkhtpio1agoFYvQPxbqccZuelAZ WfDeDe4YapB9vjPcpyY8TSP1aISZxICGv4MauuIeVenQVqQZZ9VyuQPekjAvs/0kiU3Y bvCvClziohONC5pf/moBlrsxl+XnATdmD3Gk8MQewEKupLCzy1K+MKaKuEmg4slpNlYw rurL3qr6SicNZfuTl+EJeR2uDcjG7fqk0CksHdsg99HrxuuzsbTKEab/ruFgax8A+Bf2 n8LSe85o+XWdF1QVVGGQlnency2EcRj+55NxHSZ2YQPXfhNQHEQw/NwVVdBYlY68yXK4 KGlg== X-Gm-Message-State: AOAM530iD8uoGVYu9RYpFcEb6brtDR/IeuZ2piyt3hYv7cOld9/e2tzc r/CoOqrOD5KdNzBdvCyuMt0= X-Google-Smtp-Source: ABdhPJzgBs4kn88qtB4b6mWRSWplEC39pwGcHOCektNfXSR7+RLZ4ADijmpElKPEEVPqNAo8+L4BAA== X-Received: by 2002:a2e:8ed8:: with SMTP id e24mr5208418ljl.194.1591041563590; Mon, 01 Jun 2020 12:59:23 -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 f22sm52607ljn.28.2020.06.01.12.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 12:59:22 -0700 (PDT) Date: Mon, 1 Jun 2020 22:59:21 +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: <20200601225921.371ebfa6@sovereign> In-Reply-To: <20200601103139.8612-3-fady@mellanox.com> References: <20200601103139.8612-1-fady@mellanox.com> <20200601103139.8612-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 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 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. 2. Please use --in-reply-to for v2 and on. -- Dmitry Kozlyuk