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 2629EA0350; Wed, 1 Jul 2020 08:50:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F0E5B1C115; Wed, 1 Jul 2020 08:50:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 30EE01C114 for ; Wed, 1 Jul 2020 08:50:00 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616eNwS000798; Tue, 30 Jun 2020 23:49:59 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=F2h0aL816HguQM/YjcxCEFL9c1Hmh8llOzU9rMxmsDQ=; b=nKBbuABebdOePrWSR9NLzf0Sr9pclPc1zald1xLzN3+aq3vleCwKatmg6TsCqzo9NGVi PcmD4fFFraR0kA8/mT93yczz6BWv0qL4XNP6xhscvqZu13YDNWW3m1S4tuywUAle6DRv Qvyjumj9An7wwHOlfOLjlH9LsZRXwm5Pdpe6E2HubXtKcfrkyisRb2reGRfQhsn2tVoA 03bKkkeIZ1yXISk/AX/8rGN65+yxIukSXeUdI/ZdL4UsJQJ3GJV+UmGX5yeWJ2heWdgu Cd1uR5sb6cIsnOUf6oj8Bmzug0+RWWn1GozmQTUYpLAux4LDGwMrmAd6uvWk5m0xdTXd Iw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 31x5mnq88y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:49:59 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 23:49:57 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 30 Jun 2020 23:49:57 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 2EE133F703F; Tue, 30 Jun 2020 23:49:54 -0700 (PDT) From: To: , Nicolas Chautru CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 12:18:27 +0530 Message-ID: <20200701064828.4097247-13-jerinj@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701064828.4097247-1-jerinj@marvell.com> References: <20200701035840.4028056-1-jerinj@marvell.com> <20200701064828.4097247-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-01_03:2020-07-01, 2020-07-01 signatures=0 Subject: [dpdk-dev] [PATCH v3 12/13] drivers/baseband: use log register macro 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" From: Jerin Jacob Use log register macro to avoid the code duplication in the log registration process. Signed-off-by: Jerin Jacob Acked-by: Adam Dybkowski --- .../baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 17 +++++------------ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 18 +++++------------- drivers/baseband/null/bbdev_null.c | 9 +-------- .../baseband/turbo_sw/bbdev_turbo_software.c | 9 +-------- 4 files changed, 12 insertions(+), 41 deletions(-) diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c index e152b206e..aca0ca999 100644 --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c @@ -23,8 +23,11 @@ #include "fpga_5gnr_fec.h" #include "rte_pmd_fpga_5gnr_fec.h" -/* 5GNR SW PMD logging ID */ -static int fpga_5gnr_fec_logtype; +#ifdef RTE_LIBRTE_BBDEV_DEBUG +RTE_LOG_REGISTER(fpga_5gnr_fec_logtype, pmd.bb.fpga_5gnr_fec, DEBUG); +#else +RTE_LOG_REGISTER(fpga_5gnr_fec_logtype, pmd.bb.fpga_5gnr_fec, NOTICE); +#endif #ifdef RTE_LIBRTE_BBDEV_DEBUG @@ -2175,13 +2178,3 @@ RTE_PMD_REGISTER_PCI(FPGA_5GNR_FEC_VF_DRIVER_NAME, fpga_5gnr_fec_pci_vf_driver); RTE_PMD_REGISTER_PCI_TABLE(FPGA_5GNR_FEC_VF_DRIVER_NAME, pci_id_fpga_5gnr_fec_vf_map); -RTE_INIT(fpga_5gnr_fec_init_log) -{ - fpga_5gnr_fec_logtype = rte_log_register("pmd.bb.fpga_5gnr_fec"); - if (fpga_5gnr_fec_logtype >= 0) -#ifdef RTE_LIBRTE_BBDEV_DEBUG - rte_log_set_level(fpga_5gnr_fec_logtype, RTE_LOG_DEBUG); -#else - rte_log_set_level(fpga_5gnr_fec_logtype, RTE_LOG_NOTICE); -#endif -} diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c index abc5a1bf6..6be9131e7 100644 --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c @@ -22,8 +22,11 @@ #include "fpga_lte_fec.h" -/* Turbo SW PMD logging ID */ -static int fpga_lte_fec_logtype; +#ifdef RTE_LIBRTE_BBDEV_DEBUG +RTE_LOG_REGISTER(fpga_lte_fec_logtype, pmd.bb.fpga_lte_fec, DEBUG); +#else +RTE_LOG_REGISTER(fpga_lte_fec_logtype, pmd.bb.fpga_lte_fec, NOTICE); +#endif /* Helper macro for logging */ #define rte_bbdev_log(level, fmt, ...) \ @@ -2662,14 +2665,3 @@ RTE_PMD_REGISTER_PCI_TABLE(FPGA_LTE_FEC_PF_DRIVER_NAME, RTE_PMD_REGISTER_PCI(FPGA_LTE_FEC_VF_DRIVER_NAME, fpga_lte_fec_pci_vf_driver); RTE_PMD_REGISTER_PCI_TABLE(FPGA_LTE_FEC_VF_DRIVER_NAME, pci_id_fpga_lte_fec_vf_map); - -RTE_INIT(fpga_lte_fec_init_log) -{ - fpga_lte_fec_logtype = rte_log_register("pmd.bb.fpga_lte_fec"); - if (fpga_lte_fec_logtype >= 0) -#ifdef RTE_LIBRTE_BBDEV_DEBUG - rte_log_set_level(fpga_lte_fec_logtype, RTE_LOG_DEBUG); -#else - rte_log_set_level(fpga_lte_fec_logtype, RTE_LOG_NOTICE); -#endif -} diff --git a/drivers/baseband/null/bbdev_null.c b/drivers/baseband/null/bbdev_null.c index 2f2515101..dd11cd31c 100644 --- a/drivers/baseband/null/bbdev_null.c +++ b/drivers/baseband/null/bbdev_null.c @@ -15,8 +15,7 @@ #define DRIVER_NAME baseband_null -/* NULL BBDev logging ID */ -static int bbdev_null_logtype; +RTE_LOG_REGISTER(bbdev_null_logtype, pmd.bb.null, NOTICE); /* Helper macro for logging */ #define rte_bbdev_log(level, fmt, ...) \ @@ -348,9 +347,3 @@ RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, BBDEV_NULL_SOCKET_ID_ARG"="); RTE_PMD_REGISTER_ALIAS(DRIVER_NAME, bbdev_null); -RTE_INIT(null_bbdev_init_log) -{ - bbdev_null_logtype = rte_log_register("pmd.bb.null"); - if (bbdev_null_logtype >= 0) - rte_log_set_level(bbdev_null_logtype, RTE_LOG_NOTICE); -} diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c b/drivers/baseband/turbo_sw/bbdev_turbo_software.c index bb62276b9..daecfd21a 100644 --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c @@ -34,8 +34,7 @@ #define DRIVER_NAME baseband_turbo_sw -/* Turbo SW PMD logging ID */ -static int bbdev_turbo_sw_logtype; +RTE_LOG_REGISTER(bbdev_turbo_sw_logtype, pmd.bb.turbo_sw, NOTICE); /* Helper macro for logging */ #define rte_bbdev_log(level, fmt, ...) \ @@ -1991,9 +1990,3 @@ RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, TURBO_SW_SOCKET_ID_ARG"="); RTE_PMD_REGISTER_ALIAS(DRIVER_NAME, turbo_sw); -RTE_INIT(turbo_sw_bbdev_init_log) -{ - bbdev_turbo_sw_logtype = rte_log_register("pmd.bb.turbo_sw"); - if (bbdev_turbo_sw_logtype >= 0) - rte_log_set_level(bbdev_turbo_sw_logtype, RTE_LOG_NOTICE); -} -- 2.27.0