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 B7A87A0350; Wed, 1 Jul 2020 08:49:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A2C051BFF7; Wed, 1 Jul 2020 08:49:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 9D4671BFE9 for ; Wed, 1 Jul 2020 08:49:32 +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 0616eN5Y000790; Tue, 30 Jun 2020 23:49:31 -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=Wl+pkcddwQFrSuTGKaV8VwEzj0Zzz9mqkb0uFh7Q7VQ=; b=CvI7s07OW6oLvV6eGukrL+RFYZy93LOft5sLraMXMN5aE/nkavHG+5PMRndTcYPc4kQE 3oreSzUpMQF6qNP5h+9xxchUle+5sUX/NX/ykGiyQopwHJQBo3yvwhlR+9skTUtR/dW9 /FkV+Bj7S8onophz06K4FviBMLjnh1R45Mo4bR9sTqksnMUpeP162zynD0EXq0TOBpBo 0b22Z1JCU58CZSuPkccNipcKrPaLO/5f4acLxGSuzSy/8KWCrxJkX5BBVKZ3/gODstcG AfcNuYrFEEuSqMqNSJfaWcIHqCyI1KUiQZg0sWxhRqga56G7I+wj6q/NO62o95D7QdZw nA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 31x5mnq86c-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:49:31 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 23:49:30 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 30 Jun 2020 23:49:31 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 05B813F703F; Tue, 30 Jun 2020 23:49:26 -0700 (PDT) From: To: , Hemant Agrawal , Nipun Gupta , Jerin Jacob , Pavan Nikhilesh , Liang Ma , Peter Mccarthy , Harry van Haaren CC: , , , , Date: Wed, 1 Jul 2020 12:18:22 +0530 Message-ID: <20200701064828.4097247-8-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 07/13] drivers/event: 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 --- drivers/event/dpaa/dpaa_eventdev.c | 8 +------- drivers/event/dpaa2/dpaa2_eventdev.c | 10 +--------- drivers/event/octeontx/ssovf_evdev.c | 8 +------- drivers/event/octeontx/timvf_evdev.c | 9 +-------- drivers/event/opdl/opdl_evdev.c | 8 +------- drivers/event/opdl/opdl_ring.c | 2 -- drivers/event/sw/sw_evdev.c | 11 +---------- 7 files changed, 6 insertions(+), 50 deletions(-) diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c index 5a018d487..e78728b7e 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -46,7 +46,7 @@ * Eventqueue = Channel Instance * 1 Eventdev can have N Eventqueue */ -int dpaa_logtype_eventdev; +RTE_LOG_REGISTER(dpaa_logtype_eventdev, pmd.event.dpaa, NOTICE); #define DISABLE_INTR_MODE "disable_intr" @@ -1069,9 +1069,3 @@ static struct rte_vdev_driver vdev_eventdev_dpaa_pmd = { RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DPAA_PMD, vdev_eventdev_dpaa_pmd); RTE_PMD_REGISTER_PARAM_STRING(EVENTDEV_NAME_DPAA_PMD, DISABLE_INTR_MODE "="); -RTE_INIT(dpaa_event_init_log) -{ - dpaa_logtype_eventdev = rte_log_register("pmd.event.dpaa"); - if (dpaa_logtype_eventdev >= 0) - rte_log_set_level(dpaa_logtype_eventdev, RTE_LOG_NOTICE); -} diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index a196ad4c6..a545baf34 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -48,8 +48,6 @@ * Soft Event Flow is DPCI Instance */ -/* Dynamic logging identified for mempool */ -int dpaa2_logtype_event; #define DPAA2_EV_TX_RETRY_COUNT 10000 static uint16_t @@ -1205,10 +1203,4 @@ static struct rte_vdev_driver vdev_eventdev_dpaa2_pmd = { }; RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DPAA2_PMD, vdev_eventdev_dpaa2_pmd); - -RTE_INIT(dpaa2_eventdev_init_log) -{ - dpaa2_logtype_event = rte_log_register("pmd.event.dpaa2"); - if (dpaa2_logtype_event >= 0) - rte_log_set_level(dpaa2_logtype_event, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(dpaa2_logtype_event, pmd.event.dpaa2, NOTICE); diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 1b1a5d939..4fc4e8f7e 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -20,15 +20,9 @@ #include "ssovf_evdev.h" #include "timvf_evdev.h" -int otx_logtype_ssovf; static uint8_t timvf_enable_stats; -RTE_INIT(otx_ssovf_init_log) -{ - otx_logtype_ssovf = rte_log_register("pmd.event.octeontx"); - if (otx_logtype_ssovf >= 0) - rte_log_set_level(otx_logtype_ssovf, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(otx_logtype_ssovf, pmd.event.octeontx, NOTICE); /* SSOPF Mailbox messages */ diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c index caa129087..c61aacacc 100644 --- a/drivers/event/octeontx/timvf_evdev.c +++ b/drivers/event/octeontx/timvf_evdev.c @@ -4,14 +4,7 @@ #include "timvf_evdev.h" -int otx_logtype_timvf; - -RTE_INIT(otx_timvf_init_log) -{ - otx_logtype_timvf = rte_log_register("pmd.event.octeontx.timer"); - if (otx_logtype_timvf >= 0) - rte_log_set_level(otx_logtype_timvf, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(otx_logtype_timvf, pmd.event.octeontx.timer, NOTICE); struct __rte_packed timvf_mbox_dev_info { uint64_t ring_active[4]; diff --git a/drivers/event/opdl/opdl_evdev.c b/drivers/event/opdl/opdl_evdev.c index 3beca8957..9b2f75fe3 100644 --- a/drivers/event/opdl/opdl_evdev.c +++ b/drivers/event/opdl/opdl_evdev.c @@ -754,13 +754,7 @@ static struct rte_vdev_driver evdev_opdl_pmd_drv = { .remove = opdl_remove }; -RTE_INIT(opdl_init_log) -{ - opdl_logtype_driver = rte_log_register("pmd.event.opdl.driver"); - if (opdl_logtype_driver >= 0) - rte_log_set_level(opdl_logtype_driver, RTE_LOG_INFO); -} - +RTE_LOG_REGISTER(opdl_logtype_driver, pmd.event.opdl.driver, INFO); RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_OPDL_PMD, evdev_opdl_pmd_drv); RTE_PMD_REGISTER_PARAM_STRING(event_opdl, NUMA_NODE_ARG "=" diff --git a/drivers/event/opdl/opdl_ring.c b/drivers/event/opdl/opdl_ring.c index c8d19fef5..69392b56b 100644 --- a/drivers/event/opdl/opdl_ring.c +++ b/drivers/event/opdl/opdl_ring.c @@ -31,8 +31,6 @@ #define OPDL_OPA_MASK (0xFF) #define OPDL_OPA_OFFSET (0x38) -int opdl_logtype_driver; - /* Types of dependency between stages */ enum dep_type { DEP_NONE = 0, /* no dependency */ diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index fb8e8bebb..98dae7164 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -1083,13 +1083,4 @@ static struct rte_vdev_driver evdev_sw_pmd_drv = { RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_SW_PMD, evdev_sw_pmd_drv); RTE_PMD_REGISTER_PARAM_STRING(event_sw, NUMA_NODE_ARG "= " SCHED_QUANTA_ARG "=" CREDIT_QUANTA_ARG "="); - -/* declared extern in header, for access from other .c files */ -int eventdev_sw_log_level; - -RTE_INIT(evdev_sw_init_log) -{ - eventdev_sw_log_level = rte_log_register("pmd.event.sw"); - if (eventdev_sw_log_level >= 0) - rte_log_set_level(eventdev_sw_log_level, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(eventdev_sw_log_level, pmd.event.sw, NOTICE); -- 2.27.0