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 EE270A0350; Wed, 1 Jul 2020 05:59:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 07EBF1BF5D; Wed, 1 Jul 2020 05:59:25 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 072DF1BEDF for ; Wed, 1 Jul 2020 05:59:22 +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 0613tWxM001233; Tue, 30 Jun 2020 20:59:21 -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=HC+dBVF/JzZCPwLVF+niY88aoT2awypSqQNbuvEkxwTH0ub1yy0dlu05VoAcMMYo9C3f AN6ghhM9XEgdOhMRcKqH6prqGB3+SAREgmM+/n8o6GGbLwzUPhSfXQZVUpXRjBZVASX0 +MxQ09Oz6hx8Cl1MuQ1urVOurMTD4TBp0yTrLYLtYbR+vVjuZWZGbpSMrUFMxjRryNkd hvZ7zN8IKvSab41gD8vdpUAAQH9pfwUj8UYMAk0tGX2OzlI2Oe7Q+0O17Mn3nuIGSsrt Jvw8q9xbqriS7wg6WgapVGBHvGI+kf1RdREFxvATvuciAV2/ntCJy7yP4Wd9Qg8Q3nDD 0g== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 31y0ws2whw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 20:59:21 -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; Tue, 30 Jun 2020 20:59:20 -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 20:59:20 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id E17AA3F7045; Tue, 30 Jun 2020 20:59:17 -0700 (PDT) From: To: , Xiao Wang , Matan Azrad , Viacheslav Ovsiienko CC: , , , , , Jerin Jacob Date: Wed, 1 Jul 2020 09:28:30 +0530 Message-ID: <20200701035840.4028056-4-jerinj@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701035840.4028056-1-jerinj@marvell.com> References: <20200617063047.1555518-1-jerinj@marvell.com> <20200701035840.4028056-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_01:2020-07-01, 2020-06-30 signatures=0 Subject: [dpdk-dev] [PATCH v2 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