* [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11
@ 2019-10-22 9:32 David Marchand
2019-10-22 9:32 ` [dpdk-dev] [PATCH 1/8] eal: make lcore config private David Marchand
` (9 more replies)
0 siblings, 10 replies; 60+ messages in thread
From: David Marchand @ 2019-10-22 9:32 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas
Let's prepare for the ABI freeze.
The first patches are about changes that had been announced before (with
a patch from Stephen that I took as it is ready as is from my pov).
The malloc_heap structure from the memory subsystem can be hidden.
The PCI library had some forgotten deprecated APIs that are removed with
this series.
Finally, rte_logs could be hidden, but I am not that confortable about
doing it right away: I added an accessor to rte_logs.file, but I am fine
with dropping the last patch and wait for actually hiding this in the next
ABI break.
Comments?
--
David Marchand
David Marchand (7):
eal: remove deprecated CPU flags check function
eal: remove deprecated malloc virt2phys function
mem: hide internal heap header
net/bonding: use non deprecated PCI API
pci: remove deprecated functions
log: add log stream accessor
log: hide internal log structure
Stephen Hemminger (1):
eal: make lcore config private
app/test-pmd/testpmd.c | 1 -
doc/guides/rel_notes/deprecation.rst | 17 -------
doc/guides/rel_notes/release_19_11.rst | 14 +++++
drivers/common/qat/qat_logs.c | 3 +-
drivers/common/qat/qat_logs.h | 3 +-
drivers/net/bonding/rte_eth_bond_args.c | 5 +-
lib/librte_eal/common/Makefile | 2 +-
lib/librte_eal/common/eal_common_cpuflags.c | 11 ----
lib/librte_eal/common/eal_common_launch.c | 2 +
lib/librte_eal/common/eal_common_log.c | 59 ++++++++++++++--------
lib/librte_eal/common/eal_memcfg.h | 3 +-
lib/librte_eal/common/eal_private.h | 25 +++++++++
.../common/include/generic/rte_cpuflags.h | 9 ----
lib/librte_eal/common/include/rte_lcore.h | 24 ---------
lib/librte_eal/common/include/rte_log.h | 33 ++++++------
lib/librte_eal/common/include/rte_malloc.h | 7 ---
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 -
lib/librte_eal/common/rte_service.c | 2 +
lib/librte_eal/rte_eal_version.map | 6 +--
lib/librte_eal/windows/eal/eal_thread.c | 1 +
lib/librte_pci/rte_pci.c | 19 -------
lib/librte_pci/rte_pci.h | 47 -----------------
lib/librte_pci/rte_pci_version.map | 3 --
25 files changed, 132 insertions(+), 225 deletions(-)
delete mode 100644 lib/librte_eal/common/include/rte_malloc_heap.h
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH 1/8] eal: make lcore config private
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 ` David Marchand
2019-10-22 9:32 ` [dpdk-dev] [PATCH 2/8] eal: remove deprecated CPU flags check function David Marchand
` (8 subsequent siblings)
9 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-22 9:32 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Neil Horman, John McNamara,
Marko Kovacevic, Harry van Haaren, Harini Ramakrishnan,
Omar Cardona, Anand Rawat, Ranjit Menon
From: Stephen Hemminger <stephen@networkplumber.org>
The internal structure of lcore_config does not need to be part of
visible API/ABI. Make it private to EAL.
Rearrange the structure so it takes less memory (and cache footprint).
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Based on Stephen v8: http://patchwork.dpdk.org/patch/60443/
Changes since Stephen v8:
- do not change core_id, socket_id and core_index types,
---
doc/guides/rel_notes/deprecation.rst | 4 ----
doc/guides/rel_notes/release_19_11.rst | 2 ++
lib/librte_eal/common/eal_common_launch.c | 2 ++
lib/librte_eal/common/eal_private.h | 25 +++++++++++++++++++++++++
lib/librte_eal/common/include/rte_lcore.h | 24 ------------------------
lib/librte_eal/common/rte_service.c | 2 ++
lib/librte_eal/rte_eal_version.map | 1 -
lib/librte_eal/windows/eal/eal_thread.c | 1 +
8 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 237813b..e4a33e0 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -23,10 +23,6 @@ Deprecation Notices
* eal: The function ``rte_eal_remote_launch`` will return new error codes
after read or write error on the pipe, instead of calling ``rte_panic``.
-* eal: The ``lcore_config`` struct and global symbol will be made private to
- remove it from the externally visible ABI and allow it to be updated in the
- future.
-
* eal: both declaring and identifying devices will be streamlined in v18.11.
New functions will appear to query a specific port from buses, classes of
device and device drivers. Device declaration will be made coherent with the
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 40121b9..d7e14b4 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -202,6 +202,8 @@ ABI Changes
Also, make sure to start the actual text at the margin.
=========================================================
+* eal: made the ``lcore_config`` struct and global symbol private.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/common/eal_common_launch.c
index fe0ba3f..cf52d71 100644
--- a/lib/librte_eal/common/eal_common_launch.c
+++ b/lib/librte_eal/common/eal_common_launch.c
@@ -15,6 +15,8 @@
#include <rte_per_lcore.h>
#include <rte_lcore.h>
+#include "eal_private.h"
+
/*
* Wait until a lcore finished its job.
*/
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 798ede5..0e4b033 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -10,6 +10,31 @@
#include <stdio.h>
#include <rte_dev.h>
+#include <rte_lcore.h>
+
+/**
+ * Structure storing internal configuration (per-lcore)
+ */
+struct lcore_config {
+ pthread_t thread_id; /**< pthread identifier */
+ int pipe_master2slave[2]; /**< communication pipe with master */
+ int pipe_slave2master[2]; /**< communication pipe with master */
+
+ lcore_function_t * volatile f; /**< function to call */
+ void * volatile arg; /**< argument of function */
+ volatile int ret; /**< return value of function */
+
+ volatile enum rte_lcore_state_t state; /**< lcore state */
+ unsigned int socket_id; /**< physical socket id for this lcore */
+ unsigned int core_id; /**< core number on socket for this lcore */
+ int core_index; /**< relative index, starting from 0 */
+ uint8_t core_role; /**< role of core eg: OFF, RTE, SERVICE */
+ uint8_t detected; /**< true if lcore was detected */
+
+ rte_cpuset_t cpuset; /**< cpu set which the lcore affinity to */
+};
+
+extern struct lcore_config lcore_config[RTE_MAX_LCORE];
/**
* Initialize the memzone subsystem (private to eal).
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index c86f72e..0c68391 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -66,30 +66,6 @@ typedef cpuset_t rte_cpuset_t;
} while (0)
#endif
-/**
- * Structure storing internal configuration (per-lcore)
- */
-struct lcore_config {
- unsigned detected; /**< true if lcore was detected */
- pthread_t thread_id; /**< pthread identifier */
- int pipe_master2slave[2]; /**< communication pipe with master */
- int pipe_slave2master[2]; /**< communication pipe with master */
- lcore_function_t * volatile f; /**< function to call */
- void * volatile arg; /**< argument of function */
- volatile int ret; /**< return value of function */
- volatile enum rte_lcore_state_t state; /**< lcore state */
- unsigned socket_id; /**< physical socket id for this lcore */
- unsigned core_id; /**< core number on socket for this lcore */
- int core_index; /**< relative index, starting from 0 */
- rte_cpuset_t cpuset; /**< cpu set which the lcore affinity to */
- uint8_t core_role; /**< role of core eg: OFF, RTE, SERVICE */
-};
-
-/**
- * Internal configuration (per-lcore)
- */
-extern struct lcore_config lcore_config[RTE_MAX_LCORE];
-
RTE_DECLARE_PER_LCORE(unsigned, _lcore_id); /**< Per thread "lcore id". */
RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index beb9691..79235c0 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -21,6 +21,8 @@
#include <rte_memory.h>
#include <rte_malloc.h>
+#include "eal_private.h"
+
#define RTE_SERVICE_NUM_MAX 64
#define SERVICE_F_REGISTERED (1 << 0)
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 7cbf82d..aeedf39 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -4,7 +4,6 @@ DPDK_2.0 {
__rte_panic;
eal_parse_sysfs_value;
eal_timer_source;
- lcore_config;
per_lcore__lcore_id;
per_lcore__rte_errno;
rte_calloc;
diff --git a/lib/librte_eal/windows/eal/eal_thread.c b/lib/librte_eal/windows/eal/eal_thread.c
index 906502f..0591d4c 100644
--- a/lib/librte_eal/windows/eal/eal_thread.c
+++ b/lib/librte_eal/windows/eal/eal_thread.c
@@ -12,6 +12,7 @@
#include <rte_common.h>
#include <eal_thread.h>
+#include "eal_private.h"
RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH 2/8] eal: remove deprecated CPU flags check function
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 ` David Marchand
2019-10-22 9:32 ` [dpdk-dev] [PATCH 3/8] eal: remove deprecated malloc virt2phys function David Marchand
` (7 subsequent siblings)
9 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-22 9:32 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Neil Horman, John McNamara,
Marko Kovacevic
Remove rte_cpu_check_supported as announced previously.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
doc/guides/rel_notes/deprecation.rst | 3 ---
doc/guides/rel_notes/release_19_11.rst | 3 +++
lib/librte_eal/common/eal_common_cpuflags.c | 11 -----------
lib/librte_eal/common/include/generic/rte_cpuflags.h | 9 ---------
lib/librte_eal/rte_eal_version.map | 1 -
5 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index e4a33e0..50ac348 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,9 +34,6 @@ Deprecation Notices
+ ``rte_eal_devargs_type_count``
-* eal: The ``rte_cpu_check_supported`` function has been deprecated since
- v17.08 and will be removed.
-
* eal: The ``rte_malloc_virt2phy`` function has been deprecated and replaced
by ``rte_malloc_virt2iova`` since v17.11 and will be removed.
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index d7e14b4..8bf2437 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -204,6 +204,9 @@ ABI Changes
* eal: made the ``lcore_config`` struct and global symbol private.
+* eal: removed the ``rte_cpu_check_supported`` function, replaced by
+ ``rte_cpu_is_supported`` since dpdk v17.08.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_eal/common/eal_common_cpuflags.c b/lib/librte_eal/common/eal_common_cpuflags.c
index 3a055f7..dc5f75d 100644
--- a/lib/librte_eal/common/eal_common_cpuflags.c
+++ b/lib/librte_eal/common/eal_common_cpuflags.c
@@ -7,17 +7,6 @@
#include <rte_common.h>
#include <rte_cpuflags.h>
-/**
- * Checks if the machine is adequate for running the binary. If it is not, the
- * program exits with status 1.
- */
-void
-rte_cpu_check_supported(void)
-{
- if (!rte_cpu_is_supported())
- exit(1);
-}
-
int
rte_cpu_is_supported(void)
{
diff --git a/lib/librte_eal/common/include/generic/rte_cpuflags.h b/lib/librte_eal/common/include/generic/rte_cpuflags.h
index 156ea00..872f0eb 100644
--- a/lib/librte_eal/common/include/generic/rte_cpuflags.h
+++ b/lib/librte_eal/common/include/generic/rte_cpuflags.h
@@ -49,15 +49,6 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature);
/**
* This function checks that the currently used CPU supports the CPU features
* that were specified at compile time. It is called automatically within the
- * EAL, so does not need to be used by applications.
- */
-__rte_deprecated
-void
-rte_cpu_check_supported(void);
-
-/**
- * This function checks that the currently used CPU supports the CPU features
- * that were specified at compile time. It is called automatically within the
* EAL, so does not need to be used by applications. This version returns a
* result so that decisions may be made (for instance, graceful shutdowns).
*/
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index aeedf39..0887549 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -8,7 +8,6 @@ DPDK_2.0 {
per_lcore__rte_errno;
rte_calloc;
rte_calloc_socket;
- rte_cpu_check_supported;
rte_cpu_get_flag_enabled;
rte_cycles_vmware_tsc_map;
rte_delay_us;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH 3/8] eal: remove deprecated malloc virt2phys function
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 ` David Marchand
2019-10-22 9:32 ` [dpdk-dev] [PATCH 4/8] mem: hide internal heap header David Marchand
` (6 subsequent siblings)
9 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-22 9:32 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Neil Horman, John McNamara,
Marko Kovacevic
Remove rte_malloc_virt2phy as announced previously.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
doc/guides/rel_notes/deprecation.rst | 3 ---
doc/guides/rel_notes/release_19_11.rst | 3 +++
lib/librte_eal/common/include/rte_malloc.h | 7 -------
3 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 50ac348..bbd5863 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,9 +34,6 @@ Deprecation Notices
+ ``rte_eal_devargs_type_count``
-* eal: The ``rte_malloc_virt2phy`` function has been deprecated and replaced
- by ``rte_malloc_virt2iova`` since v17.11 and will be removed.
-
* vfio: removal of ``rte_vfio_dma_map`` and ``rte_vfio_dma_unmap`` APIs which
have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
functions. The due date for the removal targets DPDK 20.02.
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 8bf2437..0c61c1c 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -207,6 +207,9 @@ ABI Changes
* eal: removed the ``rte_cpu_check_supported`` function, replaced by
``rte_cpu_is_supported`` since dpdk v17.08.
+* eal: removed the ``rte_malloc_virt2phy`` function, replaced by
+ ``rte_malloc_virt2iova`` since v17.11.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 3593fb4..42ca051 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -553,13 +553,6 @@ rte_malloc_set_limit(const char *type, size_t max);
rte_iova_t
rte_malloc_virt2iova(const void *addr);
-__rte_deprecated
-static inline phys_addr_t
-rte_malloc_virt2phy(const void *addr)
-{
- return rte_malloc_virt2iova(addr);
-}
-
#ifdef __cplusplus
}
#endif
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH 4/8] mem: hide internal heap header
2019-10-22 9:32 [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11 David Marchand
` (2 preceding siblings ...)
2019-10-22 9:32 ` [dpdk-dev] [PATCH 3/8] eal: remove deprecated malloc virt2phys function David Marchand
@ 2019-10-22 9:32 ` David Marchand
2019-10-22 9:32 ` [dpdk-dev] [PATCH 5/8] net/bonding: use non deprecated PCI API David Marchand
` (5 subsequent siblings)
9 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-22 9:32 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Wenzhuo Lu, Jingjing Wu,
Bernard Iremonger
Let's avoid exporting structures without an identified usecase.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
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
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH 5/8] net/bonding: use non deprecated PCI API
2019-10-22 9:32 [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11 David Marchand
` (3 preceding siblings ...)
2019-10-22 9:32 ` [dpdk-dev] [PATCH 4/8] mem: hide internal heap header David Marchand
@ 2019-10-22 9:32 ` David Marchand
2019-10-22 9:32 ` [dpdk-dev] [PATCH 6/8] pci: remove deprecated functions David Marchand
` (4 subsequent siblings)
9 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-22 9:32 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, stable, Chas Williams
rte_eal_compare_pci_addr has been deprecated since v17.11.
Convert to rte_pci_addr_cmp.
Fixes: c848b518bbc7 ("net/bonding: support bifurcated driver in eal")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/net/bonding/rte_eth_bond_args.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
index f298ea0..bfe03c3 100644
--- a/drivers/net/bonding/rte_eth_bond_args.c
+++ b/drivers/net/bonding/rte_eth_bond_args.c
@@ -60,11 +60,10 @@ find_port_id_by_dev_name(const char *name)
static inline int
bond_pci_addr_cmp(const struct rte_device *dev, const void *_pci_addr)
{
- struct rte_pci_device *pdev;
+ const struct rte_pci_device *pdev = RTE_DEV_TO_PCI_CONST(dev);
const struct rte_pci_addr *paddr = _pci_addr;
- pdev = RTE_DEV_TO_PCI(*(struct rte_device **)(void *)&dev);
- return rte_eal_compare_pci_addr(&pdev->addr, paddr);
+ return rte_pci_addr_cmp(&pdev->addr, paddr);
}
/**
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH 6/8] pci: remove deprecated functions
2019-10-22 9:32 [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11 David Marchand
` (4 preceding siblings ...)
2019-10-22 9:32 ` [dpdk-dev] [PATCH 5/8] net/bonding: use non deprecated PCI API David Marchand
@ 2019-10-22 9:32 ` David Marchand
2019-10-22 9:32 ` [dpdk-dev] [PATCH 7/8] log: add log stream accessor David Marchand
` (3 subsequent siblings)
9 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-22 9:32 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Neil Horman, John McNamara,
Marko Kovacevic, Gaetan Rivet
Those functions have been deprecated since 17.11 and have 1:1
replacement.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
doc/guides/rel_notes/deprecation.rst | 7 -----
doc/guides/rel_notes/release_19_11.rst | 6 +++++
lib/librte_pci/rte_pci.c | 19 --------------
lib/librte_pci/rte_pci.h | 47 ----------------------------------
lib/librte_pci/rte_pci_version.map | 3 ---
5 files changed, 6 insertions(+), 76 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index bbd5863..cf7744e 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -38,13 +38,6 @@ Deprecation Notices
have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
functions. The due date for the removal targets DPDK 20.02.
-* pci: Several exposed functions are misnamed.
- The following functions are deprecated starting from v17.11 and are replaced:
-
- - ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse``
- - ``eal_parse_pci_DomBDF`` replaced by ``rte_pci_addr_parse``
- - ``rte_eal_compare_pci_addr`` replaced by ``rte_pci_addr_cmp``
-
* dpaa2: removal of ``rte_dpaa2_memsegs`` structure which has been replaced
by a pa-va search library. This structure was earlier being used for holding
memory segments used by dpaa2 driver for faster pa->va translation. This
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 0c61c1c..579311d 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -210,6 +210,12 @@ ABI Changes
* eal: removed the ``rte_malloc_virt2phy`` function, replaced by
``rte_malloc_virt2iova`` since v17.11.
+* pci: removed the following deprecated functions since dpdk:
+
+ - ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse``
+ - ``eal_parse_pci_DomBDF`` replaced by ``rte_pci_addr_parse``
+ - ``rte_eal_compare_pci_addr`` replaced by ``rte_pci_addr_cmp``
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_pci/rte_pci.c b/lib/librte_pci/rte_pci.c
index f400178..a753cf3 100644
--- a/lib/librte_pci/rte_pci.c
+++ b/lib/librte_pci/rte_pci.c
@@ -87,18 +87,6 @@ pci_dbdf_parse(const char *input, struct rte_pci_addr *dev_addr)
return 0;
}
-int
-eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr)
-{
- return pci_bdf_parse(input, dev_addr);
-}
-
-int
-eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr)
-{
- return pci_dbdf_parse(input, dev_addr);
-}
-
void
rte_pci_device_name(const struct rte_pci_addr *addr,
char *output, size_t size)
@@ -110,13 +98,6 @@ rte_pci_device_name(const struct rte_pci_addr *addr,
}
int
-rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,
- const struct rte_pci_addr *addr2)
-{
- return rte_pci_addr_cmp(addr, addr2);
-}
-
-int
rte_pci_addr_cmp(const struct rte_pci_addr *addr,
const struct rte_pci_addr *addr2)
{
diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h
index eaa9d07..c878914 100644
--- a/lib/librte_pci/rte_pci.h
+++ b/lib/librte_pci/rte_pci.h
@@ -106,37 +106,6 @@ struct mapped_pci_resource {
TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);
/**
- * @deprecated
- * Utility function to produce a PCI Bus-Device-Function value
- * given a string representation. Assumes that the BDF is provided without
- * a domain prefix (i.e. domain returned is always 0)
- *
- * @param input
- * The input string to be parsed. Should have the format XX:XX.X
- * @param dev_addr
- * The PCI Bus-Device-Function address to be returned.
- * Domain will always be returned as 0
- * @return
- * 0 on success, negative on error.
- */
-int eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr);
-
-/**
- * @deprecated
- * Utility function to produce a PCI Bus-Device-Function value
- * given a string representation. Assumes that the BDF is provided including
- * a domain prefix.
- *
- * @param input
- * The input string to be parsed. Should have the format XXXX:XX:XX.X
- * @param dev_addr
- * The PCI Bus-Device-Function address to be returned
- * @return
- * 0 on success, negative on error.
- */
-int eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr);
-
-/**
* Utility function to write a pci device name, this device name can later be
* used to retrieve the corresponding rte_pci_addr using eal_parse_pci_*
* BDF helpers.
@@ -152,22 +121,6 @@ void rte_pci_device_name(const struct rte_pci_addr *addr,
char *output, size_t size);
/**
- * @deprecated
- * Utility function to compare two PCI device addresses.
- *
- * @param addr
- * The PCI Bus-Device-Function address to compare
- * @param addr2
- * The PCI Bus-Device-Function address to compare
- * @return
- * 0 on equal PCI address.
- * Positive on addr is greater than addr2.
- * Negative on addr is less than addr2, or error.
- */
-int rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,
- const struct rte_pci_addr *addr2);
-
-/**
* Utility function to compare two PCI device addresses.
*
* @param addr
diff --git a/lib/librte_pci/rte_pci_version.map b/lib/librte_pci/rte_pci_version.map
index c028027..03790cb 100644
--- a/lib/librte_pci/rte_pci_version.map
+++ b/lib/librte_pci/rte_pci_version.map
@@ -1,11 +1,8 @@
DPDK_17.11 {
global:
- eal_parse_pci_BDF;
- eal_parse_pci_DomBDF;
pci_map_resource;
pci_unmap_resource;
- rte_eal_compare_pci_addr;
rte_pci_addr_cmp;
rte_pci_addr_parse;
rte_pci_device_name;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH 7/8] log: add log stream accessor
2019-10-22 9:32 [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11 David Marchand
` (5 preceding siblings ...)
2019-10-22 9:32 ` [dpdk-dev] [PATCH 6/8] pci: remove deprecated functions David Marchand
@ 2019-10-22 9:32 ` David Marchand
2019-10-22 16:34 ` Stephen Hemminger
2019-10-22 9:32 ` [dpdk-dev] [PATCH 8/8] log: hide internal log structure David Marchand
` (2 subsequent siblings)
9 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-22 9:32 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, John Griffin, Fiona Trahe,
Deepak Kumar Jain
Define an accessor so that users can write their debug message to the
same stream than the rte_log infrastructure.
Use it in the qat infrastructure.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/common/qat/qat_logs.c | 3 +--
drivers/common/qat/qat_logs.h | 3 +--
lib/librte_eal/common/eal_common_log.c | 36 ++++++++++++++++++++-------------
lib/librte_eal/common/include/rte_log.h | 13 ++++++++++++
lib/librte_eal/rte_eal_version.map | 3 +++
5 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
index 7a86170..f97aba1 100644
--- a/drivers/common/qat/qat_logs.c
+++ b/drivers/common/qat/qat_logs.c
@@ -19,8 +19,7 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
if (level > (uint32_t)(rte_log_get_level(logtype)))
return 0;
- rte_hexdump(rte_logs.file == NULL ? stderr : rte_logs.file,
- title, buf, len);
+ rte_hexdump(rte_log_get_stream(), title, buf, len);
return 0;
}
diff --git a/drivers/common/qat/qat_logs.h b/drivers/common/qat/qat_logs.h
index 4baea12..2e4d394 100644
--- a/drivers/common/qat/qat_logs.h
+++ b/drivers/common/qat/qat_logs.h
@@ -24,8 +24,7 @@ extern int qat_dp_logtype;
*
* Dump out the message buffer in a special hex dump output format with
* characters printed for each line of 16 hex values. The message will be sent
- * to the stream defined by rte_logs.file or to stderr in case of rte_logs.file
- * is undefined.
+ * to the stream used by the rte_log infrastructure.
*/
int
qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index 4f6f227..cfe9599 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -71,6 +71,27 @@ rte_openlog_stream(FILE *f)
return 0;
}
+FILE *
+rte_log_get_stream(void)
+{
+ FILE *f = rte_logs.file;
+
+ if (f == NULL) {
+ f = default_log_stream;
+ if (f == NULL) {
+ /*
+ * Grab the current value of stderr here, rather than
+ * just initializing default_log_stream to stderr. This
+ * ensures that we will always use the current value
+ * of stderr, even if the application closes and
+ * reopens it.
+ */
+ f = stderr;
+ }
+ }
+ return f;
+}
+
/* Set global log level */
void
rte_log_set_global_level(uint32_t level)
@@ -396,21 +417,8 @@ rte_log_dump(FILE *f)
int
rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
{
+ FILE *f = rte_log_get_stream();
int ret;
- FILE *f = rte_logs.file;
- if (f == NULL) {
- f = default_log_stream;
- if (f == NULL) {
- /*
- * Grab the current value of stderr here, rather than
- * just initializing default_log_stream to stderr. This
- * ensures that we will always use the current value
- * of stderr, even if the application closes and
- * reopens it.
- */
- f = stderr;
- }
- }
if (level > rte_logs.level)
return 0;
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index cbb4184..1bb0e66 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -102,6 +102,19 @@ extern struct rte_logs rte_logs;
int rte_openlog_stream(FILE *f);
/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Retrieve the stream used by the logging system (see rte_openlog_stream()
+ * to change it).
+ *
+ * @return
+ * Pointer to the stream.
+ */
+__rte_experimental
+FILE *rte_log_get_stream(void);
+
+/**
* Set the global log level.
*
* After this call, logs with a level lower or equal than the level
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 0887549..6d7e0e4 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -417,4 +417,7 @@ EXPERIMENTAL {
rte_mcfg_timer_lock;
rte_mcfg_timer_unlock;
rte_rand_max;
+
+ # added in 19.11
+ rte_log_get_stream;
};
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH 8/8] log: hide internal log structure
2019-10-22 9:32 [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11 David Marchand
` (6 preceding siblings ...)
2019-10-22 9:32 ` [dpdk-dev] [PATCH 7/8] log: add log stream accessor David Marchand
@ 2019-10-22 9:32 ` 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-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
9 siblings, 2 replies; 60+ messages in thread
From: David Marchand @ 2019-10-22 9:32 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas
No need to expose rte_logs, hide it and remove it from the current ABI.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/librte_eal/common/eal_common_log.c | 23 ++++++++++++++++-------
lib/librte_eal/common/include/rte_log.h | 20 +++-----------------
lib/librte_eal/rte_eal_version.map | 1 -
3 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index cfe9599..3a7ab88 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -17,13 +17,6 @@
#include "eal_private.h"
-/* global log structure */
-struct rte_logs rte_logs = {
- .type = ~0,
- .level = RTE_LOG_DEBUG,
- .file = NULL,
-};
-
struct rte_eal_opt_loglevel {
/** Next list entry */
TAILQ_ENTRY(rte_eal_opt_loglevel) next;
@@ -58,6 +51,22 @@ struct rte_log_dynamic_type {
uint32_t loglevel;
};
+/** The rte_log structure. */
+struct rte_logs {
+ uint32_t type; /**< Bitfield with enabled logs. */
+ uint32_t level; /**< Log level. */
+ FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */
+ size_t dynamic_types_len;
+ struct rte_log_dynamic_type *dynamic_types;
+};
+
+/* global log structure */
+static struct rte_logs rte_logs = {
+ .type = ~0,
+ .level = RTE_LOG_DEBUG,
+ .file = NULL,
+};
+
/* per core log */
static RTE_DEFINE_PER_LCORE(struct log_cur_msg, log_cur_msg);
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index 1bb0e66..a8d0eb7 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -26,20 +26,6 @@ extern "C" {
#include <rte_config.h>
#include <rte_compat.h>
-struct rte_log_dynamic_type;
-
-/** The rte_log structure. */
-struct rte_logs {
- uint32_t type; /**< Bitfield with enabled logs. */
- uint32_t level; /**< Log level. */
- FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */
- size_t dynamic_types_len;
- struct rte_log_dynamic_type *dynamic_types;
-};
-
-/** Global log information */
-extern struct rte_logs rte_logs;
-
/* SDK log type */
#define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */
#define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */
@@ -260,7 +246,7 @@ void rte_log_dump(FILE *f);
* to rte_openlog_stream().
*
* The level argument determines if the log should be displayed or
- * not, depending on the global rte_logs variable.
+ * not, depending on the global log level and the per logtype level.
*
* The preferred alternative is the RTE_LOG() because it adds the
* level and type in the logged string.
@@ -291,8 +277,8 @@ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...)
* to rte_openlog_stream().
*
* The level argument determines if the log should be displayed or
- * not, depending on the global rte_logs variable. A trailing
- * newline may be added if needed.
+ * not, depending on the global log level and the per logtype level.
+ * A trailing newline may be added if needed.
*
* The preferred alternative is the RTE_LOG() because it adds the
* level and type in the logged string.
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 6d7e0e4..ca9ace0 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -45,7 +45,6 @@ DPDK_2.0 {
rte_log;
rte_log_cur_msg_loglevel;
rte_log_cur_msg_logtype;
- rte_logs;
rte_malloc;
rte_malloc_dump_stats;
rte_malloc_get_socket_stats;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH 7/8] log: add log stream accessor
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
0 siblings, 1 reply; 60+ messages in thread
From: Stephen Hemminger @ 2019-10-22 16:34 UTC (permalink / raw)
To: David Marchand
Cc: dev, anatoly.burakov, thomas, John Griffin, Fiona Trahe,
Deepak Kumar Jain
On Tue, 22 Oct 2019 11:32:40 +0200
David Marchand <david.marchand@redhat.com> wrote:
> + if (f == NULL) {
> + f = default_log_stream;
> + if (f == NULL) {
> + /*
> + * Grab the current value of stderr here, rather than
> + * just initializing default_log_stream to stderr. This
> + * ensures that we will always use the current value
> + * of stderr, even if the application closes and
> + * reopens it.
> + */
> + f = stderr;
> + }
> + }
> + return f;
Why not just the short form?
return default_log_stream ? : stderr;
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH 8/8] log: hide internal log structure
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
1 sibling, 0 replies; 60+ messages in thread
From: Stephen Hemminger @ 2019-10-22 16:35 UTC (permalink / raw)
To: David Marchand; +Cc: dev, anatoly.burakov, thomas
On Tue, 22 Oct 2019 11:32:41 +0200
David Marchand <david.marchand@redhat.com> wrote:
> No need to expose rte_logs, hide it and remove it from the current ABI.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> lib/librte_eal/common/eal_common_log.c | 23 ++++++++++++++++-------
> lib/librte_eal/common/include/rte_log.h | 20 +++-----------------
> lib/librte_eal/rte_eal_version.map | 1 -
> 3 files changed, 19 insertions(+), 25 deletions(-)
>
> diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
> index cfe9599..3a7ab88 100644
> --- a/lib/librte_eal/common/eal_common_log.c
> +++ b/lib/librte_eal/common/eal_common_log.c
> @@ -17,13 +17,6 @@
>
> #include "eal_private.h"
>
> -/* global log structure */
> -struct rte_logs rte_logs = {
> - .type = ~0,
> - .level = RTE_LOG_DEBUG,
> - .file = NULL,
> -};
> -
> struct rte_eal_opt_loglevel {
> /** Next list entry */
> TAILQ_ENTRY(rte_eal_opt_loglevel) next;
> @@ -58,6 +51,22 @@ struct rte_log_dynamic_type {
> uint32_t loglevel;
> };
>
> +/** The rte_log structure. */
> +struct rte_logs {
> + uint32_t type; /**< Bitfield with enabled logs. */
> + uint32_t level; /**< Log level. */
> + FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */
> + size_t dynamic_types_len;
> + struct rte_log_dynamic_type *dynamic_types;
> +};
> +
> +/* global log structure */
> +static struct rte_logs rte_logs = {
> + .type = ~0,
> + .level = RTE_LOG_DEBUG,
> + .file = NULL,
> +};
> +
> /* per core log */
> static RTE_DEFINE_PER_LCORE(struct log_cur_msg, log_cur_msg);
>
> diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
> index 1bb0e66..a8d0eb7 100644
> --- a/lib/librte_eal/common/include/rte_log.h
> +++ b/lib/librte_eal/common/include/rte_log.h
> @@ -26,20 +26,6 @@ extern "C" {
> #include <rte_config.h>
> #include <rte_compat.h>
>
> -struct rte_log_dynamic_type;
> -
> -/** The rte_log structure. */
> -struct rte_logs {
> - uint32_t type; /**< Bitfield with enabled logs. */
> - uint32_t level; /**< Log level. */
> - FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */
> - size_t dynamic_types_len;
> - struct rte_log_dynamic_type *dynamic_types;
> -};
> -
> -/** Global log information */
> -extern struct rte_logs rte_logs;
> -
> /* SDK log type */
> #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */
> #define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */
> @@ -260,7 +246,7 @@ void rte_log_dump(FILE *f);
> * to rte_openlog_stream().
> *
> * The level argument determines if the log should be displayed or
> - * not, depending on the global rte_logs variable.
> + * not, depending on the global log level and the per logtype level.
> *
> * The preferred alternative is the RTE_LOG() because it adds the
> * level and type in the logged string.
> @@ -291,8 +277,8 @@ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...)
> * to rte_openlog_stream().
> *
> * The level argument determines if the log should be displayed or
> - * not, depending on the global rte_logs variable. A trailing
> - * newline may be added if needed.
> + * not, depending on the global log level and the per logtype level.
> + * A trailing newline may be added if needed.
> *
> * The preferred alternative is the RTE_LOG() because it adds the
> * level and type in the logged string.
> diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
> index 6d7e0e4..ca9ace0 100644
> --- a/lib/librte_eal/rte_eal_version.map
> +++ b/lib/librte_eal/rte_eal_version.map
> @@ -45,7 +45,6 @@ DPDK_2.0 {
> rte_log;
> rte_log_cur_msg_loglevel;
> rte_log_cur_msg_logtype;
> - rte_logs;
> rte_malloc;
> rte_malloc_dump_stats;
> rte_malloc_get_socket_stats;
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH 7/8] log: add log stream accessor
2019-10-22 16:34 ` Stephen Hemminger
@ 2019-10-22 16:50 ` David Marchand
0 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-22 16:50 UTC (permalink / raw)
To: Stephen Hemminger
Cc: dev, Burakov, Anatoly, Thomas Monjalon, John Griffin,
Fiona Trahe, Deepak Kumar Jain
On Tue, Oct 22, 2019 at 6:34 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Tue, 22 Oct 2019 11:32:40 +0200
> David Marchand <david.marchand@redhat.com> wrote:
>
> > + if (f == NULL) {
> > + f = default_log_stream;
> > + if (f == NULL) {
> > + /*
> > + * Grab the current value of stderr here, rather than
> > + * just initializing default_log_stream to stderr. This
> > + * ensures that we will always use the current value
> > + * of stderr, even if the application closes and
> > + * reopens it.
> > + */
> > + f = stderr;
> > + }
> > + }
> > + return f;
>
> Why not just the short form?
> return default_log_stream ? : stderr;
>
Moved the existing code around, I can use this short form.
--
David Marchand
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH 8/8] log: hide internal log structure
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
1 sibling, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 13:02 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Burakov, Anatoly, Thomas Monjalon
On Tue, Oct 22, 2019 at 11:33 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> No need to expose rte_logs, hide it and remove it from the current ABI.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> lib/librte_eal/common/eal_common_log.c | 23 ++++++++++++++++-------
> lib/librte_eal/common/include/rte_log.h | 20 +++-----------------
> lib/librte_eal/rte_eal_version.map | 1 -
> 3 files changed, 19 insertions(+), 25 deletions(-)
Note to self.
If we go with this patch, an update of the release notes is missing.
--
David Marchand
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11
2019-10-22 9:32 [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11 David Marchand
` (7 preceding siblings ...)
2019-10-22 9:32 ` [dpdk-dev] [PATCH 8/8] log: hide internal log structure David Marchand
@ 2019-10-23 18:54 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 01/12] eal: make lcore config private David Marchand
` (13 more replies)
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
9 siblings, 14 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas
Let's prepare for the ABI freeze.
The first patches are about changes that had been announced before (with
a patch from Stephen that I took as it is ready as is from my pov).
The malloc_heap structure from the memory subsystem can be hidden.
The PCI library had some forgotten deprecated APIs that are removed with
this series.
rte_logs could be hidden, but I am not that confortable about
doing it right away: I added an accessor to rte_logs.file, but I am fine
with dropping the last patch and wait for actually hiding this in the next
ABI break.
Changelog since v1:
- I went a step further, hiding rte_config after de-inlining non critical
functions
Comments?
--
David Marchand
David Marchand (11):
eal: remove deprecated CPU flags check function
eal: remove deprecated malloc virt2phys function
mem: hide internal heap header
net/bonding: use non deprecated PCI API
pci: remove deprecated functions
log: add log stream accessor
log: hide internal log structure
test/mem: remove dependency on EAL internals
eal: deinline lcore APIs
eal: factorize lcore role code in common code
eal: make the global configuration private
Stephen Hemminger (1):
eal: make lcore config private
app/test-pmd/testpmd.c | 1 -
app/test/test_memzone.c | 50 +++++++++------
doc/guides/rel_notes/deprecation.rst | 17 -----
doc/guides/rel_notes/release_19_11.rst | 19 ++++++
drivers/common/qat/qat_logs.c | 3 +-
drivers/common/qat/qat_logs.h | 3 +-
drivers/net/bonding/rte_eth_bond_args.c | 5 +-
lib/librte_eal/common/Makefile | 2 +-
lib/librte_eal/common/eal_common_cpuflags.c | 11 ----
lib/librte_eal/common/eal_common_launch.c | 2 +
lib/librte_eal/common/eal_common_lcore.c | 48 ++++++++++++++
lib/librte_eal/common/eal_common_log.c | 56 ++++++++++-------
lib/librte_eal/common/eal_common_mcfg.c | 1 +
lib/librte_eal/common/eal_memcfg.h | 3 +-
lib/librte_eal/common/eal_private.h | 57 +++++++++++++++++
.../common/include/generic/rte_cpuflags.h | 9 ---
lib/librte_eal/common/include/rte_eal.h | 43 -------------
lib/librte_eal/common/include/rte_lcore.h | 73 ++++------------------
lib/librte_eal/common/include/rte_log.h | 33 +++++-----
lib/librte_eal/common/include/rte_malloc.h | 7 ---
lib/librte_eal/common/include/rte_malloc_heap.h | 35 -----------
lib/librte_eal/common/malloc_heap.c | 1 +
lib/librte_eal/common/malloc_heap.h | 25 +++++++-
lib/librte_eal/common/meson.build | 1 -
lib/librte_eal/common/rte_malloc.c | 1 +
lib/librte_eal/common/rte_service.c | 2 +
lib/librte_eal/freebsd/eal/eal.c | 7 ---
lib/librte_eal/linux/eal/eal.c | 7 ---
lib/librte_eal/rte_eal_version.map | 17 +++--
lib/librte_eal/windows/eal/eal_thread.c | 1 +
lib/librte_pci/rte_pci.c | 19 ------
lib/librte_pci/rte_pci.h | 47 --------------
lib/librte_pci/rte_pci_version.map | 3 -
33 files changed, 271 insertions(+), 338 deletions(-)
delete mode 100644 lib/librte_eal/common/include/rte_malloc_heap.h
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 01/12] eal: make lcore config private
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 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 02/12] eal: remove deprecated CPU flags check function David Marchand
` (12 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Neil Horman, John McNamara,
Marko Kovacevic, Harry van Haaren, Harini Ramakrishnan,
Omar Cardona, Anand Rawat, Ranjit Menon
From: Stephen Hemminger <stephen@networkplumber.org>
The internal structure of lcore_config does not need to be part of
visible API/ABI. Make it private to EAL.
Rearrange the structure so it takes less memory (and cache footprint).
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Based on Stephen v8: http://patchwork.dpdk.org/patch/60443/
Changes since Stephen v8:
- do not change core_id, socket_id and core_index types,
---
doc/guides/rel_notes/deprecation.rst | 4 ----
doc/guides/rel_notes/release_19_11.rst | 2 ++
lib/librte_eal/common/eal_common_launch.c | 2 ++
lib/librte_eal/common/eal_private.h | 25 +++++++++++++++++++++++++
lib/librte_eal/common/include/rte_lcore.h | 24 ------------------------
lib/librte_eal/common/rte_service.c | 2 ++
lib/librte_eal/rte_eal_version.map | 1 -
lib/librte_eal/windows/eal/eal_thread.c | 1 +
8 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 237813b..e4a33e0 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -23,10 +23,6 @@ Deprecation Notices
* eal: The function ``rte_eal_remote_launch`` will return new error codes
after read or write error on the pipe, instead of calling ``rte_panic``.
-* eal: The ``lcore_config`` struct and global symbol will be made private to
- remove it from the externally visible ABI and allow it to be updated in the
- future.
-
* eal: both declaring and identifying devices will be streamlined in v18.11.
New functions will appear to query a specific port from buses, classes of
device and device drivers. Device declaration will be made coherent with the
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 40121b9..d7e14b4 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -202,6 +202,8 @@ ABI Changes
Also, make sure to start the actual text at the margin.
=========================================================
+* eal: made the ``lcore_config`` struct and global symbol private.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/common/eal_common_launch.c
index fe0ba3f..cf52d71 100644
--- a/lib/librte_eal/common/eal_common_launch.c
+++ b/lib/librte_eal/common/eal_common_launch.c
@@ -15,6 +15,8 @@
#include <rte_per_lcore.h>
#include <rte_lcore.h>
+#include "eal_private.h"
+
/*
* Wait until a lcore finished its job.
*/
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 798ede5..0e4b033 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -10,6 +10,31 @@
#include <stdio.h>
#include <rte_dev.h>
+#include <rte_lcore.h>
+
+/**
+ * Structure storing internal configuration (per-lcore)
+ */
+struct lcore_config {
+ pthread_t thread_id; /**< pthread identifier */
+ int pipe_master2slave[2]; /**< communication pipe with master */
+ int pipe_slave2master[2]; /**< communication pipe with master */
+
+ lcore_function_t * volatile f; /**< function to call */
+ void * volatile arg; /**< argument of function */
+ volatile int ret; /**< return value of function */
+
+ volatile enum rte_lcore_state_t state; /**< lcore state */
+ unsigned int socket_id; /**< physical socket id for this lcore */
+ unsigned int core_id; /**< core number on socket for this lcore */
+ int core_index; /**< relative index, starting from 0 */
+ uint8_t core_role; /**< role of core eg: OFF, RTE, SERVICE */
+ uint8_t detected; /**< true if lcore was detected */
+
+ rte_cpuset_t cpuset; /**< cpu set which the lcore affinity to */
+};
+
+extern struct lcore_config lcore_config[RTE_MAX_LCORE];
/**
* Initialize the memzone subsystem (private to eal).
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index c86f72e..0c68391 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -66,30 +66,6 @@ typedef cpuset_t rte_cpuset_t;
} while (0)
#endif
-/**
- * Structure storing internal configuration (per-lcore)
- */
-struct lcore_config {
- unsigned detected; /**< true if lcore was detected */
- pthread_t thread_id; /**< pthread identifier */
- int pipe_master2slave[2]; /**< communication pipe with master */
- int pipe_slave2master[2]; /**< communication pipe with master */
- lcore_function_t * volatile f; /**< function to call */
- void * volatile arg; /**< argument of function */
- volatile int ret; /**< return value of function */
- volatile enum rte_lcore_state_t state; /**< lcore state */
- unsigned socket_id; /**< physical socket id for this lcore */
- unsigned core_id; /**< core number on socket for this lcore */
- int core_index; /**< relative index, starting from 0 */
- rte_cpuset_t cpuset; /**< cpu set which the lcore affinity to */
- uint8_t core_role; /**< role of core eg: OFF, RTE, SERVICE */
-};
-
-/**
- * Internal configuration (per-lcore)
- */
-extern struct lcore_config lcore_config[RTE_MAX_LCORE];
-
RTE_DECLARE_PER_LCORE(unsigned, _lcore_id); /**< Per thread "lcore id". */
RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index beb9691..79235c0 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -21,6 +21,8 @@
#include <rte_memory.h>
#include <rte_malloc.h>
+#include "eal_private.h"
+
#define RTE_SERVICE_NUM_MAX 64
#define SERVICE_F_REGISTERED (1 << 0)
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 7cbf82d..aeedf39 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -4,7 +4,6 @@ DPDK_2.0 {
__rte_panic;
eal_parse_sysfs_value;
eal_timer_source;
- lcore_config;
per_lcore__lcore_id;
per_lcore__rte_errno;
rte_calloc;
diff --git a/lib/librte_eal/windows/eal/eal_thread.c b/lib/librte_eal/windows/eal/eal_thread.c
index 906502f..0591d4c 100644
--- a/lib/librte_eal/windows/eal/eal_thread.c
+++ b/lib/librte_eal/windows/eal/eal_thread.c
@@ -12,6 +12,7 @@
#include <rte_common.h>
#include <eal_thread.h>
+#include "eal_private.h"
RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 02/12] eal: remove deprecated CPU flags check function
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 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 03/12] eal: remove deprecated malloc virt2phys function David Marchand
` (11 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Neil Horman, John McNamara,
Marko Kovacevic
Remove rte_cpu_check_supported as announced previously.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
doc/guides/rel_notes/deprecation.rst | 3 ---
doc/guides/rel_notes/release_19_11.rst | 3 +++
lib/librte_eal/common/eal_common_cpuflags.c | 11 -----------
lib/librte_eal/common/include/generic/rte_cpuflags.h | 9 ---------
lib/librte_eal/rte_eal_version.map | 1 -
5 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index e4a33e0..50ac348 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,9 +34,6 @@ Deprecation Notices
+ ``rte_eal_devargs_type_count``
-* eal: The ``rte_cpu_check_supported`` function has been deprecated since
- v17.08 and will be removed.
-
* eal: The ``rte_malloc_virt2phy`` function has been deprecated and replaced
by ``rte_malloc_virt2iova`` since v17.11 and will be removed.
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index d7e14b4..8bf2437 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -204,6 +204,9 @@ ABI Changes
* eal: made the ``lcore_config`` struct and global symbol private.
+* eal: removed the ``rte_cpu_check_supported`` function, replaced by
+ ``rte_cpu_is_supported`` since dpdk v17.08.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_eal/common/eal_common_cpuflags.c b/lib/librte_eal/common/eal_common_cpuflags.c
index 3a055f7..dc5f75d 100644
--- a/lib/librte_eal/common/eal_common_cpuflags.c
+++ b/lib/librte_eal/common/eal_common_cpuflags.c
@@ -7,17 +7,6 @@
#include <rte_common.h>
#include <rte_cpuflags.h>
-/**
- * Checks if the machine is adequate for running the binary. If it is not, the
- * program exits with status 1.
- */
-void
-rte_cpu_check_supported(void)
-{
- if (!rte_cpu_is_supported())
- exit(1);
-}
-
int
rte_cpu_is_supported(void)
{
diff --git a/lib/librte_eal/common/include/generic/rte_cpuflags.h b/lib/librte_eal/common/include/generic/rte_cpuflags.h
index 156ea00..872f0eb 100644
--- a/lib/librte_eal/common/include/generic/rte_cpuflags.h
+++ b/lib/librte_eal/common/include/generic/rte_cpuflags.h
@@ -49,15 +49,6 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature);
/**
* This function checks that the currently used CPU supports the CPU features
* that were specified at compile time. It is called automatically within the
- * EAL, so does not need to be used by applications.
- */
-__rte_deprecated
-void
-rte_cpu_check_supported(void);
-
-/**
- * This function checks that the currently used CPU supports the CPU features
- * that were specified at compile time. It is called automatically within the
* EAL, so does not need to be used by applications. This version returns a
* result so that decisions may be made (for instance, graceful shutdowns).
*/
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index aeedf39..0887549 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -8,7 +8,6 @@ DPDK_2.0 {
per_lcore__rte_errno;
rte_calloc;
rte_calloc_socket;
- rte_cpu_check_supported;
rte_cpu_get_flag_enabled;
rte_cycles_vmware_tsc_map;
rte_delay_us;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 03/12] eal: remove deprecated malloc virt2phys function
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 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 04/12] mem: hide internal heap header David Marchand
` (10 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Neil Horman, John McNamara,
Marko Kovacevic
Remove rte_malloc_virt2phy as announced previously.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
doc/guides/rel_notes/deprecation.rst | 3 ---
doc/guides/rel_notes/release_19_11.rst | 3 +++
lib/librte_eal/common/include/rte_malloc.h | 7 -------
3 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 50ac348..bbd5863 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,9 +34,6 @@ Deprecation Notices
+ ``rte_eal_devargs_type_count``
-* eal: The ``rte_malloc_virt2phy`` function has been deprecated and replaced
- by ``rte_malloc_virt2iova`` since v17.11 and will be removed.
-
* vfio: removal of ``rte_vfio_dma_map`` and ``rte_vfio_dma_unmap`` APIs which
have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
functions. The due date for the removal targets DPDK 20.02.
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 8bf2437..0c61c1c 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -207,6 +207,9 @@ ABI Changes
* eal: removed the ``rte_cpu_check_supported`` function, replaced by
``rte_cpu_is_supported`` since dpdk v17.08.
+* eal: removed the ``rte_malloc_virt2phy`` function, replaced by
+ ``rte_malloc_virt2iova`` since v17.11.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 3593fb4..42ca051 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -553,13 +553,6 @@ rte_malloc_set_limit(const char *type, size_t max);
rte_iova_t
rte_malloc_virt2iova(const void *addr);
-__rte_deprecated
-static inline phys_addr_t
-rte_malloc_virt2phy(const void *addr)
-{
- return rte_malloc_virt2iova(addr);
-}
-
#ifdef __cplusplus
}
#endif
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 04/12] mem: hide internal heap header
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (2 preceding siblings ...)
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 03/12] eal: remove deprecated malloc virt2phys function David Marchand
@ 2019-10-23 18:54 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 05/12] net/bonding: use non deprecated PCI API David Marchand
` (9 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Wenzhuo Lu, Jingjing Wu,
Bernard Iremonger
Let's avoid exporting structures without an identified usecase.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
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
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 05/12] net/bonding: use non deprecated PCI API
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (3 preceding siblings ...)
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 04/12] mem: hide internal heap header David Marchand
@ 2019-10-23 18:54 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 06/12] pci: remove deprecated functions David Marchand
` (8 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, stable, Chas Williams
rte_eal_compare_pci_addr has been deprecated since v17.11.
Convert to rte_pci_addr_cmp.
Fixes: c848b518bbc7 ("net/bonding: support bifurcated driver in eal")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/net/bonding/rte_eth_bond_args.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
index f298ea0..bfe03c3 100644
--- a/drivers/net/bonding/rte_eth_bond_args.c
+++ b/drivers/net/bonding/rte_eth_bond_args.c
@@ -60,11 +60,10 @@ find_port_id_by_dev_name(const char *name)
static inline int
bond_pci_addr_cmp(const struct rte_device *dev, const void *_pci_addr)
{
- struct rte_pci_device *pdev;
+ const struct rte_pci_device *pdev = RTE_DEV_TO_PCI_CONST(dev);
const struct rte_pci_addr *paddr = _pci_addr;
- pdev = RTE_DEV_TO_PCI(*(struct rte_device **)(void *)&dev);
- return rte_eal_compare_pci_addr(&pdev->addr, paddr);
+ return rte_pci_addr_cmp(&pdev->addr, paddr);
}
/**
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 06/12] pci: remove deprecated functions
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (4 preceding siblings ...)
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 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 07/12] log: add log stream accessor David Marchand
` (7 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, Neil Horman, John McNamara,
Marko Kovacevic, Gaetan Rivet
Those functions have been deprecated since 17.11 and have 1:1
replacement.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
doc/guides/rel_notes/deprecation.rst | 7 -----
doc/guides/rel_notes/release_19_11.rst | 6 +++++
lib/librte_pci/rte_pci.c | 19 --------------
lib/librte_pci/rte_pci.h | 47 ----------------------------------
lib/librte_pci/rte_pci_version.map | 3 ---
5 files changed, 6 insertions(+), 76 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index bbd5863..cf7744e 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -38,13 +38,6 @@ Deprecation Notices
have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
functions. The due date for the removal targets DPDK 20.02.
-* pci: Several exposed functions are misnamed.
- The following functions are deprecated starting from v17.11 and are replaced:
-
- - ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse``
- - ``eal_parse_pci_DomBDF`` replaced by ``rte_pci_addr_parse``
- - ``rte_eal_compare_pci_addr`` replaced by ``rte_pci_addr_cmp``
-
* dpaa2: removal of ``rte_dpaa2_memsegs`` structure which has been replaced
by a pa-va search library. This structure was earlier being used for holding
memory segments used by dpaa2 driver for faster pa->va translation. This
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 0c61c1c..579311d 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -210,6 +210,12 @@ ABI Changes
* eal: removed the ``rte_malloc_virt2phy`` function, replaced by
``rte_malloc_virt2iova`` since v17.11.
+* pci: removed the following deprecated functions since dpdk:
+
+ - ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse``
+ - ``eal_parse_pci_DomBDF`` replaced by ``rte_pci_addr_parse``
+ - ``rte_eal_compare_pci_addr`` replaced by ``rte_pci_addr_cmp``
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_pci/rte_pci.c b/lib/librte_pci/rte_pci.c
index f400178..a753cf3 100644
--- a/lib/librte_pci/rte_pci.c
+++ b/lib/librte_pci/rte_pci.c
@@ -87,18 +87,6 @@ pci_dbdf_parse(const char *input, struct rte_pci_addr *dev_addr)
return 0;
}
-int
-eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr)
-{
- return pci_bdf_parse(input, dev_addr);
-}
-
-int
-eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr)
-{
- return pci_dbdf_parse(input, dev_addr);
-}
-
void
rte_pci_device_name(const struct rte_pci_addr *addr,
char *output, size_t size)
@@ -110,13 +98,6 @@ rte_pci_device_name(const struct rte_pci_addr *addr,
}
int
-rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,
- const struct rte_pci_addr *addr2)
-{
- return rte_pci_addr_cmp(addr, addr2);
-}
-
-int
rte_pci_addr_cmp(const struct rte_pci_addr *addr,
const struct rte_pci_addr *addr2)
{
diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h
index eaa9d07..c878914 100644
--- a/lib/librte_pci/rte_pci.h
+++ b/lib/librte_pci/rte_pci.h
@@ -106,37 +106,6 @@ struct mapped_pci_resource {
TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);
/**
- * @deprecated
- * Utility function to produce a PCI Bus-Device-Function value
- * given a string representation. Assumes that the BDF is provided without
- * a domain prefix (i.e. domain returned is always 0)
- *
- * @param input
- * The input string to be parsed. Should have the format XX:XX.X
- * @param dev_addr
- * The PCI Bus-Device-Function address to be returned.
- * Domain will always be returned as 0
- * @return
- * 0 on success, negative on error.
- */
-int eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr);
-
-/**
- * @deprecated
- * Utility function to produce a PCI Bus-Device-Function value
- * given a string representation. Assumes that the BDF is provided including
- * a domain prefix.
- *
- * @param input
- * The input string to be parsed. Should have the format XXXX:XX:XX.X
- * @param dev_addr
- * The PCI Bus-Device-Function address to be returned
- * @return
- * 0 on success, negative on error.
- */
-int eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr);
-
-/**
* Utility function to write a pci device name, this device name can later be
* used to retrieve the corresponding rte_pci_addr using eal_parse_pci_*
* BDF helpers.
@@ -152,22 +121,6 @@ void rte_pci_device_name(const struct rte_pci_addr *addr,
char *output, size_t size);
/**
- * @deprecated
- * Utility function to compare two PCI device addresses.
- *
- * @param addr
- * The PCI Bus-Device-Function address to compare
- * @param addr2
- * The PCI Bus-Device-Function address to compare
- * @return
- * 0 on equal PCI address.
- * Positive on addr is greater than addr2.
- * Negative on addr is less than addr2, or error.
- */
-int rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,
- const struct rte_pci_addr *addr2);
-
-/**
* Utility function to compare two PCI device addresses.
*
* @param addr
diff --git a/lib/librte_pci/rte_pci_version.map b/lib/librte_pci/rte_pci_version.map
index c028027..03790cb 100644
--- a/lib/librte_pci/rte_pci_version.map
+++ b/lib/librte_pci/rte_pci_version.map
@@ -1,11 +1,8 @@
DPDK_17.11 {
global:
- eal_parse_pci_BDF;
- eal_parse_pci_DomBDF;
pci_map_resource;
pci_unmap_resource;
- rte_eal_compare_pci_addr;
rte_pci_addr_cmp;
rte_pci_addr_parse;
rte_pci_device_name;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 07/12] log: add log stream accessor
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (5 preceding siblings ...)
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 06/12] pci: remove deprecated functions David Marchand
@ 2019-10-23 18:54 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 08/12] log: hide internal log structure David Marchand
` (6 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, John Griffin, Fiona Trahe,
Deepak Kumar Jain
Define an accessor so that users can write their debug message to the
same stream than the rte_log infrastructure.
Use it in the qat infrastructure.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changelog since v1:
- use ternary operator,
---
drivers/common/qat/qat_logs.c | 3 +--
drivers/common/qat/qat_logs.h | 3 +--
lib/librte_eal/common/eal_common_log.c | 33 +++++++++++++++++++--------------
lib/librte_eal/common/include/rte_log.h | 13 +++++++++++++
lib/librte_eal/rte_eal_version.map | 3 +++
5 files changed, 37 insertions(+), 18 deletions(-)
diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
index 7a86170..f97aba1 100644
--- a/drivers/common/qat/qat_logs.c
+++ b/drivers/common/qat/qat_logs.c
@@ -19,8 +19,7 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
if (level > (uint32_t)(rte_log_get_level(logtype)))
return 0;
- rte_hexdump(rte_logs.file == NULL ? stderr : rte_logs.file,
- title, buf, len);
+ rte_hexdump(rte_log_get_stream(), title, buf, len);
return 0;
}
diff --git a/drivers/common/qat/qat_logs.h b/drivers/common/qat/qat_logs.h
index 4baea12..2e4d394 100644
--- a/drivers/common/qat/qat_logs.h
+++ b/drivers/common/qat/qat_logs.h
@@ -24,8 +24,7 @@ extern int qat_dp_logtype;
*
* Dump out the message buffer in a special hex dump output format with
* characters printed for each line of 16 hex values. The message will be sent
- * to the stream defined by rte_logs.file or to stderr in case of rte_logs.file
- * is undefined.
+ * to the stream used by the rte_log infrastructure.
*/
int
qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index 4f6f227..e0a7bef 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -71,6 +71,24 @@ rte_openlog_stream(FILE *f)
return 0;
}
+FILE *
+rte_log_get_stream(void)
+{
+ FILE *f = rte_logs.file;
+
+ if (f == NULL) {
+ /*
+ * Grab the current value of stderr here, rather than
+ * just initializing default_log_stream to stderr. This
+ * ensures that we will always use the current value
+ * of stderr, even if the application closes and
+ * reopens it.
+ */
+ return default_log_stream ? : stderr;
+ }
+ return f;
+}
+
/* Set global log level */
void
rte_log_set_global_level(uint32_t level)
@@ -396,21 +414,8 @@ rte_log_dump(FILE *f)
int
rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
{
+ FILE *f = rte_log_get_stream();
int ret;
- FILE *f = rte_logs.file;
- if (f == NULL) {
- f = default_log_stream;
- if (f == NULL) {
- /*
- * Grab the current value of stderr here, rather than
- * just initializing default_log_stream to stderr. This
- * ensures that we will always use the current value
- * of stderr, even if the application closes and
- * reopens it.
- */
- f = stderr;
- }
- }
if (level > rte_logs.level)
return 0;
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index cbb4184..1bb0e66 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -102,6 +102,19 @@ extern struct rte_logs rte_logs;
int rte_openlog_stream(FILE *f);
/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Retrieve the stream used by the logging system (see rte_openlog_stream()
+ * to change it).
+ *
+ * @return
+ * Pointer to the stream.
+ */
+__rte_experimental
+FILE *rte_log_get_stream(void);
+
+/**
* Set the global log level.
*
* After this call, logs with a level lower or equal than the level
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 0887549..6d7e0e4 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -417,4 +417,7 @@ EXPERIMENTAL {
rte_mcfg_timer_lock;
rte_mcfg_timer_unlock;
rte_rand_max;
+
+ # added in 19.11
+ rte_log_get_stream;
};
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 08/12] log: hide internal log structure
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (6 preceding siblings ...)
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 07/12] log: add log stream accessor David Marchand
@ 2019-10-23 18:54 ` David Marchand
2019-10-24 16:30 ` Thomas Monjalon
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 09/12] test/mem: remove dependency on EAL internals David Marchand
` (5 subsequent siblings)
13 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, John McNamara, Marko Kovacevic
No need to expose rte_logs, hide it and remove it from the current ABI.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
Changelog since v1:
- updated release notes,
---
doc/guides/rel_notes/release_19_11.rst | 2 ++
lib/librte_eal/common/eal_common_log.c | 23 ++++++++++++++++-------
lib/librte_eal/common/include/rte_log.h | 20 +++-----------------
lib/librte_eal/rte_eal_version.map | 1 -
4 files changed, 21 insertions(+), 25 deletions(-)
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 579311d..082c570 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -210,6 +210,8 @@ ABI Changes
* eal: removed the ``rte_malloc_virt2phy`` function, replaced by
``rte_malloc_virt2iova`` since v17.11.
+* eal: made the ``rte_logs`` struct and global symbol private.
+
* pci: removed the following deprecated functions since dpdk:
- ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse``
diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index e0a7bef..57d35a4 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -17,13 +17,6 @@
#include "eal_private.h"
-/* global log structure */
-struct rte_logs rte_logs = {
- .type = ~0,
- .level = RTE_LOG_DEBUG,
- .file = NULL,
-};
-
struct rte_eal_opt_loglevel {
/** Next list entry */
TAILQ_ENTRY(rte_eal_opt_loglevel) next;
@@ -58,6 +51,22 @@ struct rte_log_dynamic_type {
uint32_t loglevel;
};
+/** The rte_log structure. */
+struct rte_logs {
+ uint32_t type; /**< Bitfield with enabled logs. */
+ uint32_t level; /**< Log level. */
+ FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */
+ size_t dynamic_types_len;
+ struct rte_log_dynamic_type *dynamic_types;
+};
+
+/* global log structure */
+static struct rte_logs rte_logs = {
+ .type = ~0,
+ .level = RTE_LOG_DEBUG,
+ .file = NULL,
+};
+
/* per core log */
static RTE_DEFINE_PER_LCORE(struct log_cur_msg, log_cur_msg);
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index 1bb0e66..a8d0eb7 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -26,20 +26,6 @@ extern "C" {
#include <rte_config.h>
#include <rte_compat.h>
-struct rte_log_dynamic_type;
-
-/** The rte_log structure. */
-struct rte_logs {
- uint32_t type; /**< Bitfield with enabled logs. */
- uint32_t level; /**< Log level. */
- FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */
- size_t dynamic_types_len;
- struct rte_log_dynamic_type *dynamic_types;
-};
-
-/** Global log information */
-extern struct rte_logs rte_logs;
-
/* SDK log type */
#define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */
#define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */
@@ -260,7 +246,7 @@ void rte_log_dump(FILE *f);
* to rte_openlog_stream().
*
* The level argument determines if the log should be displayed or
- * not, depending on the global rte_logs variable.
+ * not, depending on the global log level and the per logtype level.
*
* The preferred alternative is the RTE_LOG() because it adds the
* level and type in the logged string.
@@ -291,8 +277,8 @@ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...)
* to rte_openlog_stream().
*
* The level argument determines if the log should be displayed or
- * not, depending on the global rte_logs variable. A trailing
- * newline may be added if needed.
+ * not, depending on the global log level and the per logtype level.
+ * A trailing newline may be added if needed.
*
* The preferred alternative is the RTE_LOG() because it adds the
* level and type in the logged string.
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 6d7e0e4..ca9ace0 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -45,7 +45,6 @@ DPDK_2.0 {
rte_log;
rte_log_cur_msg_loglevel;
rte_log_cur_msg_logtype;
- rte_logs;
rte_malloc;
rte_malloc_dump_stats;
rte_malloc_get_socket_stats;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 09/12] test/mem: remove dependency on EAL internals
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (7 preceding siblings ...)
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 08/12] log: hide internal log structure David Marchand
@ 2019-10-23 18:54 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 10/12] eal: deinline lcore APIs David Marchand
` (4 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas
Rather than dereference the mem_config internal structure, we can rely
on the rte_memzone_walk API and count memzones.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
app/test/test_memzone.c | 50 ++++++++++++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 19 deletions(-)
diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c
index 7edfd06..4d87444 100644
--- a/app/test/test_memzone.c
+++ b/app/test/test_memzone.c
@@ -13,12 +13,12 @@
#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_eal.h>
+#include <rte_lcore.h>
#include <rte_common.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
#include <rte_malloc.h>
#include "../../lib/librte_eal/common/malloc_elem.h"
-#include "../../lib/librte_eal/common/eal_memcfg.h"
#include "test.h"
@@ -927,6 +927,16 @@ test_memzone_free(void)
return 0;
}
+static int test_memzones_left;
+static int memzone_walk_cnt;
+static void memzone_walk_clb(const struct rte_memzone *mz,
+ void *arg __rte_unused)
+{
+ memzone_walk_cnt++;
+ if (!strncmp(TEST_MEMZONE_NAME(""), mz->name, RTE_MEMZONE_NAMESIZE))
+ test_memzones_left++;
+}
+
static int
test_memzone_basic(void)
{
@@ -936,8 +946,12 @@ test_memzone_basic(void)
const struct rte_memzone *memzone4;
const struct rte_memzone *mz;
int memzone_cnt_after, memzone_cnt_expected;
- int memzone_cnt_before =
- rte_eal_get_configuration()->mem_config->memzones.count;
+ int memzone_cnt_before;
+
+ memzone_walk_cnt = 0;
+ test_memzones_left = 0;
+ rte_memzone_walk(memzone_walk_clb, NULL);
+ memzone_cnt_before = memzone_walk_cnt;
memzone1 = rte_memzone_reserve(TEST_MEMZONE_NAME("testzone1"), 100,
SOCKET_ID_ANY, 0);
@@ -960,8 +974,10 @@ test_memzone_basic(void)
(memzone1 != NULL) + (memzone2 != NULL) +
(memzone3 != NULL) + (memzone4 != NULL);
- memzone_cnt_after =
- rte_eal_get_configuration()->mem_config->memzones.count;
+ memzone_walk_cnt = 0;
+ test_memzones_left = 0;
+ rte_memzone_walk(memzone_walk_clb, NULL);
+ memzone_cnt_after = memzone_walk_cnt;
if (memzone_cnt_after != memzone_cnt_expected)
return -1;
@@ -1039,30 +1055,26 @@ test_memzone_basic(void)
return -1;
}
- memzone_cnt_after =
- rte_eal_get_configuration()->mem_config->memzones.count;
+ memzone_walk_cnt = 0;
+ test_memzones_left = 0;
+ rte_memzone_walk(memzone_walk_clb, NULL);
+ memzone_cnt_after = memzone_walk_cnt;
if (memzone_cnt_after != memzone_cnt_before)
return -1;
return 0;
}
-static int test_memzones_left;
-static int memzone_walk_cnt;
-static void memzone_walk_clb(const struct rte_memzone *mz,
- void *arg __rte_unused)
-{
- memzone_walk_cnt++;
- if (!strncmp(TEST_MEMZONE_NAME(""), mz->name, RTE_MEMZONE_NAMESIZE))
- test_memzones_left++;
-}
-
static int
test_memzone(void)
{
/* take note of how many memzones were allocated before running */
- int memzone_cnt =
- rte_eal_get_configuration()->mem_config->memzones.count;
+ int memzone_cnt;
+
+ memzone_walk_cnt = 0;
+ test_memzones_left = 0;
+ rte_memzone_walk(memzone_walk_clb, NULL);
+ memzone_cnt = memzone_walk_cnt;
printf("test basic memzone API\n");
if (test_memzone_basic() < 0)
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 10/12] eal: deinline lcore APIs
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (8 preceding siblings ...)
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 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 11/12] eal: factorize lcore role code in common code David Marchand
` (3 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas
Those functions are used to setup or take control decisions.
Move them into the EAL common code and put them directly in the stable
ABI.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/librte_eal/common/eal_common_lcore.c | 38 ++++++++++++++++++++++++++++
lib/librte_eal/common/include/rte_lcore.h | 41 +++----------------------------
lib/librte_eal/rte_eal_version.map | 10 ++++++++
3 files changed, 52 insertions(+), 37 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
index 38af260..abd2cf8 100644
--- a/lib/librte_eal/common/eal_common_lcore.c
+++ b/lib/librte_eal/common/eal_common_lcore.c
@@ -16,6 +16,16 @@
#include "eal_private.h"
#include "eal_thread.h"
+unsigned int rte_get_master_lcore(void)
+{
+ return rte_eal_get_configuration()->master_lcore;
+}
+
+unsigned int rte_lcore_count(void)
+{
+ return rte_eal_get_configuration()->lcore_count;
+}
+
int rte_lcore_index(int lcore_id)
{
if (unlikely(lcore_id >= RTE_MAX_LCORE))
@@ -43,6 +53,34 @@ rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id)
return lcore_config[lcore_id].cpuset;
}
+int rte_lcore_is_enabled(unsigned int lcore_id)
+{
+ struct rte_config *cfg = rte_eal_get_configuration();
+
+ if (lcore_id >= RTE_MAX_LCORE)
+ return 0;
+ return cfg->lcore_role[lcore_id] == ROLE_RTE;
+}
+
+unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
+{
+ i++;
+ if (wrap)
+ i %= RTE_MAX_LCORE;
+
+ while (i < RTE_MAX_LCORE) {
+ if (!rte_lcore_is_enabled(i) ||
+ (skip_master && (i == rte_get_master_lcore()))) {
+ i++;
+ if (wrap)
+ i %= RTE_MAX_LCORE;
+ continue;
+ }
+ break;
+ }
+ return i;
+}
+
unsigned int
rte_lcore_to_socket_id(unsigned int lcore_id)
{
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index 0c68391..ea40c25 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -93,11 +93,7 @@ rte_lcore_id(void)
* @return
* the id of the master lcore
*/
-static inline unsigned
-rte_get_master_lcore(void)
-{
- return rte_eal_get_configuration()->master_lcore;
-}
+unsigned int rte_get_master_lcore(void);
/**
* Return the number of execution units (lcores) on the system.
@@ -105,12 +101,7 @@ rte_get_master_lcore(void)
* @return
* the number of execution units (lcores) on the system.
*/
-static inline unsigned
-rte_lcore_count(void)
-{
- const struct rte_config *cfg = rte_eal_get_configuration();
- return cfg->lcore_count;
-}
+unsigned int rte_lcore_count(void);
/**
* Return the index of the lcore starting from zero.
@@ -215,14 +206,7 @@ rte_lcore_cpuset(unsigned int lcore_id);
* @return
* True if the given lcore is enabled; false otherwise.
*/
-static inline int
-rte_lcore_is_enabled(unsigned int lcore_id)
-{
- struct rte_config *cfg = rte_eal_get_configuration();
- if (lcore_id >= RTE_MAX_LCORE)
- return 0;
- return cfg->lcore_role[lcore_id] == ROLE_RTE;
-}
+int rte_lcore_is_enabled(unsigned int lcore_id);
/**
* Get the next enabled lcore ID.
@@ -237,25 +221,8 @@ rte_lcore_is_enabled(unsigned int lcore_id)
* @return
* The next lcore_id or RTE_MAX_LCORE if not found.
*/
-static inline unsigned int
-rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
-{
- i++;
- if (wrap)
- i %= RTE_MAX_LCORE;
+unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap);
- while (i < RTE_MAX_LCORE) {
- if (!rte_lcore_is_enabled(i) ||
- (skip_master && (i == rte_get_master_lcore()))) {
- i++;
- if (wrap)
- i %= RTE_MAX_LCORE;
- continue;
- }
- break;
- }
- return i;
-}
/**
* Macro to browse all running lcores.
*/
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index ca9ace0..e7422d4 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -309,6 +309,16 @@ DPDK_19.08 {
} DPDK_19.05;
+DPDK_19.11 {
+ global:
+
+ rte_get_master_lcore;
+ rte_get_next_lcore;
+ rte_lcore_count;
+ rte_lcore_is_enabled;
+
+} DPDK_19.08;
+
EXPERIMENTAL {
global:
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 11/12] eal: factorize lcore role code in common code
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (9 preceding siblings ...)
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 10/12] eal: deinline lcore APIs David Marchand
@ 2019-10-23 18:54 ` David Marchand
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 12/12] eal: make the global configuration private David Marchand
` (2 subsequent siblings)
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, Bruce Richardson
This code belongs to the lcore API, move the prototype to the right
header, then factorize the code into the common code.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
lib/librte_eal/common/eal_common_lcore.c | 10 ++++++++++
lib/librte_eal/common/include/rte_eal.h | 11 -----------
lib/librte_eal/common/include/rte_lcore.h | 10 ++++++++++
lib/librte_eal/freebsd/eal/eal.c | 7 -------
lib/librte_eal/linux/eal/eal.c | 7 -------
5 files changed, 20 insertions(+), 25 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
index abd2cf8..343d9b4 100644
--- a/lib/librte_eal/common/eal_common_lcore.c
+++ b/lib/librte_eal/common/eal_common_lcore.c
@@ -53,6 +53,16 @@ rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id)
return lcore_config[lcore_id].cpuset;
}
+enum rte_lcore_role_t
+rte_eal_lcore_role(unsigned int lcore_id)
+{
+ struct rte_config *cfg = rte_eal_get_configuration();
+
+ if (lcore_id >= RTE_MAX_LCORE)
+ return ROLE_OFF;
+ return cfg->lcore_role[lcore_id];
+}
+
int rte_lcore_is_enabled(unsigned int lcore_id)
{
struct rte_config *cfg = rte_eal_get_configuration();
diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index b7cf912..ea3c9df 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -84,17 +84,6 @@ struct rte_config {
struct rte_config *rte_eal_get_configuration(void);
/**
- * Get a lcore's role.
- *
- * @param lcore_id
- * The identifier of the lcore.
- * @return
- * The role of the lcore.
- */
-enum rte_lcore_role_t rte_eal_lcore_role(unsigned lcore_id);
-
-
-/**
* Get the process type in a multi-process setup
*
* @return
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index ea40c25..555b692 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -70,6 +70,16 @@ RTE_DECLARE_PER_LCORE(unsigned, _lcore_id); /**< Per thread "lcore id". */
RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
/**
+ * Get a lcore's role.
+ *
+ * @param lcore_id
+ * The identifier of the lcore, which MUST be between 0 and RTE_MAX_LCORE-1.
+ * @return
+ * The role of the lcore.
+ */
+enum rte_lcore_role_t rte_eal_lcore_role(unsigned int lcore_id);
+
+/**
* Return the Application thread ID of the execution unit.
*
* Note: in most cases the lcore id returned here will also correspond
diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c
index f86e9aa..40d8f57 100644
--- a/lib/librte_eal/freebsd/eal/eal.c
+++ b/lib/librte_eal/freebsd/eal/eal.c
@@ -943,13 +943,6 @@ rte_eal_cleanup(void)
return 0;
}
-/* get core role */
-enum rte_lcore_role_t
-rte_eal_lcore_role(unsigned lcore_id)
-{
- return rte_config.lcore_role[lcore_id];
-}
-
enum rte_proc_type_t
rte_eal_process_type(void)
{
diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index f397206..5769489 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -1348,13 +1348,6 @@ rte_eal_cleanup(void)
return 0;
}
-/* get core role */
-enum rte_lcore_role_t
-rte_eal_lcore_role(unsigned lcore_id)
-{
- return rte_config.lcore_role[lcore_id];
-}
-
enum rte_proc_type_t
rte_eal_process_type(void)
{
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v2 12/12] eal: make the global configuration private
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (10 preceding siblings ...)
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 ` 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 16:37 ` Thomas Monjalon
13 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-23 18:54 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, John McNamara, Marko Kovacevic
Now that all elements of the rte_config structure have (deinlined)
accessors, we can hide it.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
doc/guides/rel_notes/release_19_11.rst | 3 +++
lib/librte_eal/common/eal_common_mcfg.c | 1 +
lib/librte_eal/common/eal_private.h | 32 ++++++++++++++++++++++++++++++++
lib/librte_eal/common/include/rte_eal.h | 32 --------------------------------
lib/librte_eal/common/malloc_heap.c | 1 +
lib/librte_eal/common/rte_malloc.c | 1 +
lib/librte_eal/rte_eal_version.map | 1 -
7 files changed, 38 insertions(+), 33 deletions(-)
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 082c570..ae0f21e 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -212,6 +212,9 @@ ABI Changes
* eal: made the ``rte_logs`` struct and global symbol private.
+* eal: made the ``rte_config`` struct and ``rte_eal_get_configuration``
+ function private.
+
* pci: removed the following deprecated functions since dpdk:
- ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse``
diff --git a/lib/librte_eal/common/eal_common_mcfg.c b/lib/librte_eal/common/eal_common_mcfg.c
index 0665494..0cf9a62 100644
--- a/lib/librte_eal/common/eal_common_mcfg.c
+++ b/lib/librte_eal/common/eal_common_mcfg.c
@@ -8,6 +8,7 @@
#include "eal_internal_cfg.h"
#include "eal_memcfg.h"
+#include "eal_private.h"
void
eal_mcfg_complete(void)
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 0e4b033..52eea9a 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -37,6 +37,38 @@ struct lcore_config {
extern struct lcore_config lcore_config[RTE_MAX_LCORE];
/**
+ * The global RTE configuration structure.
+ */
+struct rte_config {
+ uint32_t master_lcore; /**< Id of the master lcore */
+ uint32_t lcore_count; /**< Number of available logical cores. */
+ uint32_t numa_node_count; /**< Number of detected NUMA nodes. */
+ uint32_t numa_nodes[RTE_MAX_NUMA_NODES]; /**< List of detected NUMA nodes. */
+ uint32_t service_lcore_count;/**< Number of available service cores. */
+ enum rte_lcore_role_t lcore_role[RTE_MAX_LCORE]; /**< State of cores. */
+
+ /** Primary or secondary configuration */
+ enum rte_proc_type_t process_type;
+
+ /** PA or VA mapping mode */
+ enum rte_iova_mode iova_mode;
+
+ /**
+ * Pointer to memory configuration, which may be shared across multiple
+ * DPDK instances
+ */
+ struct rte_mem_config *mem_config;
+} __attribute__((__packed__));
+
+/**
+ * Get the global configuration structure.
+ *
+ * @return
+ * A pointer to the global configuration structure.
+ */
+struct rte_config *rte_eal_get_configuration(void);
+
+/**
* Initialize the memzone subsystem (private to eal).
*
* @return
diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index ea3c9df..2f9ed29 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -52,38 +52,6 @@ enum rte_proc_type_t {
};
/**
- * The global RTE configuration structure.
- */
-struct rte_config {
- uint32_t master_lcore; /**< Id of the master lcore */
- uint32_t lcore_count; /**< Number of available logical cores. */
- uint32_t numa_node_count; /**< Number of detected NUMA nodes. */
- uint32_t numa_nodes[RTE_MAX_NUMA_NODES]; /**< List of detected NUMA nodes. */
- uint32_t service_lcore_count;/**< Number of available service cores. */
- enum rte_lcore_role_t lcore_role[RTE_MAX_LCORE]; /**< State of cores. */
-
- /** Primary or secondary configuration */
- enum rte_proc_type_t process_type;
-
- /** PA or VA mapping mode */
- enum rte_iova_mode iova_mode;
-
- /**
- * Pointer to memory configuration, which may be shared across multiple
- * DPDK instances
- */
- struct rte_mem_config *mem_config;
-} __attribute__((__packed__));
-
-/**
- * Get the global configuration structure.
- *
- * @return
- * A pointer to the global configuration structure.
- */
-struct rte_config *rte_eal_get_configuration(void);
-
-/**
* Get the process type in a multi-process setup
*
* @return
diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c
index 634ca21..842eb9d 100644
--- a/lib/librte_eal/common/malloc_heap.c
+++ b/lib/librte_eal/common/malloc_heap.c
@@ -27,6 +27,7 @@
#include "eal_internal_cfg.h"
#include "eal_memalloc.h"
#include "eal_memcfg.h"
+#include "eal_private.h"
#include "malloc_elem.h"
#include "malloc_heap.h"
#include "malloc_mp.h"
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index fecd9a9..044d3a9 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -26,6 +26,7 @@
#include "malloc_heap.h"
#include "eal_memalloc.h"
#include "eal_memcfg.h"
+#include "eal_private.h"
/* Free the memory space back to heap */
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index e7422d4..009641f 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -17,7 +17,6 @@ DPDK_2.0 {
rte_dump_tailq;
rte_eal_alarm_cancel;
rte_eal_alarm_set;
- rte_eal_get_configuration;
rte_eal_get_lcore_state;
rte_eal_get_physmem_size;
rte_eal_has_hugepages;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (11 preceding siblings ...)
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 12/12] eal: make the global configuration private David Marchand
@ 2019-10-23 21:10 ` Stephen Hemminger
2019-10-24 7:32 ` David Marchand
2019-10-24 16:37 ` Thomas Monjalon
13 siblings, 1 reply; 60+ messages in thread
From: Stephen Hemminger @ 2019-10-23 21:10 UTC (permalink / raw)
To: David Marchand; +Cc: dev, anatoly.burakov, thomas
On Wed, 23 Oct 2019 20:54:12 +0200
David Marchand <david.marchand@redhat.com> wrote:
> Let's prepare for the ABI freeze.
>
> The first patches are about changes that had been announced before (with
> a patch from Stephen that I took as it is ready as is from my pov).
>
> The malloc_heap structure from the memory subsystem can be hidden.
> The PCI library had some forgotten deprecated APIs that are removed with
> this series.
>
> rte_logs could be hidden, but I am not that confortable about
> doing it right away: I added an accessor to rte_logs.file, but I am fine
> with dropping the last patch and wait for actually hiding this in the next
> ABI break.
19.11 is an api/abi break so maybe do it now.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11
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
0 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-24 7:32 UTC (permalink / raw)
To: Stephen Hemminger, Thomas Monjalon; +Cc: dev, Burakov, Anatoly
On Wed, Oct 23, 2019 at 11:10 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Wed, 23 Oct 2019 20:54:12 +0200
> David Marchand <david.marchand@redhat.com> wrote:
>
> > Let's prepare for the ABI freeze.
> >
> > The first patches are about changes that had been announced before (with
> > a patch from Stephen that I took as it is ready as is from my pov).
> >
> > The malloc_heap structure from the memory subsystem can be hidden.
> > The PCI library had some forgotten deprecated APIs that are removed with
> > this series.
> >
> > rte_logs could be hidden, but I am not that confortable about
> > doing it right away: I added an accessor to rte_logs.file, but I am fine
> > with dropping the last patch and wait for actually hiding this in the next
> > ABI break.
>
> 19.11 is an api/abi break so maybe do it now.
Did you look at the 4 new patches too?
Same concern + this was not announced before either.
I went and hid more internals, I did not see an impact on really basic bench.
I would appreciate other opinions.
--
David Marchand
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11
2019-10-24 7:32 ` David Marchand
@ 2019-10-24 15:37 ` Stephen Hemminger
2019-10-24 16:01 ` David Marchand
0 siblings, 1 reply; 60+ messages in thread
From: Stephen Hemminger @ 2019-10-24 15:37 UTC (permalink / raw)
To: David Marchand; +Cc: Thomas Monjalon, dev, Burakov, Anatoly
On Thu, 24 Oct 2019 09:32:10 +0200
David Marchand <david.marchand@redhat.com> wrote:
> On Wed, Oct 23, 2019 at 11:10 PM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > On Wed, 23 Oct 2019 20:54:12 +0200
> > David Marchand <david.marchand@redhat.com> wrote:
> >
> > > Let's prepare for the ABI freeze.
> > >
> > > The first patches are about changes that had been announced before (with
> > > a patch from Stephen that I took as it is ready as is from my pov).
> > >
> > > The malloc_heap structure from the memory subsystem can be hidden.
> > > The PCI library had some forgotten deprecated APIs that are removed with
> > > this series.
> > >
> > > rte_logs could be hidden, but I am not that confortable about
> > > doing it right away: I added an accessor to rte_logs.file, but I am fine
> > > with dropping the last patch and wait for actually hiding this in the next
> > > ABI break.
> >
> > 19.11 is an api/abi break so maybe do it now.
>
> Did you look at the 4 new patches too?
>
> Same concern + this was not announced before either.
> I went and hid more internals, I did not see an impact on really basic bench.
>
> I would appreciate other opinions.
>
>
These all look good. There is probably a lot more that could be
done, adding more accessors in 20.02 could help but more hiding won't happen
again until 20.11
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11
2019-10-24 15:37 ` Stephen Hemminger
@ 2019-10-24 16:01 ` David Marchand
0 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-24 16:01 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Thomas Monjalon, dev, Burakov, Anatoly
On Thu, Oct 24, 2019 at 5:37 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
> > > > rte_logs could be hidden, but I am not that confortable about
> > > > doing it right away: I added an accessor to rte_logs.file, but I am fine
> > > > with dropping the last patch and wait for actually hiding this in the next
> > > > ABI break.
> > >
> > > 19.11 is an api/abi break so maybe do it now.
> >
> > I went and hid more internals, I did not see an impact on really basic bench.
> >
> > I would appreciate other opinions.
>
> These all look good. There is probably a lot more that could be
> done, adding more accessors in 20.02 could help but more hiding won't happen
> again until 20.11
Yes, I went with the low hanging fruits.
It is a long term effort in any case, when reviewing too.
--
David Marchand
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v2 08/12] log: hide internal log structure
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
0 siblings, 1 reply; 60+ messages in thread
From: Thomas Monjalon @ 2019-10-24 16:30 UTC (permalink / raw)
To: david.marchand; +Cc: dev, anaotoly.burakov, stephen, ktraynor
23/10/2019 20:54, David Marchand:
> No need to expose rte_logs, hide it and remove it from the current ABI.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
[...]
> --- a/lib/librte_eal/common/include/rte_log.h
> +++ b/lib/librte_eal/common/include/rte_log.h
> -struct rte_log_dynamic_type;
> -
> -/** The rte_log structure. */
> -struct rte_logs {
> - uint32_t type; /**< Bitfield with enabled logs. */
> - uint32_t level; /**< Log level. */
> - FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */
> - size_t dynamic_types_len;
> - struct rte_log_dynamic_type *dynamic_types;
> -};
I like this kind of change, but the FILE stream is available only through
the new experimental function. It is against the famous Mr Traynor rule:
we cannot deprecate or remove an old stable symbol if the replacement is experimental.
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
` (12 preceding siblings ...)
2019-10-23 21:10 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 Stephen Hemminger
@ 2019-10-24 16:37 ` Thomas Monjalon
13 siblings, 0 replies; 60+ messages in thread
From: Thomas Monjalon @ 2019-10-24 16:37 UTC (permalink / raw)
To: David Marchand; +Cc: dev, stephen, anatoly.burakov
23/10/2019 20:54, David Marchand:
> Let's prepare for the ABI freeze.
>
> The first patches are about changes that had been announced before (with
> a patch from Stephen that I took as it is ready as is from my pov).
>
> The malloc_heap structure from the memory subsystem can be hidden.
> The PCI library had some forgotten deprecated APIs that are removed with
> this series.
>
> rte_logs could be hidden, but I am not that confortable about
> doing it right away: I added an accessor to rte_logs.file, but I am fine
> with dropping the last patch and wait for actually hiding this in the next
> ABI break.
>
> Changelog since v1:
> - I went a step further, hiding rte_config after de-inlining non critical
> functions
>
> Comments?
Except patch 8 (hiding rte_logs),
Acked-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v2 08/12] log: hide internal log structure
2019-10-24 16:30 ` Thomas Monjalon
@ 2019-10-25 9:19 ` Kevin Traynor
0 siblings, 0 replies; 60+ messages in thread
From: Kevin Traynor @ 2019-10-25 9:19 UTC (permalink / raw)
To: Thomas Monjalon, david.marchand; +Cc: dev, anaotoly.burakov, stephen
On 24/10/2019 17:30, Thomas Monjalon wrote:
> 23/10/2019 20:54, David Marchand:
>> No need to expose rte_logs, hide it and remove it from the current ABI.
>>
>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> [...]
>> --- a/lib/librte_eal/common/include/rte_log.h
>> +++ b/lib/librte_eal/common/include/rte_log.h
>> -struct rte_log_dynamic_type;
>> -
>> -/** The rte_log structure. */
>> -struct rte_logs {
>> - uint32_t type; /**< Bitfield with enabled logs. */
>> - uint32_t level; /**< Log level. */
>> - FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */
>> - size_t dynamic_types_len;
>> - struct rte_log_dynamic_type *dynamic_types;
>> -};
>
> I like this kind of change, but the FILE stream is available only through
> the new experimental function. It is against the famous Mr Traynor rule:
> we cannot deprecate or remove an old stable symbol if the replacement is experimental.
>
>
For the change
Acked-by: Kevin Traynor <ktraynor@redhat.com>
++ for the rule (although s/we cannot/Thou shall not/ sounds more biblical)
As for accessor function being experimental, it is so simple I don't see
any issue with promoting it now. OTOH, if no one is planning to change
the struct anytime soon, it's probably fine to keep it public and
promote the fn. later.
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 00/12] EAL and PCI ABI changes for 19.11
2019-10-22 9:32 [dpdk-dev] [PATCH 0/8] EAL and PCI ABI changes for 19.11 David Marchand
` (8 preceding siblings ...)
2019-10-23 18:54 ` [dpdk-dev] [PATCH v2 00/12] EAL and PCI ABI changes for 19.11 David Marchand
@ 2019-10-25 13:55 ` David Marchand
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 01/12] eal: make lcore config private David Marchand
` (12 more replies)
9 siblings, 13 replies; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:55 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, ktraynor
Let's prepare for the ABI freeze.
The first patches are about changes that had been announced before.
The malloc_heap structure from the memory subsystem can be hidden.
The PCI library had some forgotten deprecated APIs that are removed with
this series.
rte_logs could be hidden, but I left it exposed for now.
I added an accessor to rte_logs.file, and added a deprecation notice
announcing its removal from the public ABI.
Changelog since v2:
- dropped patch 8 and added a deprecation notice on rte_logs instead,
Changelog since v1:
- I went a step further, hiding rte_config after de-inlining non critical
functions
--
David Marchand
David Marchand (11):
eal: remove deprecated CPU flags check function
eal: remove deprecated malloc virt2phys function
mem: hide internal heap header
net/bonding: use non deprecated PCI API
pci: remove deprecated functions
log: add log stream accessor
test/mem: remove dependency on EAL internals
eal: deinline lcore APIs
eal: factorize lcore role code
eal: make the global configuration private
doc: announce global logs struct removal from ABI
Stephen Hemminger (1):
eal: make lcore config private
app/test-pmd/testpmd.c | 1 -
app/test/test_memzone.c | 50 +++++++++------
doc/guides/rel_notes/deprecation.rst | 19 +-----
doc/guides/rel_notes/release_19_11.rst | 17 +++++
drivers/common/qat/qat_logs.c | 3 +-
drivers/common/qat/qat_logs.h | 3 +-
drivers/net/bonding/rte_eth_bond_args.c | 5 +-
lib/librte_eal/common/Makefile | 2 +-
lib/librte_eal/common/eal_common_cpuflags.c | 11 ----
lib/librte_eal/common/eal_common_launch.c | 2 +
lib/librte_eal/common/eal_common_lcore.c | 48 ++++++++++++++
lib/librte_eal/common/eal_common_log.c | 33 +++++-----
lib/librte_eal/common/eal_common_mcfg.c | 1 +
lib/librte_eal/common/eal_memcfg.h | 3 +-
lib/librte_eal/common/eal_private.h | 57 +++++++++++++++++
.../common/include/generic/rte_cpuflags.h | 9 ---
lib/librte_eal/common/include/rte_eal.h | 43 -------------
lib/librte_eal/common/include/rte_lcore.h | 73 ++++------------------
lib/librte_eal/common/include/rte_log.h | 13 ++++
lib/librte_eal/common/include/rte_malloc.h | 7 ---
lib/librte_eal/common/include/rte_malloc_heap.h | 35 -----------
lib/librte_eal/common/malloc_heap.c | 1 +
lib/librte_eal/common/malloc_heap.h | 25 +++++++-
lib/librte_eal/common/meson.build | 1 -
lib/librte_eal/common/rte_malloc.c | 1 +
lib/librte_eal/common/rte_service.c | 2 +
lib/librte_eal/freebsd/eal/eal.c | 7 ---
lib/librte_eal/linux/eal/eal.c | 7 ---
lib/librte_eal/rte_eal_version.map | 16 ++++-
lib/librte_eal/windows/eal/eal_thread.c | 1 +
lib/librte_pci/rte_pci.c | 19 ------
lib/librte_pci/rte_pci.h | 47 --------------
lib/librte_pci/rte_pci_version.map | 3 -
33 files changed, 253 insertions(+), 312 deletions(-)
delete mode 100644 lib/librte_eal/common/include/rte_malloc_heap.h
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 01/12] eal: make lcore config private
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
@ 2019-10-25 13:56 ` 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
` (11 subsequent siblings)
12 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, ktraynor, Neil Horman,
John McNamara, Marko Kovacevic, Harry van Haaren,
Harini Ramakrishnan, Omar Cardona, Anand Rawat, Ranjit Menon
From: Stephen Hemminger <stephen@networkplumber.org>
The internal structure of lcore_config does not need to be part of
visible API/ABI. Make it private to EAL.
Rearrange the structure so it takes less memory (and cache footprint).
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
Based on Stephen v8: http://patchwork.dpdk.org/patch/60443/
Changes since Stephen v8:
- do not change core_id, socket_id and core_index types,
---
doc/guides/rel_notes/deprecation.rst | 4 ----
doc/guides/rel_notes/release_19_11.rst | 2 ++
lib/librte_eal/common/eal_common_launch.c | 2 ++
lib/librte_eal/common/eal_private.h | 25 +++++++++++++++++++++++++
lib/librte_eal/common/include/rte_lcore.h | 24 ------------------------
lib/librte_eal/common/rte_service.c | 2 ++
lib/librte_eal/rte_eal_version.map | 1 -
lib/librte_eal/windows/eal/eal_thread.c | 1 +
8 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 237813b..e4a33e0 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -23,10 +23,6 @@ Deprecation Notices
* eal: The function ``rte_eal_remote_launch`` will return new error codes
after read or write error on the pipe, instead of calling ``rte_panic``.
-* eal: The ``lcore_config`` struct and global symbol will be made private to
- remove it from the externally visible ABI and allow it to be updated in the
- future.
-
* eal: both declaring and identifying devices will be streamlined in v18.11.
New functions will appear to query a specific port from buses, classes of
device and device drivers. Device declaration will be made coherent with the
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index e77d226..d2c4e9e 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -312,6 +312,8 @@ ABI Changes
Also, make sure to start the actual text at the margin.
=========================================================
+* eal: made the ``lcore_config`` struct and global symbol private.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/common/eal_common_launch.c
index fe0ba3f..cf52d71 100644
--- a/lib/librte_eal/common/eal_common_launch.c
+++ b/lib/librte_eal/common/eal_common_launch.c
@@ -15,6 +15,8 @@
#include <rte_per_lcore.h>
#include <rte_lcore.h>
+#include "eal_private.h"
+
/*
* Wait until a lcore finished its job.
*/
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 798ede5..0e4b033 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -10,6 +10,31 @@
#include <stdio.h>
#include <rte_dev.h>
+#include <rte_lcore.h>
+
+/**
+ * Structure storing internal configuration (per-lcore)
+ */
+struct lcore_config {
+ pthread_t thread_id; /**< pthread identifier */
+ int pipe_master2slave[2]; /**< communication pipe with master */
+ int pipe_slave2master[2]; /**< communication pipe with master */
+
+ lcore_function_t * volatile f; /**< function to call */
+ void * volatile arg; /**< argument of function */
+ volatile int ret; /**< return value of function */
+
+ volatile enum rte_lcore_state_t state; /**< lcore state */
+ unsigned int socket_id; /**< physical socket id for this lcore */
+ unsigned int core_id; /**< core number on socket for this lcore */
+ int core_index; /**< relative index, starting from 0 */
+ uint8_t core_role; /**< role of core eg: OFF, RTE, SERVICE */
+ uint8_t detected; /**< true if lcore was detected */
+
+ rte_cpuset_t cpuset; /**< cpu set which the lcore affinity to */
+};
+
+extern struct lcore_config lcore_config[RTE_MAX_LCORE];
/**
* Initialize the memzone subsystem (private to eal).
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index c86f72e..0c68391 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -66,30 +66,6 @@ typedef cpuset_t rte_cpuset_t;
} while (0)
#endif
-/**
- * Structure storing internal configuration (per-lcore)
- */
-struct lcore_config {
- unsigned detected; /**< true if lcore was detected */
- pthread_t thread_id; /**< pthread identifier */
- int pipe_master2slave[2]; /**< communication pipe with master */
- int pipe_slave2master[2]; /**< communication pipe with master */
- lcore_function_t * volatile f; /**< function to call */
- void * volatile arg; /**< argument of function */
- volatile int ret; /**< return value of function */
- volatile enum rte_lcore_state_t state; /**< lcore state */
- unsigned socket_id; /**< physical socket id for this lcore */
- unsigned core_id; /**< core number on socket for this lcore */
- int core_index; /**< relative index, starting from 0 */
- rte_cpuset_t cpuset; /**< cpu set which the lcore affinity to */
- uint8_t core_role; /**< role of core eg: OFF, RTE, SERVICE */
-};
-
-/**
- * Internal configuration (per-lcore)
- */
-extern struct lcore_config lcore_config[RTE_MAX_LCORE];
-
RTE_DECLARE_PER_LCORE(unsigned, _lcore_id); /**< Per thread "lcore id". */
RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index beb9691..79235c0 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -21,6 +21,8 @@
#include <rte_memory.h>
#include <rte_malloc.h>
+#include "eal_private.h"
+
#define RTE_SERVICE_NUM_MAX 64
#define SERVICE_F_REGISTERED (1 << 0)
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 7cbf82d..aeedf39 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -4,7 +4,6 @@ DPDK_2.0 {
__rte_panic;
eal_parse_sysfs_value;
eal_timer_source;
- lcore_config;
per_lcore__lcore_id;
per_lcore__rte_errno;
rte_calloc;
diff --git a/lib/librte_eal/windows/eal/eal_thread.c b/lib/librte_eal/windows/eal/eal_thread.c
index 906502f..0591d4c 100644
--- a/lib/librte_eal/windows/eal/eal_thread.c
+++ b/lib/librte_eal/windows/eal/eal_thread.c
@@ -12,6 +12,7 @@
#include <rte_common.h>
#include <eal_thread.h>
+#include "eal_private.h"
RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 02/12] eal: remove deprecated CPU flags check function
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 13:56 ` 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
` (10 subsequent siblings)
12 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, ktraynor, Neil Horman,
John McNamara, Marko Kovacevic
Remove rte_cpu_check_supported as announced previously.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
doc/guides/rel_notes/deprecation.rst | 3 ---
doc/guides/rel_notes/release_19_11.rst | 3 +++
lib/librte_eal/common/eal_common_cpuflags.c | 11 -----------
lib/librte_eal/common/include/generic/rte_cpuflags.h | 9 ---------
lib/librte_eal/rte_eal_version.map | 1 -
5 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index e4a33e0..50ac348 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,9 +34,6 @@ Deprecation Notices
+ ``rte_eal_devargs_type_count``
-* eal: The ``rte_cpu_check_supported`` function has been deprecated since
- v17.08 and will be removed.
-
* eal: The ``rte_malloc_virt2phy`` function has been deprecated and replaced
by ``rte_malloc_virt2iova`` since v17.11 and will be removed.
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index d2c4e9e..0520bc9 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -314,6 +314,9 @@ ABI Changes
* eal: made the ``lcore_config`` struct and global symbol private.
+* eal: removed the ``rte_cpu_check_supported`` function, replaced by
+ ``rte_cpu_is_supported`` since dpdk v17.08.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_eal/common/eal_common_cpuflags.c b/lib/librte_eal/common/eal_common_cpuflags.c
index 3a055f7..dc5f75d 100644
--- a/lib/librte_eal/common/eal_common_cpuflags.c
+++ b/lib/librte_eal/common/eal_common_cpuflags.c
@@ -7,17 +7,6 @@
#include <rte_common.h>
#include <rte_cpuflags.h>
-/**
- * Checks if the machine is adequate for running the binary. If it is not, the
- * program exits with status 1.
- */
-void
-rte_cpu_check_supported(void)
-{
- if (!rte_cpu_is_supported())
- exit(1);
-}
-
int
rte_cpu_is_supported(void)
{
diff --git a/lib/librte_eal/common/include/generic/rte_cpuflags.h b/lib/librte_eal/common/include/generic/rte_cpuflags.h
index 156ea00..872f0eb 100644
--- a/lib/librte_eal/common/include/generic/rte_cpuflags.h
+++ b/lib/librte_eal/common/include/generic/rte_cpuflags.h
@@ -49,15 +49,6 @@ rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature);
/**
* This function checks that the currently used CPU supports the CPU features
* that were specified at compile time. It is called automatically within the
- * EAL, so does not need to be used by applications.
- */
-__rte_deprecated
-void
-rte_cpu_check_supported(void);
-
-/**
- * This function checks that the currently used CPU supports the CPU features
- * that were specified at compile time. It is called automatically within the
* EAL, so does not need to be used by applications. This version returns a
* result so that decisions may be made (for instance, graceful shutdowns).
*/
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index aeedf39..0887549 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -8,7 +8,6 @@ DPDK_2.0 {
per_lcore__rte_errno;
rte_calloc;
rte_calloc_socket;
- rte_cpu_check_supported;
rte_cpu_get_flag_enabled;
rte_cycles_vmware_tsc_map;
rte_delay_us;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 03/12] eal: remove deprecated malloc virt2phys function
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 13:56 ` [dpdk-dev] [PATCH v3 02/12] eal: remove deprecated CPU flags check function David Marchand
@ 2019-10-25 13:56 ` David Marchand
2019-10-25 15:22 ` Burakov, Anatoly
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 04/12] mem: hide internal heap header David Marchand
` (9 subsequent siblings)
12 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, ktraynor, Neil Horman,
John McNamara, Marko Kovacevic
Remove rte_malloc_virt2phy as announced previously.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
doc/guides/rel_notes/deprecation.rst | 3 ---
doc/guides/rel_notes/release_19_11.rst | 3 +++
lib/librte_eal/common/include/rte_malloc.h | 7 -------
3 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 50ac348..bbd5863 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,9 +34,6 @@ Deprecation Notices
+ ``rte_eal_devargs_type_count``
-* eal: The ``rte_malloc_virt2phy`` function has been deprecated and replaced
- by ``rte_malloc_virt2iova`` since v17.11 and will be removed.
-
* vfio: removal of ``rte_vfio_dma_map`` and ``rte_vfio_dma_unmap`` APIs which
have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
functions. The due date for the removal targets DPDK 20.02.
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 0520bc9..b3f7509 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -317,6 +317,9 @@ ABI Changes
* eal: removed the ``rte_cpu_check_supported`` function, replaced by
``rte_cpu_is_supported`` since dpdk v17.08.
+* eal: removed the ``rte_malloc_virt2phy`` function, replaced by
+ ``rte_malloc_virt2iova`` since v17.11.
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h
index 3593fb4..42ca051 100644
--- a/lib/librte_eal/common/include/rte_malloc.h
+++ b/lib/librte_eal/common/include/rte_malloc.h
@@ -553,13 +553,6 @@ rte_malloc_set_limit(const char *type, size_t max);
rte_iova_t
rte_malloc_virt2iova(const void *addr);
-__rte_deprecated
-static inline phys_addr_t
-rte_malloc_virt2phy(const void *addr)
-{
- return rte_malloc_virt2iova(addr);
-}
-
#ifdef __cplusplus
}
#endif
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 04/12] mem: hide internal heap header
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (2 preceding siblings ...)
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 03/12] eal: remove deprecated malloc virt2phys function David Marchand
@ 2019-10-25 13:56 ` David Marchand
2019-10-25 15:23 ` Burakov, Anatoly
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 05/12] net/bonding: use non deprecated PCI API David Marchand
` (8 subsequent siblings)
12 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, ktraynor, Wenzhuo Lu,
Jingjing Wu, Bernard Iremonger
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
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 05/12] net/bonding: use non deprecated PCI API
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (3 preceding siblings ...)
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 04/12] mem: hide internal heap header David Marchand
@ 2019-10-25 13:56 ` David Marchand
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 06/12] pci: remove deprecated functions David Marchand
` (7 subsequent siblings)
12 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, ktraynor, stable, Chas Williams
rte_eal_compare_pci_addr has been deprecated since v17.11.
Convert to rte_pci_addr_cmp.
Fixes: c848b518bbc7 ("net/bonding: support bifurcated driver in eal")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/net/bonding/rte_eth_bond_args.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
index f298ea0..bfe03c3 100644
--- a/drivers/net/bonding/rte_eth_bond_args.c
+++ b/drivers/net/bonding/rte_eth_bond_args.c
@@ -60,11 +60,10 @@ find_port_id_by_dev_name(const char *name)
static inline int
bond_pci_addr_cmp(const struct rte_device *dev, const void *_pci_addr)
{
- struct rte_pci_device *pdev;
+ const struct rte_pci_device *pdev = RTE_DEV_TO_PCI_CONST(dev);
const struct rte_pci_addr *paddr = _pci_addr;
- pdev = RTE_DEV_TO_PCI(*(struct rte_device **)(void *)&dev);
- return rte_eal_compare_pci_addr(&pdev->addr, paddr);
+ return rte_pci_addr_cmp(&pdev->addr, paddr);
}
/**
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 06/12] pci: remove deprecated functions
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (4 preceding siblings ...)
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 ` David Marchand
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 07/12] log: add log stream accessor David Marchand
` (6 subsequent siblings)
12 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, ktraynor, Neil Horman,
John McNamara, Marko Kovacevic, Gaetan Rivet
Those functions have been deprecated since 17.11 and have 1:1
replacement.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
doc/guides/rel_notes/deprecation.rst | 7 -----
doc/guides/rel_notes/release_19_11.rst | 6 +++++
lib/librte_pci/rte_pci.c | 19 --------------
lib/librte_pci/rte_pci.h | 47 ----------------------------------
lib/librte_pci/rte_pci_version.map | 3 ---
5 files changed, 6 insertions(+), 76 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index bbd5863..cf7744e 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -38,13 +38,6 @@ Deprecation Notices
have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
functions. The due date for the removal targets DPDK 20.02.
-* pci: Several exposed functions are misnamed.
- The following functions are deprecated starting from v17.11 and are replaced:
-
- - ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse``
- - ``eal_parse_pci_DomBDF`` replaced by ``rte_pci_addr_parse``
- - ``rte_eal_compare_pci_addr`` replaced by ``rte_pci_addr_cmp``
-
* dpaa2: removal of ``rte_dpaa2_memsegs`` structure which has been replaced
by a pa-va search library. This structure was earlier being used for holding
memory segments used by dpaa2 driver for faster pa->va translation. This
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index b3f7509..8d88257 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -320,6 +320,12 @@ ABI Changes
* eal: removed the ``rte_malloc_virt2phy`` function, replaced by
``rte_malloc_virt2iova`` since v17.11.
+* pci: removed the following deprecated functions since dpdk:
+
+ - ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse``
+ - ``eal_parse_pci_DomBDF`` replaced by ``rte_pci_addr_parse``
+ - ``rte_eal_compare_pci_addr`` replaced by ``rte_pci_addr_cmp``
+
Shared Library Versions
-----------------------
diff --git a/lib/librte_pci/rte_pci.c b/lib/librte_pci/rte_pci.c
index f400178..a753cf3 100644
--- a/lib/librte_pci/rte_pci.c
+++ b/lib/librte_pci/rte_pci.c
@@ -87,18 +87,6 @@ pci_dbdf_parse(const char *input, struct rte_pci_addr *dev_addr)
return 0;
}
-int
-eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr)
-{
- return pci_bdf_parse(input, dev_addr);
-}
-
-int
-eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr)
-{
- return pci_dbdf_parse(input, dev_addr);
-}
-
void
rte_pci_device_name(const struct rte_pci_addr *addr,
char *output, size_t size)
@@ -110,13 +98,6 @@ rte_pci_device_name(const struct rte_pci_addr *addr,
}
int
-rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,
- const struct rte_pci_addr *addr2)
-{
- return rte_pci_addr_cmp(addr, addr2);
-}
-
-int
rte_pci_addr_cmp(const struct rte_pci_addr *addr,
const struct rte_pci_addr *addr2)
{
diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h
index eaa9d07..c878914 100644
--- a/lib/librte_pci/rte_pci.h
+++ b/lib/librte_pci/rte_pci.h
@@ -106,37 +106,6 @@ struct mapped_pci_resource {
TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);
/**
- * @deprecated
- * Utility function to produce a PCI Bus-Device-Function value
- * given a string representation. Assumes that the BDF is provided without
- * a domain prefix (i.e. domain returned is always 0)
- *
- * @param input
- * The input string to be parsed. Should have the format XX:XX.X
- * @param dev_addr
- * The PCI Bus-Device-Function address to be returned.
- * Domain will always be returned as 0
- * @return
- * 0 on success, negative on error.
- */
-int eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr);
-
-/**
- * @deprecated
- * Utility function to produce a PCI Bus-Device-Function value
- * given a string representation. Assumes that the BDF is provided including
- * a domain prefix.
- *
- * @param input
- * The input string to be parsed. Should have the format XXXX:XX:XX.X
- * @param dev_addr
- * The PCI Bus-Device-Function address to be returned
- * @return
- * 0 on success, negative on error.
- */
-int eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr);
-
-/**
* Utility function to write a pci device name, this device name can later be
* used to retrieve the corresponding rte_pci_addr using eal_parse_pci_*
* BDF helpers.
@@ -152,22 +121,6 @@ void rte_pci_device_name(const struct rte_pci_addr *addr,
char *output, size_t size);
/**
- * @deprecated
- * Utility function to compare two PCI device addresses.
- *
- * @param addr
- * The PCI Bus-Device-Function address to compare
- * @param addr2
- * The PCI Bus-Device-Function address to compare
- * @return
- * 0 on equal PCI address.
- * Positive on addr is greater than addr2.
- * Negative on addr is less than addr2, or error.
- */
-int rte_eal_compare_pci_addr(const struct rte_pci_addr *addr,
- const struct rte_pci_addr *addr2);
-
-/**
* Utility function to compare two PCI device addresses.
*
* @param addr
diff --git a/lib/librte_pci/rte_pci_version.map b/lib/librte_pci/rte_pci_version.map
index c028027..03790cb 100644
--- a/lib/librte_pci/rte_pci_version.map
+++ b/lib/librte_pci/rte_pci_version.map
@@ -1,11 +1,8 @@
DPDK_17.11 {
global:
- eal_parse_pci_BDF;
- eal_parse_pci_DomBDF;
pci_map_resource;
pci_unmap_resource;
- rte_eal_compare_pci_addr;
rte_pci_addr_cmp;
rte_pci_addr_parse;
rte_pci_device_name;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 07/12] log: add log stream accessor
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (5 preceding siblings ...)
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 06/12] pci: remove deprecated functions David Marchand
@ 2019-10-25 13:56 ` 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
` (5 subsequent siblings)
12 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, ktraynor, John Griffin,
Fiona Trahe, Deepak Kumar Jain
Define an accessor so that users can write their debug message to the
same stream than the rte_log infrastructure.
Use it in the qat infrastructure.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
Changelog since v1:
- use ternary operator,
---
drivers/common/qat/qat_logs.c | 3 +--
drivers/common/qat/qat_logs.h | 3 +--
lib/librte_eal/common/eal_common_log.c | 33 +++++++++++++++++++--------------
lib/librte_eal/common/include/rte_log.h | 13 +++++++++++++
lib/librte_eal/rte_eal_version.map | 3 +++
5 files changed, 37 insertions(+), 18 deletions(-)
diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
index 7a86170..f97aba1 100644
--- a/drivers/common/qat/qat_logs.c
+++ b/drivers/common/qat/qat_logs.c
@@ -19,8 +19,7 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
if (level > (uint32_t)(rte_log_get_level(logtype)))
return 0;
- rte_hexdump(rte_logs.file == NULL ? stderr : rte_logs.file,
- title, buf, len);
+ rte_hexdump(rte_log_get_stream(), title, buf, len);
return 0;
}
diff --git a/drivers/common/qat/qat_logs.h b/drivers/common/qat/qat_logs.h
index 4baea12..2e4d394 100644
--- a/drivers/common/qat/qat_logs.h
+++ b/drivers/common/qat/qat_logs.h
@@ -24,8 +24,7 @@ extern int qat_dp_logtype;
*
* Dump out the message buffer in a special hex dump output format with
* characters printed for each line of 16 hex values. The message will be sent
- * to the stream defined by rte_logs.file or to stderr in case of rte_logs.file
- * is undefined.
+ * to the stream used by the rte_log infrastructure.
*/
int
qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index 4f6f227..e0a7bef 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -71,6 +71,24 @@ rte_openlog_stream(FILE *f)
return 0;
}
+FILE *
+rte_log_get_stream(void)
+{
+ FILE *f = rte_logs.file;
+
+ if (f == NULL) {
+ /*
+ * Grab the current value of stderr here, rather than
+ * just initializing default_log_stream to stderr. This
+ * ensures that we will always use the current value
+ * of stderr, even if the application closes and
+ * reopens it.
+ */
+ return default_log_stream ? : stderr;
+ }
+ return f;
+}
+
/* Set global log level */
void
rte_log_set_global_level(uint32_t level)
@@ -396,21 +414,8 @@ rte_log_dump(FILE *f)
int
rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
{
+ FILE *f = rte_log_get_stream();
int ret;
- FILE *f = rte_logs.file;
- if (f == NULL) {
- f = default_log_stream;
- if (f == NULL) {
- /*
- * Grab the current value of stderr here, rather than
- * just initializing default_log_stream to stderr. This
- * ensures that we will always use the current value
- * of stderr, even if the application closes and
- * reopens it.
- */
- f = stderr;
- }
- }
if (level > rte_logs.level)
return 0;
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index cbb4184..1bb0e66 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -102,6 +102,19 @@ extern struct rte_logs rte_logs;
int rte_openlog_stream(FILE *f);
/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Retrieve the stream used by the logging system (see rte_openlog_stream()
+ * to change it).
+ *
+ * @return
+ * Pointer to the stream.
+ */
+__rte_experimental
+FILE *rte_log_get_stream(void);
+
+/**
* Set the global log level.
*
* After this call, logs with a level lower or equal than the level
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 0887549..6d7e0e4 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -417,4 +417,7 @@ EXPERIMENTAL {
rte_mcfg_timer_lock;
rte_mcfg_timer_unlock;
rte_rand_max;
+
+ # added in 19.11
+ rte_log_get_stream;
};
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 08/12] test/mem: remove dependency on EAL internals
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (6 preceding siblings ...)
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 07/12] log: add log stream accessor David Marchand
@ 2019-10-25 13:56 ` 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
` (4 subsequent siblings)
12 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, ktraynor
Rather than dereference the mem_config internal structure, we can rely
on the rte_memzone_walk API and count memzones.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test/test_memzone.c | 50 ++++++++++++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 19 deletions(-)
diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c
index 7edfd06..4d87444 100644
--- a/app/test/test_memzone.c
+++ b/app/test/test_memzone.c
@@ -13,12 +13,12 @@
#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_eal.h>
+#include <rte_lcore.h>
#include <rte_common.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
#include <rte_malloc.h>
#include "../../lib/librte_eal/common/malloc_elem.h"
-#include "../../lib/librte_eal/common/eal_memcfg.h"
#include "test.h"
@@ -927,6 +927,16 @@ test_memzone_free(void)
return 0;
}
+static int test_memzones_left;
+static int memzone_walk_cnt;
+static void memzone_walk_clb(const struct rte_memzone *mz,
+ void *arg __rte_unused)
+{
+ memzone_walk_cnt++;
+ if (!strncmp(TEST_MEMZONE_NAME(""), mz->name, RTE_MEMZONE_NAMESIZE))
+ test_memzones_left++;
+}
+
static int
test_memzone_basic(void)
{
@@ -936,8 +946,12 @@ test_memzone_basic(void)
const struct rte_memzone *memzone4;
const struct rte_memzone *mz;
int memzone_cnt_after, memzone_cnt_expected;
- int memzone_cnt_before =
- rte_eal_get_configuration()->mem_config->memzones.count;
+ int memzone_cnt_before;
+
+ memzone_walk_cnt = 0;
+ test_memzones_left = 0;
+ rte_memzone_walk(memzone_walk_clb, NULL);
+ memzone_cnt_before = memzone_walk_cnt;
memzone1 = rte_memzone_reserve(TEST_MEMZONE_NAME("testzone1"), 100,
SOCKET_ID_ANY, 0);
@@ -960,8 +974,10 @@ test_memzone_basic(void)
(memzone1 != NULL) + (memzone2 != NULL) +
(memzone3 != NULL) + (memzone4 != NULL);
- memzone_cnt_after =
- rte_eal_get_configuration()->mem_config->memzones.count;
+ memzone_walk_cnt = 0;
+ test_memzones_left = 0;
+ rte_memzone_walk(memzone_walk_clb, NULL);
+ memzone_cnt_after = memzone_walk_cnt;
if (memzone_cnt_after != memzone_cnt_expected)
return -1;
@@ -1039,30 +1055,26 @@ test_memzone_basic(void)
return -1;
}
- memzone_cnt_after =
- rte_eal_get_configuration()->mem_config->memzones.count;
+ memzone_walk_cnt = 0;
+ test_memzones_left = 0;
+ rte_memzone_walk(memzone_walk_clb, NULL);
+ memzone_cnt_after = memzone_walk_cnt;
if (memzone_cnt_after != memzone_cnt_before)
return -1;
return 0;
}
-static int test_memzones_left;
-static int memzone_walk_cnt;
-static void memzone_walk_clb(const struct rte_memzone *mz,
- void *arg __rte_unused)
-{
- memzone_walk_cnt++;
- if (!strncmp(TEST_MEMZONE_NAME(""), mz->name, RTE_MEMZONE_NAMESIZE))
- test_memzones_left++;
-}
-
static int
test_memzone(void)
{
/* take note of how many memzones were allocated before running */
- int memzone_cnt =
- rte_eal_get_configuration()->mem_config->memzones.count;
+ int memzone_cnt;
+
+ memzone_walk_cnt = 0;
+ test_memzones_left = 0;
+ rte_memzone_walk(memzone_walk_clb, NULL);
+ memzone_cnt = memzone_walk_cnt;
printf("test basic memzone API\n");
if (test_memzone_basic() < 0)
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 09/12] eal: deinline lcore APIs
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (7 preceding siblings ...)
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 08/12] test/mem: remove dependency on EAL internals David Marchand
@ 2019-10-25 13:56 ` David Marchand
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 10/12] eal: factorize lcore role code David Marchand
` (3 subsequent siblings)
12 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, ktraynor
Those functions are used to setup or take control decisions.
Move them into the EAL common code and put them directly in the stable
ABI.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_eal/common/eal_common_lcore.c | 38 ++++++++++++++++++++++++++++
lib/librte_eal/common/include/rte_lcore.h | 41 +++----------------------------
lib/librte_eal/rte_eal_version.map | 10 ++++++++
3 files changed, 52 insertions(+), 37 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
index 59a2fd1..b01a210 100644
--- a/lib/librte_eal/common/eal_common_lcore.c
+++ b/lib/librte_eal/common/eal_common_lcore.c
@@ -16,6 +16,16 @@
#include "eal_private.h"
#include "eal_thread.h"
+unsigned int rte_get_master_lcore(void)
+{
+ return rte_eal_get_configuration()->master_lcore;
+}
+
+unsigned int rte_lcore_count(void)
+{
+ return rte_eal_get_configuration()->lcore_count;
+}
+
int rte_lcore_index(int lcore_id)
{
if (unlikely(lcore_id >= RTE_MAX_LCORE))
@@ -43,6 +53,34 @@ rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id)
return lcore_config[lcore_id].cpuset;
}
+int rte_lcore_is_enabled(unsigned int lcore_id)
+{
+ struct rte_config *cfg = rte_eal_get_configuration();
+
+ if (lcore_id >= RTE_MAX_LCORE)
+ return 0;
+ return cfg->lcore_role[lcore_id] == ROLE_RTE;
+}
+
+unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
+{
+ i++;
+ if (wrap)
+ i %= RTE_MAX_LCORE;
+
+ while (i < RTE_MAX_LCORE) {
+ if (!rte_lcore_is_enabled(i) ||
+ (skip_master && (i == rte_get_master_lcore()))) {
+ i++;
+ if (wrap)
+ i %= RTE_MAX_LCORE;
+ continue;
+ }
+ break;
+ }
+ return i;
+}
+
unsigned int
rte_lcore_to_socket_id(unsigned int lcore_id)
{
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index 0c68391..ea40c25 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -93,11 +93,7 @@ rte_lcore_id(void)
* @return
* the id of the master lcore
*/
-static inline unsigned
-rte_get_master_lcore(void)
-{
- return rte_eal_get_configuration()->master_lcore;
-}
+unsigned int rte_get_master_lcore(void);
/**
* Return the number of execution units (lcores) on the system.
@@ -105,12 +101,7 @@ rte_get_master_lcore(void)
* @return
* the number of execution units (lcores) on the system.
*/
-static inline unsigned
-rte_lcore_count(void)
-{
- const struct rte_config *cfg = rte_eal_get_configuration();
- return cfg->lcore_count;
-}
+unsigned int rte_lcore_count(void);
/**
* Return the index of the lcore starting from zero.
@@ -215,14 +206,7 @@ rte_lcore_cpuset(unsigned int lcore_id);
* @return
* True if the given lcore is enabled; false otherwise.
*/
-static inline int
-rte_lcore_is_enabled(unsigned int lcore_id)
-{
- struct rte_config *cfg = rte_eal_get_configuration();
- if (lcore_id >= RTE_MAX_LCORE)
- return 0;
- return cfg->lcore_role[lcore_id] == ROLE_RTE;
-}
+int rte_lcore_is_enabled(unsigned int lcore_id);
/**
* Get the next enabled lcore ID.
@@ -237,25 +221,8 @@ rte_lcore_is_enabled(unsigned int lcore_id)
* @return
* The next lcore_id or RTE_MAX_LCORE if not found.
*/
-static inline unsigned int
-rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
-{
- i++;
- if (wrap)
- i %= RTE_MAX_LCORE;
+unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap);
- while (i < RTE_MAX_LCORE) {
- if (!rte_lcore_is_enabled(i) ||
- (skip_master && (i == rte_get_master_lcore()))) {
- i++;
- if (wrap)
- i %= RTE_MAX_LCORE;
- continue;
- }
- break;
- }
- return i;
-}
/**
* Macro to browse all running lcores.
*/
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 6d7e0e4..d88649e 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -310,6 +310,16 @@ DPDK_19.08 {
} DPDK_19.05;
+DPDK_19.11 {
+ global:
+
+ rte_get_master_lcore;
+ rte_get_next_lcore;
+ rte_lcore_count;
+ rte_lcore_is_enabled;
+
+} DPDK_19.08;
+
EXPERIMENTAL {
global:
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 10/12] eal: factorize lcore role code
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (8 preceding siblings ...)
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 09/12] eal: deinline lcore APIs David Marchand
@ 2019-10-25 13:56 ` David Marchand
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 11/12] eal: make the global configuration private David Marchand
` (2 subsequent siblings)
12 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev; +Cc: stephen, anatoly.burakov, thomas, ktraynor, Bruce Richardson
This code belongs to the lcore API, move the prototype to the right
header, then factorize the code into the common code.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_eal/common/eal_common_lcore.c | 10 ++++++++++
lib/librte_eal/common/include/rte_eal.h | 11 -----------
lib/librte_eal/common/include/rte_lcore.h | 10 ++++++++++
lib/librte_eal/freebsd/eal/eal.c | 7 -------
lib/librte_eal/linux/eal/eal.c | 7 -------
5 files changed, 20 insertions(+), 25 deletions(-)
diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
index b01a210..39efade 100644
--- a/lib/librte_eal/common/eal_common_lcore.c
+++ b/lib/librte_eal/common/eal_common_lcore.c
@@ -53,6 +53,16 @@ rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id)
return lcore_config[lcore_id].cpuset;
}
+enum rte_lcore_role_t
+rte_eal_lcore_role(unsigned int lcore_id)
+{
+ struct rte_config *cfg = rte_eal_get_configuration();
+
+ if (lcore_id >= RTE_MAX_LCORE)
+ return ROLE_OFF;
+ return cfg->lcore_role[lcore_id];
+}
+
int rte_lcore_is_enabled(unsigned int lcore_id)
{
struct rte_config *cfg = rte_eal_get_configuration();
diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index b7cf912..ea3c9df 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -84,17 +84,6 @@ struct rte_config {
struct rte_config *rte_eal_get_configuration(void);
/**
- * Get a lcore's role.
- *
- * @param lcore_id
- * The identifier of the lcore.
- * @return
- * The role of the lcore.
- */
-enum rte_lcore_role_t rte_eal_lcore_role(unsigned lcore_id);
-
-
-/**
* Get the process type in a multi-process setup
*
* @return
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index ea40c25..555b692 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -70,6 +70,16 @@ RTE_DECLARE_PER_LCORE(unsigned, _lcore_id); /**< Per thread "lcore id". */
RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
/**
+ * Get a lcore's role.
+ *
+ * @param lcore_id
+ * The identifier of the lcore, which MUST be between 0 and RTE_MAX_LCORE-1.
+ * @return
+ * The role of the lcore.
+ */
+enum rte_lcore_role_t rte_eal_lcore_role(unsigned int lcore_id);
+
+/**
* Return the Application thread ID of the execution unit.
*
* Note: in most cases the lcore id returned here will also correspond
diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c
index 14e1713..f70d88c 100644
--- a/lib/librte_eal/freebsd/eal/eal.c
+++ b/lib/librte_eal/freebsd/eal/eal.c
@@ -955,13 +955,6 @@ rte_eal_cleanup(void)
return 0;
}
-/* get core role */
-enum rte_lcore_role_t
-rte_eal_lcore_role(unsigned lcore_id)
-{
- return rte_config.lcore_role[lcore_id];
-}
-
enum rte_proc_type_t
rte_eal_process_type(void)
{
diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index aae67b2..e242a8b 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -1308,13 +1308,6 @@ rte_eal_cleanup(void)
return 0;
}
-/* get core role */
-enum rte_lcore_role_t
-rte_eal_lcore_role(unsigned lcore_id)
-{
- return rte_config.lcore_role[lcore_id];
-}
-
enum rte_proc_type_t
rte_eal_process_type(void)
{
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 11/12] eal: make the global configuration private
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (9 preceding siblings ...)
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 10/12] eal: factorize lcore role code David Marchand
@ 2019-10-25 13:56 ` 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-26 19:18 ` [dpdk-dev] [PATCH v3 00/12] EAL and PCI ABI changes for 19.11 David Marchand
12 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, ktraynor, John McNamara,
Marko Kovacevic
Now that all elements of the rte_config structure have (deinlined)
accessors, we can hide it.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
doc/guides/rel_notes/release_19_11.rst | 3 +++
lib/librte_eal/common/eal_common_mcfg.c | 1 +
lib/librte_eal/common/eal_private.h | 32 ++++++++++++++++++++++++++++++++
lib/librte_eal/common/include/rte_eal.h | 32 --------------------------------
lib/librte_eal/common/malloc_heap.c | 1 +
lib/librte_eal/common/rte_malloc.c | 1 +
lib/librte_eal/rte_eal_version.map | 1 -
7 files changed, 38 insertions(+), 33 deletions(-)
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 8d88257..393fb61 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -320,6 +320,9 @@ ABI Changes
* eal: removed the ``rte_malloc_virt2phy`` function, replaced by
``rte_malloc_virt2iova`` since v17.11.
+* eal: made the ``rte_config`` struct and ``rte_eal_get_configuration``
+ function private.
+
* pci: removed the following deprecated functions since dpdk:
- ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse``
diff --git a/lib/librte_eal/common/eal_common_mcfg.c b/lib/librte_eal/common/eal_common_mcfg.c
index 0665494..0cf9a62 100644
--- a/lib/librte_eal/common/eal_common_mcfg.c
+++ b/lib/librte_eal/common/eal_common_mcfg.c
@@ -8,6 +8,7 @@
#include "eal_internal_cfg.h"
#include "eal_memcfg.h"
+#include "eal_private.h"
void
eal_mcfg_complete(void)
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 0e4b033..52eea9a 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -37,6 +37,38 @@ struct lcore_config {
extern struct lcore_config lcore_config[RTE_MAX_LCORE];
/**
+ * The global RTE configuration structure.
+ */
+struct rte_config {
+ uint32_t master_lcore; /**< Id of the master lcore */
+ uint32_t lcore_count; /**< Number of available logical cores. */
+ uint32_t numa_node_count; /**< Number of detected NUMA nodes. */
+ uint32_t numa_nodes[RTE_MAX_NUMA_NODES]; /**< List of detected NUMA nodes. */
+ uint32_t service_lcore_count;/**< Number of available service cores. */
+ enum rte_lcore_role_t lcore_role[RTE_MAX_LCORE]; /**< State of cores. */
+
+ /** Primary or secondary configuration */
+ enum rte_proc_type_t process_type;
+
+ /** PA or VA mapping mode */
+ enum rte_iova_mode iova_mode;
+
+ /**
+ * Pointer to memory configuration, which may be shared across multiple
+ * DPDK instances
+ */
+ struct rte_mem_config *mem_config;
+} __attribute__((__packed__));
+
+/**
+ * Get the global configuration structure.
+ *
+ * @return
+ * A pointer to the global configuration structure.
+ */
+struct rte_config *rte_eal_get_configuration(void);
+
+/**
* Initialize the memzone subsystem (private to eal).
*
* @return
diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index ea3c9df..2f9ed29 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -52,38 +52,6 @@ enum rte_proc_type_t {
};
/**
- * The global RTE configuration structure.
- */
-struct rte_config {
- uint32_t master_lcore; /**< Id of the master lcore */
- uint32_t lcore_count; /**< Number of available logical cores. */
- uint32_t numa_node_count; /**< Number of detected NUMA nodes. */
- uint32_t numa_nodes[RTE_MAX_NUMA_NODES]; /**< List of detected NUMA nodes. */
- uint32_t service_lcore_count;/**< Number of available service cores. */
- enum rte_lcore_role_t lcore_role[RTE_MAX_LCORE]; /**< State of cores. */
-
- /** Primary or secondary configuration */
- enum rte_proc_type_t process_type;
-
- /** PA or VA mapping mode */
- enum rte_iova_mode iova_mode;
-
- /**
- * Pointer to memory configuration, which may be shared across multiple
- * DPDK instances
- */
- struct rte_mem_config *mem_config;
-} __attribute__((__packed__));
-
-/**
- * Get the global configuration structure.
- *
- * @return
- * A pointer to the global configuration structure.
- */
-struct rte_config *rte_eal_get_configuration(void);
-
-/**
* Get the process type in a multi-process setup
*
* @return
diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c
index 634ca21..842eb9d 100644
--- a/lib/librte_eal/common/malloc_heap.c
+++ b/lib/librte_eal/common/malloc_heap.c
@@ -27,6 +27,7 @@
#include "eal_internal_cfg.h"
#include "eal_memalloc.h"
#include "eal_memcfg.h"
+#include "eal_private.h"
#include "malloc_elem.h"
#include "malloc_heap.h"
#include "malloc_mp.h"
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index fecd9a9..044d3a9 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -26,6 +26,7 @@
#include "malloc_heap.h"
#include "eal_memalloc.h"
#include "eal_memcfg.h"
+#include "eal_private.h"
/* Free the memory space back to heap */
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index d88649e..3478d3b 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -17,7 +17,6 @@ DPDK_2.0 {
rte_dump_tailq;
rte_eal_alarm_cancel;
rte_eal_alarm_set;
- rte_eal_get_configuration;
rte_eal_get_lcore_state;
rte_eal_get_physmem_size;
rte_eal_has_hugepages;
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* [dpdk-dev] [PATCH v3 12/12] doc: announce global logs struct removal from ABI
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (10 preceding siblings ...)
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 11/12] eal: make the global configuration private David Marchand
@ 2019-10-25 13:56 ` David Marchand
2019-10-25 15:30 ` Burakov, Anatoly
` (2 more replies)
2019-10-26 19:18 ` [dpdk-dev] [PATCH v3 00/12] EAL and PCI ABI changes for 19.11 David Marchand
12 siblings, 3 replies; 60+ messages in thread
From: David Marchand @ 2019-10-25 13:56 UTC (permalink / raw)
To: dev
Cc: stephen, anatoly.burakov, thomas, ktraynor, Neil Horman,
John McNamara, Marko Kovacevic
New accessor has been introduced to provide the hidden information.
This symbol can now be kept internal.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
doc/guides/rel_notes/deprecation.rst | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index cf7744e..3aa1634 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -34,6 +34,10 @@ Deprecation Notices
+ ``rte_eal_devargs_type_count``
+* eal: The ``rte_logs`` struct and global symbol will be made private to
+ remove it from the externally visible ABI and allow it to be updated in the
+ future.
+
* vfio: removal of ``rte_vfio_dma_map`` and ``rte_vfio_dma_unmap`` APIs which
have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
functions. The due date for the removal targets DPDK 20.02.
--
1.8.3.1
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 01/12] eal: make lcore config private
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
0 siblings, 0 replies; 60+ messages in thread
From: Burakov, Anatoly @ 2019-10-25 15:18 UTC (permalink / raw)
To: David Marchand, dev
Cc: stephen, thomas, ktraynor, Neil Horman, John McNamara,
Marko Kovacevic, Harry van Haaren, Harini Ramakrishnan,
Omar Cardona, Anand Rawat, Ranjit Menon
On 25-Oct-19 2:56 PM, David Marchand wrote:
> From: Stephen Hemminger <stephen@networkplumber.org>
>
> The internal structure of lcore_config does not need to be part of
> visible API/ABI. Make it private to EAL.
>
> Rearrange the structure so it takes less memory (and cache footprint).
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 02/12] eal: remove deprecated CPU flags check function
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
0 siblings, 0 replies; 60+ messages in thread
From: Burakov, Anatoly @ 2019-10-25 15:20 UTC (permalink / raw)
To: David Marchand, dev
Cc: stephen, thomas, ktraynor, Neil Horman, John McNamara, Marko Kovacevic
On 25-Oct-19 2:56 PM, David Marchand wrote:
> Remove rte_cpu_check_supported as announced previously.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 03/12] eal: remove deprecated malloc virt2phys function
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
0 siblings, 0 replies; 60+ messages in thread
From: Burakov, Anatoly @ 2019-10-25 15:22 UTC (permalink / raw)
To: David Marchand, dev
Cc: stephen, thomas, ktraynor, Neil Horman, John McNamara, Marko Kovacevic
On 25-Oct-19 2:56 PM, David Marchand wrote:
> Remove rte_malloc_virt2phy as announced previously.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 04/12] mem: hide internal heap header
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 04/12] mem: hide internal heap header David Marchand
@ 2019-10-25 15:23 ` Burakov, Anatoly
0 siblings, 0 replies; 60+ messages in thread
From: Burakov, Anatoly @ 2019-10-25 15:23 UTC (permalink / raw)
To: David Marchand, dev
Cc: stephen, thomas, ktraynor, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger
On 25-Oct-19 2:56 PM, David Marchand wrote:
> 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>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 08/12] test/mem: remove dependency on EAL internals
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
0 siblings, 0 replies; 60+ messages in thread
From: Burakov, Anatoly @ 2019-10-25 15:24 UTC (permalink / raw)
To: David Marchand, dev; +Cc: stephen, thomas, ktraynor
On 25-Oct-19 2:56 PM, David Marchand wrote:
> Rather than dereference the mem_config internal structure, we can rely
> on the rte_memzone_walk API and count memzones.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 11/12] eal: make the global configuration private
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
0 siblings, 0 replies; 60+ messages in thread
From: Burakov, Anatoly @ 2019-10-25 15:27 UTC (permalink / raw)
To: David Marchand, dev
Cc: stephen, thomas, ktraynor, John McNamara, Marko Kovacevic
On 25-Oct-19 2:56 PM, David Marchand wrote:
> Now that all elements of the rte_config structure have (deinlined)
> accessors, we can hide it.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> ---
Can't think of any uses covered by this struct that aren't already
covered by our API's, so...
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 12/12] doc: announce global logs struct removal from ABI
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
2 siblings, 0 replies; 60+ messages in thread
From: Burakov, Anatoly @ 2019-10-25 15:30 UTC (permalink / raw)
To: David Marchand, dev
Cc: stephen, thomas, ktraynor, Neil Horman, John McNamara, Marko Kovacevic
On 25-Oct-19 2:56 PM, David Marchand wrote:
> New accessor has been introduced to provide the hidden information.
> This symbol can now be kept internal.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> doc/guides/rel_notes/deprecation.rst | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index cf7744e..3aa1634 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -34,6 +34,10 @@ Deprecation Notices
>
> + ``rte_eal_devargs_type_count``
>
> +* eal: The ``rte_logs`` struct and global symbol will be made private to
> + remove it from the externally visible ABI and allow it to be updated in the
> + future.
> +
> * vfio: removal of ``rte_vfio_dma_map`` and ``rte_vfio_dma_unmap`` APIs which
> have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
> functions. The due date for the removal targets DPDK 20.02.
>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 12/12] doc: announce global logs struct removal from ABI
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
2 siblings, 0 replies; 60+ messages in thread
From: Thomas Monjalon @ 2019-10-25 15:33 UTC (permalink / raw)
To: David Marchand
Cc: dev, stephen, anatoly.burakov, ktraynor, Neil Horman,
John McNamara, Marko Kovacevic, arybchenko, ferruh.yigit
25/10/2019 15:56, David Marchand:
> New accessor has been introduced to provide the hidden information.
> This symbol can now be kept internal.
[..]
> +* eal: The ``rte_logs`` struct and global symbol will be made private to
> + remove it from the externally visible ABI and allow it to be updated in the
> + future.
Acked-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 07/12] log: add log stream accessor
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
0 siblings, 0 replies; 60+ messages in thread
From: Kevin Traynor @ 2019-10-25 19:05 UTC (permalink / raw)
To: David Marchand, dev
Cc: stephen, anatoly.burakov, thomas, John Griffin, Fiona Trahe,
Deepak Kumar Jain
On 25/10/2019 14:56, David Marchand wrote:
> Define an accessor so that users can write their debug message to the
> same stream than the rte_log infrastructure.
> Use it in the qat infrastructure.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> Changelog since v1:
> - use ternary operator,
>
> ---
> drivers/common/qat/qat_logs.c | 3 +--
> drivers/common/qat/qat_logs.h | 3 +--
> lib/librte_eal/common/eal_common_log.c | 33 +++++++++++++++++++--------------
> lib/librte_eal/common/include/rte_log.h | 13 +++++++++++++
> lib/librte_eal/rte_eal_version.map | 3 +++
> 5 files changed, 37 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c
> index 7a86170..f97aba1 100644
> --- a/drivers/common/qat/qat_logs.c
> +++ b/drivers/common/qat/qat_logs.c
> @@ -19,8 +19,7 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
> if (level > (uint32_t)(rte_log_get_level(logtype)))
> return 0;
>
> - rte_hexdump(rte_logs.file == NULL ? stderr : rte_logs.file,
> - title, buf, len);
> + rte_hexdump(rte_log_get_stream(), title, buf, len);
> return 0;
> }
>
> diff --git a/drivers/common/qat/qat_logs.h b/drivers/common/qat/qat_logs.h
> index 4baea12..2e4d394 100644
> --- a/drivers/common/qat/qat_logs.h
> +++ b/drivers/common/qat/qat_logs.h
> @@ -24,8 +24,7 @@ extern int qat_dp_logtype;
> *
> * Dump out the message buffer in a special hex dump output format with
> * characters printed for each line of 16 hex values. The message will be sent
> - * to the stream defined by rte_logs.file or to stderr in case of rte_logs.file
> - * is undefined.
> + * to the stream used by the rte_log infrastructure.
> */
> int
> qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title,
> diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
> index 4f6f227..e0a7bef 100644
> --- a/lib/librte_eal/common/eal_common_log.c
> +++ b/lib/librte_eal/common/eal_common_log.c
> @@ -71,6 +71,24 @@ rte_openlog_stream(FILE *f)
> return 0;
> }
>
> +FILE *
> +rte_log_get_stream(void)
> +{
> + FILE *f = rte_logs.file;
> +
> + if (f == NULL) {
> + /*
> + * Grab the current value of stderr here, rather than
> + * just initializing default_log_stream to stderr. This
> + * ensures that we will always use the current value
> + * of stderr, even if the application closes and
> + * reopens it.
> + */
> + return default_log_stream ? : stderr;
> + }
> + return f;
> +}
> +
> /* Set global log level */
> void
> rte_log_set_global_level(uint32_t level)
> @@ -396,21 +414,8 @@ rte_log_dump(FILE *f)
> int
> rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
> {
> + FILE *f = rte_log_get_stream();
> int ret;
> - FILE *f = rte_logs.file;
> - if (f == NULL) {
> - f = default_log_stream;
> - if (f == NULL) {
> - /*
> - * Grab the current value of stderr here, rather than
> - * just initializing default_log_stream to stderr. This
> - * ensures that we will always use the current value
> - * of stderr, even if the application closes and
> - * reopens it.
> - */
> - f = stderr;
> - }
> - }
>
> if (level > rte_logs.level)
> return 0;
> diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
> index cbb4184..1bb0e66 100644
> --- a/lib/librte_eal/common/include/rte_log.h
> +++ b/lib/librte_eal/common/include/rte_log.h
> @@ -102,6 +102,19 @@ extern struct rte_logs rte_logs;
> int rte_openlog_stream(FILE *f);
>
> /**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice
> + *
> + * Retrieve the stream used by the logging system (see rte_openlog_stream()
> + * to change it).
> + *
> + * @return
> + * Pointer to the stream.
> + */
> +__rte_experimental
> +FILE *rte_log_get_stream(void);
> +
> +/**
> * Set the global log level.
> *
> * After this call, logs with a level lower or equal than the level
> diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
> index 0887549..6d7e0e4 100644
> --- a/lib/librte_eal/rte_eal_version.map
> +++ b/lib/librte_eal/rte_eal_version.map
> @@ -417,4 +417,7 @@ EXPERIMENTAL {
> rte_mcfg_timer_lock;
> rte_mcfg_timer_unlock;
> rte_rand_max;
> +
> + # added in 19.11
> + rte_log_get_stream;
> };
>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 12/12] doc: announce global logs struct removal from ABI
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
2 siblings, 1 reply; 60+ messages in thread
From: Kevin Traynor @ 2019-10-26 18:14 UTC (permalink / raw)
To: David Marchand, dev
Cc: stephen, anatoly.burakov, thomas, Neil Horman, John McNamara,
Marko Kovacevic
On 25/10/2019 14:56, David Marchand wrote:
> New accessor has been introduced to provide the hidden information.
> This symbol can now be kept internal.
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> doc/guides/rel_notes/deprecation.rst | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index cf7744e..3aa1634 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -34,6 +34,10 @@ Deprecation Notices
>
> + ``rte_eal_devargs_type_count``
>
> +* eal: The ``rte_logs`` struct and global symbol will be made private to
> + remove it from the externally visible ABI and allow it to be updated in the
> + future.
> +
> * vfio: removal of ``rte_vfio_dma_map`` and ``rte_vfio_dma_unmap`` APIs which
> have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
> functions. The due date for the removal targets DPDK 20.02.
>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 12/12] doc: announce global logs struct removal from ABI
2019-10-26 18:14 ` Kevin Traynor
@ 2019-10-26 18:48 ` David Marchand
0 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-26 18:48 UTC (permalink / raw)
To: Kevin Traynor
Cc: dev, Stephen Hemminger, Burakov, Anatoly, Thomas Monjalon,
Neil Horman, John McNamara, Marko Kovacevic
On Sat, Oct 26, 2019 at 8:14 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> On 25/10/2019 14:56, David Marchand wrote:
> > New accessor has been introduced to provide the hidden information.
> > This symbol can now be kept internal.
> > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> > doc/guides/rel_notes/deprecation.rst | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> > index cf7744e..3aa1634 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -34,6 +34,10 @@ Deprecation Notices
> >
> > + ``rte_eal_devargs_type_count``
> >
> > +* eal: The ``rte_logs`` struct and global symbol will be made private to
> > + remove it from the externally visible ABI and allow it to be updated in the
> > + future.
> > +
> > * vfio: removal of ``rte_vfio_dma_map`` and ``rte_vfio_dma_unmap`` APIs which
> > have been replaced with ``rte_dev_dma_map`` and ``rte_dev_dma_unmap``
> > functions. The due date for the removal targets DPDK 20.02.
> >
>
> Acked-by: Kevin Traynor <ktraynor@redhat.com>
Thanks Kevin for catching that contrail vrouter relies on rte_logs.
Something to study by 20.11.
--
David Marchand
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 00/12] EAL and PCI ABI changes for 19.11
2019-10-25 13:55 ` [dpdk-dev] [PATCH v3 " David Marchand
` (11 preceding siblings ...)
2019-10-25 13:56 ` [dpdk-dev] [PATCH v3 12/12] doc: announce global logs struct removal from ABI David Marchand
@ 2019-10-26 19:18 ` David Marchand
2019-10-27 6:26 ` David Marchand
12 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-26 19:18 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Burakov, Anatoly, Thomas Monjalon, Kevin Traynor
On Fri, Oct 25, 2019 at 3:56 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> Let's prepare for the ABI freeze.
>
> The first patches are about changes that had been announced before.
>
> The malloc_heap structure from the memory subsystem can be hidden.
> The PCI library had some forgotten deprecated APIs that are removed with
> this series.
>
> rte_logs could be hidden, but I left it exposed for now.
> I added an accessor to rte_logs.file, and added a deprecation notice
> announcing its removal from the public ABI.
>
> Changelog since v2:
> - dropped patch 8 and added a deprecation notice on rte_logs instead,
>
> Changelog since v1:
> - I went a step further, hiding rte_config after de-inlining non critical
> functions
>
>
> --
> David Marchand
>
> David Marchand (11):
> eal: remove deprecated CPU flags check function
> eal: remove deprecated malloc virt2phys function
> mem: hide internal heap header
> net/bonding: use non deprecated PCI API
> pci: remove deprecated functions
> log: add log stream accessor
> test/mem: remove dependency on EAL internals
> eal: deinline lcore APIs
> eal: factorize lcore role code
> eal: make the global configuration private
> doc: announce global logs struct removal from ABI
>
> Stephen Hemminger (1):
> eal: make lcore config private
Thanks for the reviews/acks.
Series applied.
--
David Marchand
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 00/12] EAL and PCI ABI changes for 19.11
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
0 siblings, 1 reply; 60+ messages in thread
From: David Marchand @ 2019-10-27 6:26 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Burakov, Anatoly, Thomas Monjalon, Kevin Traynor
On Sat, Oct 26, 2019 at 9:18 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Fri, Oct 25, 2019 at 3:56 PM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > Let's prepare for the ABI freeze.
> >
> > The first patches are about changes that had been announced before.
> >
> > The malloc_heap structure from the memory subsystem can be hidden.
> > The PCI library had some forgotten deprecated APIs that are removed with
> > this series.
> >
> > rte_logs could be hidden, but I left it exposed for now.
> > I added an accessor to rte_logs.file, and added a deprecation notice
> > announcing its removal from the public ABI.
> >
> > Changelog since v2:
> > - dropped patch 8 and added a deprecation notice on rte_logs instead,
> >
> > Changelog since v1:
> > - I went a step further, hiding rte_config after de-inlining non critical
> > functions
> >
> >
> > --
> > David Marchand
> >
> > David Marchand (11):
> > eal: remove deprecated CPU flags check function
> > eal: remove deprecated malloc virt2phys function
> > mem: hide internal heap header
> > net/bonding: use non deprecated PCI API
> > pci: remove deprecated functions
> > log: add log stream accessor
> > test/mem: remove dependency on EAL internals
> > eal: deinline lcore APIs
> > eal: factorize lcore role code
> > eal: make the global configuration private
> > doc: announce global logs struct removal from ABI
> >
> > Stephen Hemminger (1):
> > eal: make lcore config private
>
> Thanks for the reviews/acks.
> Series applied.
I held back before pushing as I caught an issue on ethdev abiver.
Since the ABI changes are not in place, we should still bump it and
the same would apply on eal and pci libraries in this series.
Waiting a bit if anyone is looking at this, else I will go with this for rc1.
Thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 60+ messages in thread
* Re: [dpdk-dev] [PATCH v3 00/12] EAL and PCI ABI changes for 19.11
2019-10-27 6:26 ` David Marchand
@ 2019-10-27 9:56 ` David Marchand
0 siblings, 0 replies; 60+ messages in thread
From: David Marchand @ 2019-10-27 9:56 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Burakov, Anatoly, Thomas Monjalon, Kevin Traynor
On Sun, Oct 27, 2019 at 7:26 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Sat, Oct 26, 2019 at 9:18 PM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > On Fri, Oct 25, 2019 at 3:56 PM David Marchand
> > <david.marchand@redhat.com> wrote:
> > >
> > > Let's prepare for the ABI freeze.
> > >
> > > The first patches are about changes that had been announced before.
> > >
> > > The malloc_heap structure from the memory subsystem can be hidden.
> > > The PCI library had some forgotten deprecated APIs that are removed with
> > > this series.
> > >
> > > rte_logs could be hidden, but I left it exposed for now.
> > > I added an accessor to rte_logs.file, and added a deprecation notice
> > > announcing its removal from the public ABI.
> > >
> > > Changelog since v2:
> > > - dropped patch 8 and added a deprecation notice on rte_logs instead,
> > >
> > > Changelog since v1:
> > > - I went a step further, hiding rte_config after de-inlining non critical
> > > functions
> > >
> > >
> > > --
> > > David Marchand
> > >
> > > David Marchand (11):
> > > eal: remove deprecated CPU flags check function
> > > eal: remove deprecated malloc virt2phys function
> > > mem: hide internal heap header
> > > net/bonding: use non deprecated PCI API
> > > pci: remove deprecated functions
> > > log: add log stream accessor
> > > test/mem: remove dependency on EAL internals
> > > eal: deinline lcore APIs
> > > eal: factorize lcore role code
> > > eal: make the global configuration private
> > > doc: announce global logs struct removal from ABI
> > >
> > > Stephen Hemminger (1):
> > > eal: make lcore config private
> >
> > Thanks for the reviews/acks.
> > Series applied.
>
> I held back before pushing as I caught an issue on ethdev abiver.
> Since the ABI changes are not in place, we should still bump it and
> the same would apply on eal and pci libraries in this series.
Discussed with Thomas, updated the release notes and bumped the eal
and pci libraries.
And pushed to master.
--
David Marchand
^ permalink raw reply [flat|nested] 60+ messages in thread
end of thread, other threads:[~2019-10-27 9:56 UTC | newest]
Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [dpdk-dev] [PATCH v3 04/12] mem: hide internal heap header David Marchand
2019-10-25 15:23 ` 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
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).