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 9EB14A0350; Wed, 1 Jul 2020 05:59:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 837241BED5; Wed, 1 Jul 2020 05:59:58 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 8FFEB1BEC0 for ; Wed, 1 Jul 2020 05:59:56 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0613tWfX001239; Tue, 30 Jun 2020 20:59:55 -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=HNcfPAnhUUdlj74K0K9dvC1INFj9AZw9YU5KdYegGjk=; b=eLSaShF+TitmTjhUaTB/qK8iQpG77QbXuku3TilrfNZvKy8CCaoQHFWbtQ/EUWZgKX3G t1hGS2cl5BWsHjYTyrQO6fpTkpztf7y0Lo6aaukZI/mM0/4vPpkQ7SSpdGshN/fhE3Fj 01Fk8tP/vwsKI6WlBqDcRiRh+yRT3uMOTY7aFJUPRJd4lvG7oS7ca7Y3tdJAVVZj45+F /hOiia4Hizepow4tx/aDW2fzyptfwg6w8v/AnahHFr67s9aTRM+Zoi+KucsyHc3+sOVm yWizw8CaGTeU9uVrc8/OwRD9OuN4RKt4AsgoaMcFH4tRjwLlUwyjr4QBlxzyphOWnpT7 8A== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 31y0ws2wmk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 20:59:55 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 20:59:54 -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 20:59:54 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 6A2653F703F; Tue, 30 Jun 2020 20:59:51 -0700 (PDT) From: To: , Hemant Agrawal , Sachin Saxena , Harman Kalra CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 09:28:33 +0530 Message-ID: <20200701035840.4028056-7-jerinj@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701035840.4028056-1-jerinj@marvell.com> References: <20200617063047.1555518-1-jerinj@marvell.com> <20200701035840.4028056-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_01:2020-07-01, 2020-06-30 signatures=0 Subject: [dpdk-dev] [PATCH v2 06/13] drivers/mempool: 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: Sachin Saxena Acked-by: Adam Dybkowski --- drivers/mempool/dpaa/dpaa_mempool.c | 10 ++-------- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 10 +--------- drivers/mempool/octeontx/octeontx_fpavf.c | 10 +--------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c index 451e2d5d5..8d1da8028 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -36,7 +36,8 @@ struct dpaa_memseg_list rte_dpaa_memsegs = TAILQ_HEAD_INITIALIZER(rte_dpaa_memsegs); struct dpaa_bp_info *rte_dpaa_bpid_info; -int dpaa_logtype_mempool; + +RTE_LOG_REGISTER(dpaa_logtype_mempool, mempool.dpaa, NOTICE); static int dpaa_mbuf_create_pool(struct rte_mempool *mp) @@ -357,10 +358,3 @@ static const struct rte_mempool_ops dpaa_mpool_ops = { }; MEMPOOL_REGISTER_OPS(dpaa_mpool_ops); - -RTE_INIT(dpaa_mp_init_log) -{ - dpaa_logtype_mempool = rte_log_register("mempool.dpaa"); - if (dpaa_logtype_mempool >= 0) - rte_log_set_level(dpaa_logtype_mempool, RTE_LOG_NOTICE); -} diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index fa9b53e64..97ce08d78 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -36,9 +36,6 @@ struct dpaa2_bp_info *rte_dpaa2_bpid_info; static struct dpaa2_bp_list *h_bp_list; -/* Dynamic logging identified for mempool */ -int dpaa2_logtype_mempool; - static int rte_hw_mbuf_create_pool(struct rte_mempool *mp) { @@ -454,9 +451,4 @@ static const struct rte_mempool_ops dpaa2_mpool_ops = { MEMPOOL_REGISTER_OPS(dpaa2_mpool_ops); -RTE_INIT(dpaa2_mempool_init_log) -{ - dpaa2_logtype_mempool = rte_log_register("mempool.dpaa2"); - if (dpaa2_logtype_mempool >= 0) - rte_log_set_level(dpaa2_logtype_mempool, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(dpaa2_logtype_mempool, mempool.dpaa2, NOTICE); diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c index 0ff234913..339da7824 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.c +++ b/drivers/mempool/octeontx/octeontx_fpavf.c @@ -105,15 +105,7 @@ struct octeontx_fpadev { static struct octeontx_fpadev fpadev; -int octeontx_logtype_fpavf; -int octeontx_logtype_fpavf_mbox; - -RTE_INIT(otx_pool_init_log) -{ - octeontx_logtype_fpavf = rte_log_register("pmd.mempool.octeontx"); - if (octeontx_logtype_fpavf >= 0) - rte_log_set_level(octeontx_logtype_fpavf, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(octeontx_logtype_fpavf, pmd.mempool.octeontx, NOTICE); /* lock is taken by caller */ static int -- 2.27.0