From 0e64ae618e100a22c378ffb80565c093223877a0 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 25 Mar 2021 13:57:07 +0000 Subject: [PATCH] telemetry: move init function to internal header The rte_telemetry_init() function is for EAL use only, so can be moved to the internal header rather than being in the public one. Signed-off-by: Bruce Richardson Acked-by: Ciara Power --- lib/librte_eal/freebsd/eal.c | 2 +- lib/librte_eal/linux/eal.c | 2 +- lib/librte_telemetry/rte_telemetry.h | 32 ---------------------- lib/librte_telemetry/telemetry_internal.h | 33 +++++++++++++++++++++++ 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c index 97ce9976cd..32442e5ba6 100644 --- a/lib/librte_eal/freebsd/eal.c +++ b/lib/librte_eal/freebsd/eal.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include "eal_private.h" #include "eal_thread.h" diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c index f6dd67b6da..abbb537746 100644 --- a/lib/librte_eal/linux/eal.c +++ b/lib/librte_eal/linux/eal.c @@ -49,8 +49,8 @@ #include #include #include -#include +#include #include "eal_private.h" #include "eal_thread.h" #include "eal_internal_cfg.h" diff --git a/lib/librte_telemetry/rte_telemetry.h b/lib/librte_telemetry/rte_telemetry.h index d38894b97a..fd57718c26 100644 --- a/lib/librte_telemetry/rte_telemetry.h +++ b/lib/librte_telemetry/rte_telemetry.h @@ -292,38 +292,6 @@ __rte_experimental int rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help); -#ifdef RTE_HAS_CPUSET - -/** - * @internal - * Log function type, to allow passing as parameter if necessary - */ -typedef int (*rte_log_fn)(uint32_t level, uint32_t logtype, const char *format, ...); - -/** - * @internal - * Initialize Telemetry. - * - * @param runtime_dir - * The runtime directory of DPDK. - * @param cpuset - * The CPU set to be used for setting the thread affinity. - * @param log_fn - * Function pointer to the rte_log function for logging use - * @param registered_logtype - * The registered log type to use for logging - * - * @return - * 0 on success. - * @return - * -1 on failure. - */ -__rte_internal -int -rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset, - rte_log_fn log_fn, uint32_t registered_logtype); - -#endif /* RTE_HAS_CPUSET */ /** * Get a pointer to a container with memory allocated. The container is to be diff --git a/lib/librte_telemetry/telemetry_internal.h b/lib/librte_telemetry/telemetry_internal.h index ad076b9119..6c52006040 100644 --- a/lib/librte_telemetry/telemetry_internal.h +++ b/lib/librte_telemetry/telemetry_internal.h @@ -84,4 +84,37 @@ rte_telemetry_legacy_register(const char *cmd, enum rte_telemetry_legacy_data_req data_req, telemetry_legacy_cb fn); +#ifdef RTE_HAS_CPUSET + +/** + * @internal + * Log function type, to allow passing as parameter if necessary + */ +typedef int (*rte_log_fn)(uint32_t level, uint32_t logtype, const char *format, ...); + +/** + * @internal + * Initialize Telemetry. + * + * @param runtime_dir + * The runtime directory of DPDK. + * @param cpuset + * The CPU set to be used for setting the thread affinity. + * @param log_fn + * Function pointer to the rte_log function for logging use + * @param registered_logtype + * The registered log type to use for logging + * + * @return + * 0 on success. + * @return + * -1 on failure. + */ +__rte_internal +int +rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset, + rte_log_fn log_fn, uint32_t registered_logtype); + +#endif /* RTE_HAS_CPUSET */ + #endif -- 2.20.1