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 C6ED7A329E for ; Wed, 23 Oct 2019 20:55:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E3AF1D169; Wed, 23 Oct 2019 20:54:59 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 49D191D159 for ; Wed, 23 Oct 2019 20:54:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571856893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JSg1k/tcO77lLMrH+fyv7mFqEh4FJCZyomcSUaRz3Mc=; b=QMkjkig9jpmaPOBnyO62G8P8+pwv/P/+ScJ9ZXyCwV+xA7/mYortuogVUkChrLWyCM3wqm e5wFfYE/Z6kM+MdQR8tSOc6VRasTdrOmW2O1MYPDEkU5M6oyqj0USM+l7dYlm4vZkhI9Qm 8uTrWyoOa2iQ0+AomR1/3vV+TzdoWNA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-274-8eCVGmaDPLSmDGqeOKkmpA-1; Wed, 23 Oct 2019 14:54:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B0161800D49; Wed, 23 Oct 2019 18:54:49 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-129.brq.redhat.com [10.40.204.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A29C60872; Wed, 23 Oct 2019 18:54:47 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stephen@networkplumber.org, anatoly.burakov@intel.com, thomas@monjalon.net, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Date: Wed, 23 Oct 2019 20:54:16 +0200 Message-Id: <1571856864-8779-5-git-send-email-david.marchand@redhat.com> In-Reply-To: <1571856864-8779-1-git-send-email-david.marchand@redhat.com> References: <1571736761-32134-1-git-send-email-david.marchand@redhat.com> <1571856864-8779-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 8eCVGmaDPLSmDGqeOKkmpA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH v2 04/12] mem: hide internal heap header 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" Let's avoid exporting structures without an identified usecase. Signed-off-by: David Marchand --- app/test-pmd/testpmd.c | 1 - lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_memcfg.h | 3 ++- lib/librte_eal/common/include/rte_malloc_heap.h | 35 ---------------------= ---- lib/librte_eal/common/malloc_heap.h | 25 +++++++++++++++++- lib/librte_eal/common/meson.build | 1 - 6 files changed, 27 insertions(+), 40 deletions(-) delete mode 100644 lib/librte_eal/common/include/rte_malloc_heap.h diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 5701f31..2e530b6 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefil= e index a00d4fc..fb291f5 100644 --- a/lib/librte_eal/common/Makefile +++ b/lib/librte_eal/common/Makefile @@ -10,7 +10,7 @@ INC +=3D rte_log.h rte_memory.h rte_memzone.h INC +=3D rte_per_lcore.h rte_random.h INC +=3D rte_tailq.h rte_interrupts.h rte_alarm.h INC +=3D rte_string_fns.h rte_version.h -INC +=3D rte_eal_memconfig.h rte_malloc_heap.h +INC +=3D rte_eal_memconfig.h INC +=3D rte_hexdump.h rte_devargs.h rte_bus.h rte_dev.h rte_class.h INC +=3D rte_option.h INC +=3D rte_pci_dev_feature_defs.h rte_pci_dev_features.h diff --git a/lib/librte_eal/common/eal_memcfg.h b/lib/librte_eal/common/eal= _memcfg.h index 0e468bb..4d65002 100644 --- a/lib/librte_eal/common/eal_memcfg.h +++ b/lib/librte_eal/common/eal_memcfg.h @@ -6,7 +6,6 @@ #define EAL_MEMCFG_H =20 #include -#include #include #include #include @@ -14,6 +13,8 @@ #include #include =20 +#include "malloc_heap.h" + /** * Memory configuration shared across multiple processes. */ diff --git a/lib/librte_eal/common/include/rte_malloc_heap.h b/lib/librte_e= al/common/include/rte_malloc_heap.h deleted file mode 100644 index 4a7e0eb..0000000 --- a/lib/librte_eal/common/include/rte_malloc_heap.h +++ /dev/null @@ -1,35 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2010-2014 Intel Corporation - */ - -#ifndef _RTE_MALLOC_HEAP_H_ -#define _RTE_MALLOC_HEAP_H_ - -#include -#include -#include -#include - -/* Number of free lists per heap, grouped by size. */ -#define RTE_HEAP_NUM_FREELISTS 13 -#define RTE_HEAP_NAME_MAX_LEN 32 - -/* dummy definition, for pointers */ -struct malloc_elem; - -/** - * Structure to hold malloc heap - */ -struct malloc_heap { -=09rte_spinlock_t lock; -=09LIST_HEAD(, malloc_elem) free_head[RTE_HEAP_NUM_FREELISTS]; -=09struct malloc_elem *volatile first; -=09struct malloc_elem *volatile last; - -=09unsigned alloc_count; -=09unsigned int socket_id; -=09size_t total_size; -=09char name[RTE_HEAP_NAME_MAX_LEN]; -} __rte_cache_aligned; - -#endif /* _RTE_MALLOC_HEAP_H_ */ diff --git a/lib/librte_eal/common/malloc_heap.h b/lib/librte_eal/common/ma= lloc_heap.h index ca9ff66..772736b 100644 --- a/lib/librte_eal/common/malloc_heap.h +++ b/lib/librte_eal/common/malloc_heap.h @@ -6,9 +6,32 @@ #define MALLOC_HEAP_H_ =20 #include +#include =20 #include -#include +#include + +/* Number of free lists per heap, grouped by size. */ +#define RTE_HEAP_NUM_FREELISTS 13 +#define RTE_HEAP_NAME_MAX_LEN 32 + +/* dummy definition, for pointers */ +struct malloc_elem; + +/** + * Structure to hold malloc heap + */ +struct malloc_heap { +=09rte_spinlock_t lock; +=09LIST_HEAD(, malloc_elem) free_head[RTE_HEAP_NUM_FREELISTS]; +=09struct malloc_elem *volatile first; +=09struct malloc_elem *volatile last; + +=09unsigned int alloc_count; +=09unsigned int socket_id; +=09size_t total_size; +=09char name[RTE_HEAP_NAME_MAX_LEN]; +} __rte_cache_aligned; =20 #ifdef __cplusplus extern "C" { diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meso= n.build index 386577c..d6a149b 100644 --- a/lib/librte_eal/common/meson.build +++ b/lib/librte_eal/common/meson.build @@ -72,7 +72,6 @@ common_headers =3D files( =09'include/rte_lcore.h', =09'include/rte_log.h', =09'include/rte_malloc.h', -=09'include/rte_malloc_heap.h', =09'include/rte_memory.h', =09'include/rte_memzone.h', =09'include/rte_option.h', --=20 1.8.3.1