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 028ACA0350; Wed, 1 Jul 2020 12:45:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED2331D16A; Wed, 1 Jul 2020 12:45:18 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 47DC71D168 for ; Wed, 1 Jul 2020 12:45:17 +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 061AflIs005344; Wed, 1 Jul 2020 03:45:15 -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=lvlDxc5T5D1JOR5qEvSwSi61topliF2i07NYI4Hv/Mw=; b=USH0uvL3Wnk3/T4YYe1I+loenx8CZKb0WFjmRziNRD0ZvTd2yZa59itK/OCXdOTtdsXf KwJGqmrhUwQtLMspSpWlelnJ2dTtAftx46YW7gFNLgtNmRfIWklrhXdv0Pno3YTybyT8 sYjDdPRVZwN+pnKOHG1GwcbtMM0MIPtKhlM7vFNIZE0E184bIxFrqYZz+P8SWbwhl8hT oO6P8SF9o5MijUdW37z/Yl4LSF6UEJGfgAiBMyMN8iBV+nGKH81LmL6/0aCSuBSks36p +bSbSoRMPGf+8jbZ+UplsQvypaLBD45PobiX5yw8dNvnUz6KLfJdDHWCI7zqROotYX+F LA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 31y0ws48k8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 01 Jul 2020 03:45:15 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Jul 2020 03:45:13 -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; Wed, 1 Jul 2020 03:45:13 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 8177B3F703F; Wed, 1 Jul 2020 03:45:10 -0700 (PDT) From: To: , Xiao Wang , Matan Azrad , Viacheslav Ovsiienko CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 16:14:18 +0530 Message-ID: <20200701104428.4149689-4-jerinj@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701104428.4149689-1-jerinj@marvell.com> References: <20200701064828.4097247-1-jerinj@marvell.com> <20200701104428.4149689-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_07:2020-07-01, 2020-07-01 signatures=0 Subject: [dpdk-dev] [PATCH v4 03/13] drivers/vdpa: 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/vdpa/ifc/ifcvf_vdpa.c | 10 +--------- drivers/vdpa/mlx5/mlx5_vdpa.c | 7 +++---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index ec97178dc..78299fa67 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -24,6 +24,7 @@ #include "base/ifcvf.h" +RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE); #define DRV_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \ "IFCVF %s(): " fmt "\n", __func__, ##args) @@ -44,8 +45,6 @@ static const char * const ifcvf_valid_arguments[] = { NULL }; -static int ifcvf_vdpa_logtype; - struct ifcvf_internal { struct rte_vdpa_dev_addr dev_addr; struct rte_pci_device *pdev; @@ -1271,10 +1270,3 @@ static struct rte_pci_driver rte_ifcvf_vdpa = { RTE_PMD_REGISTER_PCI(net_ifcvf, rte_ifcvf_vdpa); RTE_PMD_REGISTER_PCI_TABLE(net_ifcvf, pci_id_ifcvf_map); RTE_PMD_REGISTER_KMOD_DEP(net_ifcvf, "* vfio-pci"); - -RTE_INIT(ifcvf_vdpa_init_log) -{ - ifcvf_vdpa_logtype = rte_log_register("pmd.net.ifcvf_vdpa"); - if (ifcvf_vdpa_logtype >= 0) - rte_log_set_level(ifcvf_vdpa_logtype, RTE_LOG_NOTICE); -} diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index 1113d6cef..b166207c4 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c @@ -608,15 +608,14 @@ static struct rte_pci_driver mlx5_vdpa_driver = { .drv_flags = 0, }; + +RTE_LOG_REGISTER(mlx5_vdpa_logtype, pmd.vdpa.mlx5, NOTICE); + /** * Driver initialization routine. */ RTE_INIT(rte_mlx5_vdpa_init) { - /* Initialize common log type. */ - mlx5_vdpa_logtype = rte_log_register("pmd.vdpa.mlx5"); - if (mlx5_vdpa_logtype >= 0) - rte_log_set_level(mlx5_vdpa_logtype, RTE_LOG_NOTICE); if (mlx5_glue) rte_pci_register(&mlx5_vdpa_driver); } -- 2.27.0