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 D4EF6A0350; Wed, 1 Jul 2020 14:34:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BBD941D163; Wed, 1 Jul 2020 14:34:13 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id ABCEA1D147 for ; Wed, 1 Jul 2020 14:34:10 +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 061CVW4p003190; Wed, 1 Jul 2020 05:34:09 -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=+GyzkllzaoSrhLtpRQgb3xlb6+/oMt0yrmE9kOHyPvc=; b=osfMzBEug0UQ29jjNmoTbaDikOulPeLCZy5XXi2QSFLZjnPTXd0hsNl3pM8wLRef1G7F p3bNJ+D1x9Lcwx+QvzRBev2MUem2muF2o43ooanVMIongXGsfNzHP1iBQ6x8laVn2Uct cNhb1nzFtX6my+JSVB9Qdf2amqySXia6NOcEN7nuSFj0BQt+iQ++BJUb04N7+2Yx/pxe 3DutqAzpnCToBk+L8+2k6KpjvglIuahhwbg4XTBDS+JHbwM9PRKX9kO/zVEliQXqzKTO oGuPqmqPHekhunvxih5KquR5vWFCDmvGHBXo7cwzW9QCOa7iwFvNZBtOy+J3Fo92hVHD Ww== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 31y0ws4mf9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 01 Jul 2020 05:34:09 -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; Wed, 1 Jul 2020 05:34:08 -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; Wed, 1 Jul 2020 05:34:08 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 77ACE3F703F; Wed, 1 Jul 2020 05:34:05 -0700 (PDT) From: To: , Xiao Wang , Matan Azrad , Viacheslav Ovsiienko CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 18:03:37 +0530 Message-ID: <20200701123347.51144-4-jerinj@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701123347.51144-1-jerinj@marvell.com> References: <20200701104428.4149689-1-jerinj@marvell.com> <20200701123347.51144-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_08:2020-07-01, 2020-07-01 signatures=0 Subject: [dpdk-dev] [PATCH v5 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..feb6148bb 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