[v2,2/2] rte_log: make rte_logs private

Message ID 20200903230454.30602-3-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series rte_log: make internal structures private |

Checks

Context Check Description
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Sept. 3, 2020, 11:04 p.m. UTC
  As announced in earlier releases, rte_logs can now be made
internal to eal_common_log.

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/rel_notes/deprecation.rst   |  4 ----
 doc/guides/rel_notes/release_20_11.rst |  2 ++
 lib/librte_eal/common/eal_common_log.c | 11 ++++++++---
 lib/librte_eal/include/rte_log.h       | 16 ++--------------
 lib/librte_eal/rte_eal_version.map     |  1 -
 5 files changed, 12 insertions(+), 22 deletions(-)
  

Comments

David Marchand Sept. 14, 2020, 8:13 a.m. UTC | #1
On Fri, Sep 4, 2020 at 1:05 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> As announced in earlier releases, rte_logs can now be made
> internal to eal_common_log.
>
> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Same comment as before, the rte_log_dynamic_type struct fwd
declaration can be removed from the rte_log.h header.
I will fix it while applying.
  
Stephen Hemminger Sept. 14, 2020, 4:37 p.m. UTC | #2
On Mon, 14 Sep 2020 10:13:29 +0200
David Marchand <david.marchand@redhat.com> wrote:

> On Fri, Sep 4, 2020 at 1:05 AM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > As announced in earlier releases, rte_logs can now be made
> > internal to eal_common_log.
> >
> > Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>  
> 
> Same comment as before, the rte_log_dynamic_type struct fwd
> declaration can be removed from the rte_log.h header.
> I will fix it while applying.
> 
> 

Thanks
  
David Marchand Sept. 16, 2020, 4:36 p.m. UTC | #3
On Fri, Sep 4, 2020 at 1:05 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> As announced in earlier releases, rte_logs can now be made
> internal to eal_common_log.
>
> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Series applied with the two changes mentioned in the thread, thanks.
  

Patch

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 345c38d5b630..5445a4f0a061 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -77,10 +77,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 df227a1773b8..e422ac790912 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -84,6 +84,8 @@  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.
 
 ABI Changes
 -----------
diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index 8835c8fff897..a25766de181a 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -17,11 +17,16 @@ 
 
 #include "eal_private.h"
 
-/* global log structure */
-struct rte_logs rte_logs = {
+/** 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 {
diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h
index 7fe0968383db..adc5c83d4250 100644
--- a/lib/librte_eal/include/rte_log.h
+++ b/lib/librte_eal/include/rte_log.h
@@ -29,18 +29,6 @@  extern "C" {
 
 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. */
@@ -273,7 +261,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.
@@ -304,7 +292,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 0564f2fdc7aa..eba868ee0f38 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;