From f484baeeb652be603bd182019d431323cd16ceb1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 3 Sep 2020 16:04:54 -0700 Subject: [PATCH] log: hide internal variable As announced in earlier releases, rte_logs can now be made internal to EAL. Signed-off-by: Stephen Hemminger Acked-by: Andrew Rybchenko Signed-off-by: David Marchand --- doc/guides/rel_notes/deprecation.rst | 4 ---- doc/guides/rel_notes/release_20_11.rst | 3 +++ lib/librte_eal/common/eal_common_log.c | 21 +++++++++++++-------- lib/librte_eal/include/rte_log.h | 18 ++---------------- lib/librte_eal/rte_eal_version.map | 1 - 5 files changed, 18 insertions(+), 29 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 52168f7751..1f888fa90e 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -70,10 +70,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 ``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. - * eal: The ``rte_dev_event`` structure will be made private to the EAL as no public API makes use of it. diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index b729bdf200..81d262cfc4 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -84,6 +84,9 @@ API Changes Also, make sure to start the actual text at the margin. ======================================================= +* eal: The ``rte_logs`` struct and global symbol was made private + and is no longer part of the API. + * mbuf: Removed the unioned field ``refcnt_atomic`` from the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``. The field ``refcnt`` is remaining from the old unions. diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index 8835c8fff8..c5554badb2 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -17,11 +17,21 @@ #include "eal_private.h" -/* global log structure */ -struct rte_logs rte_logs = { +struct rte_log_dynamic_type { + const char *name; + uint32_t loglevel; +}; + +/** The rte_log structure. */ +static 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; +} rte_logs = { .type = ~0, .level = RTE_LOG_DEBUG, - .file = NULL, }; struct rte_eal_opt_loglevel { @@ -53,11 +63,6 @@ struct log_cur_msg { uint32_t logtype; /**< log type - see rte_log.h */ }; -struct rte_log_dynamic_type { - const char *name; - uint32_t loglevel; -}; - /* per core log */ static RTE_DEFINE_PER_LCORE(struct log_cur_msg, log_cur_msg); diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h index 70f8c216c7..173004fd71 100644 --- a/lib/librte_eal/include/rte_log.h +++ b/lib/librte_eal/include/rte_log.h @@ -27,20 +27,6 @@ extern "C" { #include #include -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. */ @@ -270,7 +256,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 loglevel settings. * * The preferred alternative is the RTE_LOG() because it adds the * level and type in the logged string. @@ -301,7 +287,7 @@ 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 + * not, depending on the loglevel settings. A trailing * newline may be added if needed. * * The preferred alternative is the RTE_LOG() because it adds the diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 0564f2fdc7..eba868ee0f 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -115,7 +115,6 @@ DPDK_21 { rte_log_set_level; rte_log_set_level_pattern; rte_log_set_level_regexp; - rte_logs; rte_malloc; rte_malloc_dump_stats; rte_malloc_get_socket_stats; -- 2.20.1