[dpdk-dev] [EXT] [PATCH v4 4/9] eal: introduce thread uninit helper
Sunil Kumar Kori
skori at marvell.com
Mon Jun 29 10:59:32 CEST 2020
>-----Original Message-----
>From: David Marchand <david.marchand at redhat.com>
>Sent: Friday, June 26, 2020 8:18 PM
>To: dev at dpdk.org
>Cc: jerinjacobk at gmail.com; bruce.richardson at intel.com; mdr at ashroe.eu;
>thomas at monjalon.net; arybchenko at solarflare.com; ktraynor at redhat.com;
>ian.stokes at intel.com; i.maximets at ovn.org; Jerin Jacob Kollanukkaran
><jerinj at marvell.com>; Sunil Kumar Kori <skori at marvell.com>; Neil Horman
><nhorman at tuxdriver.com>; Harini Ramakrishnan
><harini.ramakrishnan at microsoft.com>; Omar Cardona
><ocardona at microsoft.com>; Pallavi Kadam <pallavi.kadam at intel.com>;
>Ranjit Menon <ranjit.menon at intel.com>
>Subject: [EXT] [PATCH v4 4/9] eal: introduce thread uninit helper
>
>External Email
>
>----------------------------------------------------------------------
>This is a preparation step for dynamically unregistering threads.
>
>Since we explicitly allocate a per thread trace buffer in rte_thread_init, add an
>internal helper to free this buffer.
>
>Signed-off-by: David Marchand <david.marchand at redhat.com>
>---
>Note: I preferred renaming the current internal function to free all threads
>trace buffers (new name trace_mem_free()) and reuse the previous name
>(trace_mem_per_thread_free()) when freeing this buffer for a given thread.
>
>Changes since v2:
>- added missing stub for windows tracing support,
>- moved free symbol to exported (experimental) ABI as a counterpart of
> the alloc symbol we already had,
>
>Changes since v1:
>- rebased on master, removed Windows workaround wrt traces support,
>
>---
> lib/librte_eal/common/eal_common_thread.c | 9 ++++
>lib/librte_eal/common/eal_common_trace.c | 51 +++++++++++++++++++----
> lib/librte_eal/common/eal_thread.h | 5 +++
> lib/librte_eal/common/eal_trace.h | 2 +-
> lib/librte_eal/include/rte_trace_point.h | 9 ++++
> lib/librte_eal/rte_eal_version.map | 3 ++
> lib/librte_eal/windows/eal.c | 5 +++
> 7 files changed, 75 insertions(+), 9 deletions(-)
>
>diff --git a/lib/librte_eal/common/eal_common_thread.c
>b/lib/librte_eal/common/eal_common_thread.c
>index afb30236c5..3b30cc99d9 100644
>--- a/lib/librte_eal/common/eal_common_thread.c
>+++ b/lib/librte_eal/common/eal_common_thread.c
>@@ -20,6 +20,7 @@
> #include "eal_internal_cfg.h"
> #include "eal_private.h"
> #include "eal_thread.h"
>+#include "eal_trace.h"
>
> RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY;
>RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; @@ -161,6 +162,14 @@
>rte_thread_init(unsigned int lcore_id, rte_cpuset_t *cpuset)
> __rte_trace_mem_per_thread_alloc();
> }
>
>+void
>+rte_thread_uninit(void)
>+{
Need to check whether trace is enabled or not similar to trace_mem_free().
>+ __rte_trace_mem_per_thread_free();
>+
>+ RTE_PER_LCORE(_lcore_id) = LCORE_ID_ANY; }
>+
> struct rte_thread_ctrl_params {
> void *(*start_routine)(void *);
> void *arg;
[snipped]
>2.23.0
More information about the dev
mailing list