From patchwork Fri Dec 14 11:50:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 48849 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EAB911B9A3; Fri, 14 Dec 2018 12:51:08 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 1402D1B1EA for ; Fri, 14 Dec 2018 12:51:06 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Dec 2018 03:51:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,352,1539673200"; d="scan'208";a="302170773" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga006.fm.intel.com with ESMTP; 14 Dec 2018 03:51:04 -0800 Received: from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com [10.243.17.64]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id wBEBp4js005253; Fri, 14 Dec 2018 11:51:04 GMT Received: from sivswdev05.ir.intel.com (localhost [127.0.0.1]) by sivswdev05.ir.intel.com with ESMTP id wBEBp4Gb007494; Fri, 14 Dec 2018 11:51:04 GMT Received: (from aburakov@localhost) by sivswdev05.ir.intel.com with LOCAL id wBEBoxVn007484; Fri, 14 Dec 2018 11:50:59 GMT From: Anatoly Burakov To: dev@dpdk.org Cc: shahafs@mellanox.com, yskoh@mellanox.com, thomas@monjalon.net, shreyansh.jain@nxp.com Date: Fri, 14 Dec 2018 11:50:55 +0000 Message-Id: X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 0/4] Allow using external memory without malloc 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" Currently, the only way to use externally allocated memory is through rte_malloc API's. While this is fine for a lot of use cases, it may not be suitable for certain other use cases like manual memory management, etc. This patchset adds another API to register memory segments with DPDK (so that API's like ``rte_mem_virt2memseg`` could be relied on by PMD's and such), but not create a malloc heap out of them. Aside from the obvious (not adding memory to a heap), the other major difference between this API and the ``rte_malloc_heap_*`` external memory functions is the fact that no DMA mapping is performed automatically, as well as no mem event callbacks are triggered. This really draws a line in the sand, and there are now two ways of doing things - do everything automatically (using the ``rte_malloc_heap_*`` API's), or do everything manually (``rte_extmem_*`` and future DMA mapping API [1] that would replace ``rte_vfio_dma_map``). This way, the consistency of API is kept, and flexibility is also allowed. [1] https://mails.dpdk.org/archives/dev/2018-November/118175.html Anatoly Burakov (4): malloc: separate creating memseg list and malloc heap malloc: separate destroying memseg list and heap data mem: allow registering external memory areas mem: allow usage of non-heap external memory in multiprocess .../prog_guide/env_abstraction_layer.rst | 63 +++++++-- doc/guides/rel_notes/release_19_02.rst | 6 + lib/librte_eal/common/eal_common_memory.c | 119 +++++++++++++++++ lib/librte_eal/common/include/rte_memory.h | 122 ++++++++++++++++++ lib/librte_eal/common/malloc_heap.c | 104 +++++++++++---- lib/librte_eal/common/malloc_heap.h | 15 ++- lib/librte_eal/common/rte_malloc.c | 115 +++++++---------- lib/librte_eal/rte_eal_version.map | 4 + 8 files changed, 443 insertions(+), 105 deletions(-)