DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: stephen@networkplumber.org, anatoly.burakov@intel.com,
	thomas@monjalon.net, ktraynor@redhat.com,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>
Subject: [dpdk-dev] [PATCH v3 04/12] mem: hide internal heap header
Date: Fri, 25 Oct 2019 15:56:03 +0200	[thread overview]
Message-ID: <1572011772-23271-5-git-send-email-david.marchand@redhat.com> (raw)
In-Reply-To: <1572011772-23271-1-git-send-email-david.marchand@redhat.com>

Let's avoid exporting structures without an identified usecase.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
 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 <rte_log.h>
 #include <rte_debug.h>
 #include <rte_cycles.h>
-#include <rte_malloc_heap.h>
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_launch.h>
diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile
index a00d4fc..fb291f5 100644
--- a/lib/librte_eal/common/Makefile
+++ b/lib/librte_eal/common/Makefile
@@ -10,7 +10,7 @@ INC += rte_log.h rte_memory.h rte_memzone.h
 INC += rte_per_lcore.h rte_random.h
 INC += rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_version.h
-INC += rte_eal_memconfig.h rte_malloc_heap.h
+INC += rte_eal_memconfig.h
 INC += rte_hexdump.h rte_devargs.h rte_bus.h rte_dev.h rte_class.h
 INC += rte_option.h
 INC += 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
 
 #include <rte_config.h>
-#include <rte_malloc_heap.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_pause.h>
@@ -14,6 +13,8 @@
 #include <rte_rwlock.h>
 #include <rte_tailq.h>
 
+#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_eal/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 <stddef.h>
-#include <sys/queue.h>
-#include <rte_spinlock.h>
-#include <rte_memory.h>
-
-/* 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 {
-	rte_spinlock_t lock;
-	LIST_HEAD(, malloc_elem) free_head[RTE_HEAP_NUM_FREELISTS];
-	struct malloc_elem *volatile first;
-	struct malloc_elem *volatile last;
-
-	unsigned alloc_count;
-	unsigned int socket_id;
-	size_t total_size;
-	char 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/malloc_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_
 
 #include <stdbool.h>
+#include <sys/queue.h>
 
 #include <rte_malloc.h>
-#include <rte_malloc_heap.h>
+#include <rte_spinlock.h>
+
+/* 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 {
+	rte_spinlock_t lock;
+	LIST_HEAD(, malloc_elem) free_head[RTE_HEAP_NUM_FREELISTS];
+	struct malloc_elem *volatile first;
+	struct malloc_elem *volatile last;
+
+	unsigned int alloc_count;
+	unsigned int socket_id;
+	size_t total_size;
+	char name[RTE_HEAP_NAME_MAX_LEN];
+} __rte_cache_aligned;
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.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 = files(
 	'include/rte_lcore.h',
 	'include/rte_log.h',
 	'include/rte_malloc.h',
-	'include/rte_malloc_heap.h',
 	'include/rte_memory.h',
 	'include/rte_memzone.h',
 	'include/rte_option.h',
-- 
1.8.3.1


  parent reply	other threads:[~2019-10-25 13:57 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22  9:32 [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11 David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 1/8] eal: make lcore config private David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 2/8] eal: remove deprecated CPU flags check function David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 3/8] eal: remove deprecated malloc virt2phys function David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 4/8] mem: hide internal heap header David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 5/8] net/bonding: use non deprecated PCI API David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 6/8] pci: remove deprecated functions David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 7/8] log: add log stream accessor David Marchand
2019-10-22 16:34   ` Stephen Hemminger
2019-10-22 16:50     ` David Marchand
2019-10-22  9:32 ` [dpdk-dev] [PATCH 8/8] log: hide internal log structure David Marchand
2019-10-22 16:35   ` Stephen Hemminger
2019-10-23 13:02   ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 01/12] eal: make lcore config private David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 02/12] eal: remove deprecated CPU flags check function David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 03/12] eal: remove deprecated malloc virt2phys function David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 04/12] mem: hide internal heap header David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 05/12] net/bonding: use non deprecated PCI API David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 06/12] pci: remove deprecated functions David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 07/12] log: add log stream accessor David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 08/12] log: hide internal log structure David Marchand
2019-10-24 16:30     ` Thomas Monjalon
2019-10-25  9:19       ` Kevin Traynor
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 09/12] test/mem: remove dependency on EAL internals David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 10/12] eal: deinline lcore APIs David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 11/12] eal: factorize lcore role code in common code David Marchand
2019-10-23 18:54   ` [dpdk-dev] [PATCH v2 12/12] eal: make the global configuration private David Marchand
2019-10-23 21:10   ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 Stephen Hemminger
2019-10-24  7:32     ` David Marchand
2019-10-24 15:37       ` Stephen Hemminger
2019-10-24 16:01         ` David Marchand
2019-10-24 16:37   ` Thomas Monjalon
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 01/12] eal: make lcore config private David Marchand
2019-10-25 15:18     ` Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 02/12] eal: remove deprecated CPU flags check function David Marchand
2019-10-25 15:20     ` Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 03/12] eal: remove deprecated malloc virt2phys function David Marchand
2019-10-25 15:22     ` Burakov, Anatoly
2019-10-25 13:56   ` David Marchand [this message]
2019-10-25 15:23     ` [dpdk-dev] [PATCH v3 04/12] mem: hide internal heap header Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 05/12] net/bonding: use non deprecated PCI API David Marchand
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 06/12] pci: remove deprecated functions David Marchand
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 07/12] log: add log stream accessor David Marchand
2019-10-25 19:05     ` Kevin Traynor
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 08/12] test/mem: remove dependency on EAL internals David Marchand
2019-10-25 15:24     ` Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 09/12] eal: deinline lcore APIs David Marchand
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 10/12] eal: factorize lcore role code David Marchand
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 11/12] eal: make the global configuration private David Marchand
2019-10-25 15:27     ` Burakov, Anatoly
2019-10-25 13:56   ` [dpdk-dev] [PATCH v3 12/12] doc: announce global logs struct removal from ABI David Marchand
2019-10-25 15:30     ` Burakov, Anatoly
2019-10-25 15:33     ` Thomas Monjalon
2019-10-26 18:14     ` Kevin Traynor
2019-10-26 18:48       ` David Marchand
2019-10-26 19:18   ` [dpdk-dev] [PATCH v3 00/12] EAL and PCI ABI changes for 19.11 David Marchand
2019-10-27  6:26     ` David Marchand
2019-10-27  9:56       ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1572011772-23271-5-git-send-email-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=ktraynor@redhat.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).