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 1661FA0350; Wed, 1 Jul 2020 08:49:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1E5CE1C044; Wed, 1 Jul 2020 08:48:59 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 7AFFC1C00E for ; Wed, 1 Jul 2020 08:48:55 +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 0616eNi3000789; Tue, 30 Jun 2020 23:48:54 -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=LApOr2s6NtI/1AZD2Yc2Ijpa/pXgQRz8TVBBvDMSnMZ/udGMwbbsOEcXSPIEfmzZQqDC SEM80nrk6n7kCv0cPHbg6kPx0PWH7otM960L/V3MnzgyhY4h02NSlKX0DmXeeRNDMA1s 48xTLeYAZC1vGwGfMaWUB3ugbF5AXv7urv1vyLb+zVovofXEXCCPQ65Y0tkj9MvfOQHq dVR0u7RvsynPT9hfldP0/GeIt/6rRz1dkS/7mO+5ZjANPqxDYlcCpQwVSUuJ4lbK8ERF Atq85HootTYPJ1hmmXwQ+O8ev273+majcgFh6g22jwSWl1ZFHoxjmgalF+aOhFrh9XcT QA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 31x5mnq846-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:48:54 -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:48:53 -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:48:53 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 270243F703F; Tue, 30 Jun 2020 23:48:49 -0700 (PDT) From: To: , Xiao Wang , Matan Azrad , Viacheslav Ovsiienko CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 12:18:18 +0530 Message-ID: <20200701064828.4097247-4-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 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