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 CDFDFA32A4 for ; Fri, 25 Oct 2019 15:57:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1763F1C29C; Fri, 25 Oct 2019 15:57:09 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id A345C1C24F for ; Fri, 25 Oct 2019 15:57:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572011820; 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=oSsL5Yq3T0qqCWjSJnES+iFm/kcpoyfpweWT9BEGs1Q=; b=VhGp76dp7xupuNVyPnizGEIqcrmJxd4Lwkzh2bNVTjvyyFsR6oYmEwjJVhk99QUfsqQJIg UHMvkD5/lDnnbcHS4TfYzUfJz97fvhf95a1nnt1UJPOtKmKPUFHtFl2WX7ArSkPrnOEz8V 1XYOf3foKg4sbMReGifePrFyL5kTLzY= 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-225-DK_BjqxbNfm9D2hAtpd8zA-1; Fri, 25 Oct 2019 09:56:47 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0136947B; Fri, 25 Oct 2019 13:56:46 +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 ABEA21001B2D; Fri, 25 Oct 2019 13:56:42 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stephen@networkplumber.org, anatoly.burakov@intel.com, thomas@monjalon.net, ktraynor@redhat.com, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Date: Fri, 25 Oct 2019 15:56:03 +0200 Message-Id: <1572011772-23271-5-git-send-email-david.marchand@redhat.com> In-Reply-To: <1572011772-23271-1-git-send-email-david.marchand@redhat.com> References: <1571736761-32134-1-git-send-email-david.marchand@redhat.com> <1572011772-23271-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: DK_BjqxbNfm9D2hAtpd8zA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH v3 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 Acked-by: Thomas Monjalon --- 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