From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 372BDA046B for ; Mon, 19 Aug 2019 13:42:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2AE7F1BEB6; Mon, 19 Aug 2019 13:42:28 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id DDCB81BEC8 for ; Mon, 19 Aug 2019 13:42:25 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45CCD309174E; Mon, 19 Aug 2019 11:42:25 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-32.brq.redhat.com [10.40.204.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 792C81001B28; Mon, 19 Aug 2019 11:42:22 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Hemant Agrawal , Sachin Saxena , Jerin Jacob , Nithin Dabilpuram , Vamsi Attunuru , John Griffin , Fiona Trahe , Deepak Kumar Jain Date: Mon, 19 Aug 2019 13:41:53 +0200 Message-Id: <1566214919-32250-6-git-send-email-david.marchand@redhat.com> In-Reply-To: <1566214919-32250-1-git-send-email-david.marchand@redhat.com> References: <1566214919-32250-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 19 Aug 2019 11:42:25 +0000 (UTC) Subject: [dpdk-dev] [PATCH 05/11] drivers/common: use new logtype wrapper 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" Make use of the newly introduced wrapper. Signed-off-by: David Marchand --- drivers/common/dpaax/dpaax_iova_table.c | 8 ++--- drivers/common/octeontx/octeontx_mbox.c | 8 ++--- drivers/common/octeontx2/otx2_common.c | 62 ++++++++++++--------------------- drivers/common/qat/qat_logs.c | 18 ++++------ 4 files changed, 32 insertions(+), 64 deletions(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c index ae0af09..9bc2a4b 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -457,9 +457,5 @@ dpaax_handle_memevents(void) dpaax_memevent_cb, NULL); } -RTE_INIT(dpaax_log) -{ - dpaax_logger = rte_log_register("pmd.common.dpaax"); - if (dpaax_logger >= 0) - rte_log_set_level(dpaax_logger, RTE_LOG_ERR); -} +RTE_LOG_REGISTER(dpaax_logger, "pmd.common.dpaax", + RTE_LOG_ERR, RTE_LOGTYPE_PMD); diff --git a/drivers/common/octeontx/octeontx_mbox.c b/drivers/common/octeontx/octeontx_mbox.c index 880f8a4..825a5ac 100644 --- a/drivers/common/octeontx/octeontx_mbox.c +++ b/drivers/common/octeontx/octeontx_mbox.c @@ -61,12 +61,8 @@ struct mbox_ram_hdr { int octeontx_logtype_mbox; -RTE_INIT(otx_init_log) -{ - octeontx_logtype_mbox = rte_log_register("pmd.octeontx.mbox"); - if (octeontx_logtype_mbox >= 0) - rte_log_set_level(octeontx_logtype_mbox, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(octeontx_logtype_mbox, "pmd.octeontx.mbox", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); static inline void mbox_msgcpy(volatile uint8_t *d, volatile const uint8_t *s, uint16_t size) diff --git a/drivers/common/octeontx2/otx2_common.c b/drivers/common/octeontx2/otx2_common.c index 7e45366..a7d5387 100644 --- a/drivers/common/octeontx2/otx2_common.c +++ b/drivers/common/octeontx2/otx2_common.c @@ -206,43 +206,25 @@ int otx2_logtype_tim; */ int otx2_logtype_dpi; -RTE_INIT(otx2_log_init); -static void -otx2_log_init(void) -{ - otx2_logtype_base = rte_log_register("pmd.octeontx2.base"); - if (otx2_logtype_base >= 0) - rte_log_set_level(otx2_logtype_base, RTE_LOG_NOTICE); - - otx2_logtype_mbox = rte_log_register("pmd.octeontx2.mbox"); - if (otx2_logtype_mbox >= 0) - rte_log_set_level(otx2_logtype_mbox, RTE_LOG_NOTICE); - - otx2_logtype_npa = rte_log_register("pmd.mempool.octeontx2"); - if (otx2_logtype_npa >= 0) - rte_log_set_level(otx2_logtype_npa, RTE_LOG_NOTICE); - - otx2_logtype_nix = rte_log_register("pmd.net.octeontx2"); - if (otx2_logtype_nix >= 0) - rte_log_set_level(otx2_logtype_nix, RTE_LOG_NOTICE); - - otx2_logtype_npc = rte_log_register("pmd.net.octeontx2.flow"); - if (otx2_logtype_npc >= 0) - rte_log_set_level(otx2_logtype_npc, RTE_LOG_NOTICE); - - otx2_logtype_tm = rte_log_register("pmd.net.octeontx2.tm"); - if (otx2_logtype_tm >= 0) - rte_log_set_level(otx2_logtype_tm, RTE_LOG_NOTICE); - - otx2_logtype_sso = rte_log_register("pmd.event.octeontx2"); - if (otx2_logtype_sso >= 0) - rte_log_set_level(otx2_logtype_sso, RTE_LOG_NOTICE); - - otx2_logtype_tim = rte_log_register("pmd.event.octeontx2.timer"); - if (otx2_logtype_tim >= 0) - rte_log_set_level(otx2_logtype_tim, RTE_LOG_NOTICE); - - otx2_logtype_dpi = rte_log_register("pmd.raw.octeontx2.dpi"); - if (otx2_logtype_dpi >= 0) - rte_log_set_level(otx2_logtype_dpi, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(otx2_logtype_base, "pmd.octeontx2.base", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); +RTE_LOG_REGISTER(otx2_logtype_mbox, "pmd.octeontx2.mbox", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); + +RTE_LOG_REGISTER(otx2_logtype_npa, "pmd.mempool.octeontx2", + RTE_LOG_NOTICE, RTE_LOGTYPE_MEMPOOL); + +RTE_LOG_REGISTER(otx2_logtype_nix, "pmd.net.octeontx2", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); +RTE_LOG_REGISTER(otx2_logtype_npc, "pmd.net.octeontx2.flow", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); +RTE_LOG_REGISTER(otx2_logtype_tm, "pmd.net.octeontx2.tm", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); + +RTE_LOG_REGISTER(otx2_logtype_sso, "pmd.event.octeontx2", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); +RTE_LOG_REGISTER(otx2_logtype_tim, "pmd.event.octeontx2.timer", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); + +RTE_LOG_REGISTER(otx2_logtype_dpi, "pmd.raw.octeontx2.dpi", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c index 7a86170..a8d1e84 100644 --- a/drivers/common/qat/qat_logs.c +++ b/drivers/common/qat/qat_logs.c @@ -24,15 +24,9 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title, return 0; } -RTE_INIT(qat_pci_init_log) -{ - /* Non-data-path logging for pci device and all services */ - qat_gen_logtype = rte_log_register("pmd.qat_general"); - if (qat_gen_logtype >= 0) - rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE); - - /* data-path logging for all services */ - qat_dp_logtype = rte_log_register("pmd.qat_dp"); - if (qat_dp_logtype >= 0) - rte_log_set_level(qat_dp_logtype, RTE_LOG_NOTICE); -} +/* Non-data-path logging for pci device and all services */ +RTE_LOG_REGISTER(qat_gen_logtype, "pmd.qat_general", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); +/* data-path logging for all services */ +RTE_LOG_REGISTER(qat_dp_logtype, "pmd.qat_dp", + RTE_LOG_NOTICE, RTE_LOGTYPE_PMD); -- 1.8.3.1