From patchwork Thu Aug 27 22:54:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 76114 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 082FCA04B1; Fri, 28 Aug 2020 00:54:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BBA941BEC4; Fri, 28 Aug 2020 00:54:31 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id D5CD11BEC3 for ; Fri, 28 Aug 2020 00:54:30 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id x143so4653076pfc.4 for ; Thu, 27 Aug 2020 15:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uLwXT07bxwNRGPeFa3nsGQmqoRc9Jy1RuW+xTFWkJvQ=; b=wy+mQp7F0hWlnLrsD/7KSJ6SpkPv12++YHNH0QuzxKzuM8pLx9OHO0c0JfbMylfjQ2 5LffBaODZ9Feqvmv0VR5fObPHMmFHRd96SV1mTeA/4ZYk3NFHLOw7I3sTTc4yvfJxjTk jfZnacHlh2601OB0LbdKiq5y3ZznfMhpl8/GoOqAOjN79QgKRUZuRlu3Gz33KLpiQRqt OoAMqm0sMOI163jlg5xWEUyk1h1zCjdrdz9MOISF/BHb8cuZQEOgVD6D3sn6ZhRMgQV+ GVlpvVrDqyOacrEGq0GTUqESGWFdHgj8R2aomPgVNZzRT3pdt3TkxMc6l99nR0d/muRw FK9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uLwXT07bxwNRGPeFa3nsGQmqoRc9Jy1RuW+xTFWkJvQ=; b=ehB6Cbv94Rjx248QpXe1b8sQ8ZmpDNIE8Hn/eDvFfpLq8eIwLn4leoDse49aoMg45J 8yK/FtY3mrusXOMZwOAxsac3aFHpRbrMl2mQuT3Po/oVMm6/lwuh/po4fPLRYU36c/I6 qunEy+3Mkq7HcdVgzMZE8ks5g9aIHDx3INY7IrN59qPCAqw5AjUeLJ/Cw4bnFu26yf2Y B74uCXKrvOe0v4+ovBU3pJmWDVBGUzlSKYRnIdwmjJjMOF1SmKDMGVvhlIg2oCzuoUOA l2ZSfwJsf1vBLVlgzXME3FK91gGfOPc6dp0MoUXYPy4TrJQDwWszvzebT+F8S1sDY+1D 2bDQ== X-Gm-Message-State: AOAM533/AiFUZY1BZgbBpc7HmRZq+bT5/xYzkGZSZm/bFhuk/0BGsQhE +dl/SVBOJQjPdx/XWBqh1XxPGA== X-Google-Smtp-Source: ABdhPJwqBVK0FZrRFbLBwWlZQAhDnKteihIULtkRS3GOXAShDnT2L6qb4B9P/h1rwWLDFeYGyC6C0A== X-Received: by 2002:a62:1cca:: with SMTP id c193mr11597624pfc.3.1598568869753; Thu, 27 Aug 2020 15:54:29 -0700 (PDT) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id n68sm3703731pfn.145.2020.08.27.15.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 15:54:28 -0700 (PDT) From: Stephen Hemminger To: Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic Cc: dev@dpdk.org, Stephen Hemminger Date: Thu, 27 Aug 2020 15:54:14 -0700 Message-Id: <20200827225414.6623-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] rte_log: make rte_logs private X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" As announced in earlier releases, rte_logs can now be made internal to eal_common_log. Signed-off-by: Stephen Hemminger Acked-by: Andrew Rybchenko --- 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(-) 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 eaf66e4f61de..655c3b39c29e 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. */ @@ -274,7 +262,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. @@ -305,7 +293,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 0b18e2ef85f9..6b0dfdd9667c 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -114,7 +114,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;