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 49CF7A04A5; Wed, 17 Jun 2020 08:31:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 75DF91BF46; Wed, 17 Jun 2020 08:31:06 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id B815E29C6 for ; Wed, 17 Jun 2020 08:31:04 +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 05H6PrIN010519; Tue, 16 Jun 2020 23:31:03 -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=R6TU8S+exzucX4Lc7SSHV/J70GuRtgqH1HTQHN9HP2s=; b=Z3mWR72fWD9hto9a03NbijWRS7YJa1HcQq4lo2sV8JHSDh2iRbNFSNmSBiR0n57mvlGs kCmz7lYF+mlJ4/F8BZrUdSFbDoQXtv20LVHbYGMA0aWVzyzvwFxTGvz4EFsGHgmHB6iq dkRyx6HlsMuBkZY7wtMHQ4wWqGZToca+8E9Lt3p5V0oE7tfqeblxouJo+XUbpo6S/CER ryRNqrzOOFItl4Tmjh+lVCUSO031NrX317+pdQqI7V7TT67wfhOVq2yvECfwLf/mZU1v WgHacBx/0LMZCNnvXkwi26bY5jkz8YS6v8SmnNkrTNUxt3jri+vhmDUvNLqriNH0XOil KQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 31q658jmxg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 16 Jun 2020 23:31:03 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 Jun 2020 23:31:02 -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, 16 Jun 2020 23:31:02 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id ED38B3F7040; Tue, 16 Jun 2020 23:30:59 -0700 (PDT) From: To: , Hemant Agrawal , Sachin Saxena , Harman Kalra CC: , , , Jerin Jacob Date: Wed, 17 Jun 2020 12:00:40 +0530 Message-ID: <20200617063047.1555518-7-jerinj@marvell.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200617063047.1555518-1-jerinj@marvell.com> References: <20200617063047.1555518-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.216, 18.0.687 definitions=2020-06-16_13:2020-06-16, 2020-06-16 signatures=0 Subject: [dpdk-dev] [PATCH 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 --- 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.26.2