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 029D7A0350; Wed, 1 Jul 2020 08:49:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 26BB11C02C; Wed, 1 Jul 2020 08:49:37 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C4C9A1C02C for ; Wed, 1 Jul 2020 08:49:34 +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 0616nX6j002691; Tue, 30 Jun 2020 23:49:33 -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=VTWS3IxnzjXMo1ndksMuLfdDocA00/UDB1fJv6ghEOvlDVGSIerNih0O8hORwhAoRdBF 7rIgKXCsqKa2f8Fdmfp6J+yK5MIWZhEq6UQWOTBEulYynFMvkr3+CArdEd7WhkmTb7Hj +KYBfGqO+pktq1tFZlK+E4QYFTok4GVrLOsVIIHSLzoDbbBzkIGEnYKFr3XK4TlYdmGT ijfNW6qDUveZCKvCu36/82IV1yU+9ivN6bI6bxf7VmNLs0gR9M6ZXgmsTfek2MjNalaJ 8v1ozlXmtdN1WgZSyYE8REu6oMWrk5yTj8wAMcD9tBNkFl8DwmQ4KUeRkx1pZpWAYML2 mg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 31y0ws3dh2-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:49:33 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 30 Jun 2020 23:49:25 -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:25 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 758F63F703F; Tue, 30 Jun 2020 23:49:22 -0700 (PDT) From: To: , Hemant Agrawal , Sachin Saxena , Harman Kalra CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 12:18:21 +0530 Message-ID: <20200701064828.4097247-7-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 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