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 5D1F9A0350; Sun, 21 Jun 2020 11:48:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 32F261C014; Sun, 21 Jun 2020 11:48:26 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60083.outbound.protection.outlook.com [40.107.6.83]) by dpdk.org (Postfix) with ESMTP id 13EF71C010 for ; Sun, 21 Jun 2020 11:48:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CfPJEUa39p5jomzGF03J9SJQi6OMM8HOsSYyGGYwzptQ7G+CYHMY75wNB/uX3gYkCFyx19MHcZ9JibCPvw68ryj3Rw2bOWM48xBPqeUQbKUVF1WElKVtt3xWf+tTcE3h6CdFDmxJ8VAF0MTxaVCfICa+DZ6yGAOpj+Ckmsgo+4HD8Wy3miz3JtZ3QkC5vKdHCkwl7F4sJcVUp7JO0S2YwqZTO6oLqPX1e+1Q9Mj2P4GeJ0qW5jWYW7fTTLlNX+ODyZv/47g825F49ZgD2NgH43qx2ZxOfGRezwEHMY7NaD92WiiniQYaUgQ6/KKDwwjifye8d0p2HoAJsEgqj01pVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mPbhppgh2PdC1i4Rx3/1brCIyNyMPvghjxg28ESP7pk=; b=ImQLXD7MJcu24HSRYUd02138WX3AjgmyfDYdIAFQwlXLLOsdYTuvuF4kzdWlc/6PhQOJDFf747HOmcDkIQnF88KDYIEpDmRwuKkj5LHz/eifGWumq1qsolKw8nwprmjRYjaZ6n5AVGaVuU9X+BuPwElRmHUhSQMzT+pQcSHqObBXuIW64CouT4A0JeSRVO/LCFpje5BFSgD5Kk/rXKJIQVUbwKKXyT634uMWf3pZIc/cmPId9PRnk6eRwtU70GuHVegXilQqQbXoRYEOpuizG2BzQiXXc74vMEbxK9nG5CTnwmKci8XkQTdOt7cZccCfYAFCyzyBOy8a8oaIGIXBLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mPbhppgh2PdC1i4Rx3/1brCIyNyMPvghjxg28ESP7pk=; b=LSY951QCAwCADOMplNUnDd9nW6S36vYwE1H24M4PSEi7Ja0R8L65rAn+YGk9szfTxcLNz639jegVEftWnhsMTiRIKoDgBwSJtDA7GlFhVN/01fFoBHssKNHhdkULx0oB16bGao7EiCdIX7l0ObXZolfvd6LHS+s/wV/ZoUcH/j4= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB5279.eurprd04.prod.outlook.com (2603:10a6:803:62::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Sun, 21 Jun 2020 09:48:23 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::d4d6:f65d:34cd:aa43]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::d4d6:f65d:34cd:aa43%3]) with mapi id 15.20.3109.025; Sun, 21 Jun 2020 09:48:23 +0000 To: jerinj@marvell.com, dev@dpdk.org, Hemant Agrawal References: <20200617063047.1555518-1-jerinj@marvell.com> <20200617063047.1555518-11-jerinj@marvell.com> From: "Sachin Saxena (OSS)" Message-ID: <64275228-1827-2abf-8166-c47b8917fd71@oss.nxp.com> Date: Sun, 21 Jun 2020 15:18:16 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 In-Reply-To: <20200617063047.1555518-11-jerinj@marvell.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: SGBP274CA0013.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::25) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.10] (223.190.62.152) by SGBP274CA0013.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Sun, 21 Jun 2020 09:48:21 +0000 X-Originating-IP: [223.190.62.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2d7b5a28-1be2-4876-47dd-08d815c83cc7 X-MS-TrafficTypeDiagnostic: VI1PR04MB5279: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-Forefront-PRVS: 04410E544A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C/Ckq872JtVO0DGgpn9cpUPgRJxCg0jE0WgVMvHGiTxkXUaL6e7qRhtg9+HGv1Ii11CgnYq52IvjDPJvF78jf9USVFs1SYo3ouTCmWBBld4NR5mols4bNgis4O63kI2fNAvBmqOEi4/LVSq4yHYUol2E61hW1DpGIivnADfFnesbUhLdoEGyzX93cMyAZrqb1s5haMRm1tD14RqRuldZ7/hUVyPJUUAfBU+Hp/JugalcEC0dua37xy/QwbmDrC9YfWbQFqqzoQrWWvi+lVOox3e1VodYfEKDo+jwp7xAHwPPTHvLECVaOUt8bc3jWAxAJu12vH98vp9REKWwqQxT933viQhwYrO2KY5c2XjN8BHNa5GSK0GUFsbbGce442SI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(39850400004)(366004)(346002)(376002)(16526019)(956004)(6666004)(66476007)(66946007)(316002)(6486002)(31686004)(2616005)(66556008)(86362001)(31696002)(8676002)(53546011)(52116002)(83380400001)(16576012)(26005)(6862004)(186003)(478600001)(5660300002)(2906002)(8936002)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Hze4ep+2Z6rXPzRHCOwFNy0klQ1mMhZWRY2BDM2GezchWuQN0P++wFwRD7d7TJPRQW2GEEfG9Q7OHQK9uIbbCLKQjndab7ywnZgn47DcNn7afT9jYO2NuXe3lctAMMBomZFW0smAH+K3/I1swME1BDYzKmmRAK8FP+AVuiNqJ7fxXcp6NfeQM3F5OJOmrZxYcEYqgiJmR3zM6wG3xqLayLZov5e9SZ0T5fQgK3y8ayx7phDSFo7mEvsz0uTt+0Xkr/7b0zPKEQzV0VLu2D04BW/oTu3L2NhygCnKX5ddnOUmqQ5xkGqSBH4zYZvuQjO6w/PPFXSsekfR1Ssuo+SiSR2jClcrtITYlVF3Ox77RuUVP7RITVONtuvOG5NfAUCt9re6zxdT5oS2KDVHmVIKYQqxLVZROaQMrM/S2sOkAoKGw2THwRQWJ6+opkjinhOkX59r3TjjMDtv1uMoB5k2ppdnTnqThiwteQ1u1zX91ufna4ucKQpIktVCM7WLM3o3 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d7b5a28-1be2-4876-47dd-08d815c83cc7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2020 09:48:23.3958 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: znF2Ke6pDZxo7qT76nrA89QmcybDUj5zJozPBO517HDdwW8mwMls12uWnPnCvvROScipipgR875rSo9RoawdQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5279 Subject: Re: [dpdk-dev] [PATCH 10/13] drivers/common: 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" Acked-by: Sachin Saxena On 17-Jun-20 12:00 PM, jerinj@marvell.com wrote: > From: Jerin Jacob > > Use log register macro to avoid the code duplication > in the log registration process. > > Signed-off-by: Jerin Jacob > --- > drivers/common/dpaax/dpaax_iova_table.c | 10 +-- > drivers/common/iavf/iavf_impl.c | 9 +-- > drivers/common/octeontx/octeontx_mbox.c | 9 +-- > drivers/common/octeontx2/otx2_common.c | 96 +++---------------------- > drivers/common/qat/qat_logs.c | 17 +---- > 5 files changed, 15 insertions(+), 126 deletions(-) > > diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c > index 98b076e09..5ba8ed193 100644 > --- a/drivers/common/dpaax/dpaax_iova_table.c > +++ b/drivers/common/dpaax/dpaax_iova_table.c > @@ -7,9 +7,6 @@ > #include "dpaax_iova_table.h" > #include "dpaax_logs.h" > > -/* Global dpaax logger identifier */ > -int dpaax_logger; > - > /* Global table reference */ > struct dpaax_iova_table *dpaax_iova_table_p; > > @@ -463,9 +460,4 @@ dpaax_handle_memevents(void) > dpaax_memevent_cb, NULL); > } > > -RTE_INIT(dpaax_log) > -{ > - dpaax_logger = rte_log_register("pmd.common.dpaax"); > - if (dpaax_logger >= 0) > - rte_log_set_level(dpaax_logger, RTE_LOG_ERR); > -} > +RTE_LOG_REGISTER(dpaax_logger, pmd.common.dpaax, ERR); > diff --git a/drivers/common/iavf/iavf_impl.c b/drivers/common/iavf/iavf_impl.c > index 6174a9144..fc0da3175 100644 > --- a/drivers/common/iavf/iavf_impl.c > +++ b/drivers/common/iavf/iavf_impl.c > @@ -13,8 +13,6 @@ > #include "iavf_type.h" > #include "iavf_prototype.h" > > -int iavf_common_logger; > - > enum iavf_status > iavf_allocate_dma_mem_d(__rte_unused struct iavf_hw *hw, > struct iavf_dma_mem *mem, > @@ -87,9 +85,4 @@ iavf_free_virt_mem_d(__rte_unused struct iavf_hw *hw, > return IAVF_SUCCESS; > } > > -RTE_INIT(iavf_common_init_log) > -{ > - iavf_common_logger = rte_log_register("pmd.common.iavf"); > - if (iavf_common_logger >= 0) > - rte_log_set_level(iavf_common_logger, RTE_LOG_NOTICE); > -} > +RTE_LOG_REGISTER(iavf_common_logger, pmd.common.iavf, NOTICE); > diff --git a/drivers/common/octeontx/octeontx_mbox.c b/drivers/common/octeontx/octeontx_mbox.c > index effe0b267..f414267e4 100644 > --- a/drivers/common/octeontx/octeontx_mbox.c > +++ b/drivers/common/octeontx/octeontx_mbox.c > @@ -68,14 +68,7 @@ struct mbox_intf_ver { > uint32_t minor:10; > }; > > -int octeontx_logtype_mbox; > - > -RTE_INIT(otx_init_log) > -{ > - octeontx_logtype_mbox = rte_log_register("pmd.octeontx.mbox"); > - if (octeontx_logtype_mbox >= 0) > - rte_log_set_level(octeontx_logtype_mbox, RTE_LOG_NOTICE); > -} > +RTE_LOG_REGISTER(octeontx_logtype_mbox, pmd.octeontx.mbox, NOTICE); > > static inline void > mbox_msgcpy(volatile uint8_t *d, volatile const uint8_t *s, uint16_t size) > diff --git a/drivers/common/octeontx2/otx2_common.c b/drivers/common/octeontx2/otx2_common.c > index 5e7272f69..b292e999a 100644 > --- a/drivers/common/octeontx2/otx2_common.c > +++ b/drivers/common/octeontx2/otx2_common.c > @@ -203,89 +203,13 @@ void otx2_parse_common_devargs(struct rte_kvargs *kvlist) > idev->npa_lock_mask = npa_lock_mask; > } > > -/** > - * @internal > - */ > -int otx2_logtype_base; > -/** > - * @internal > - */ > -int otx2_logtype_mbox; > -/** > - * @internal > - */ > -int otx2_logtype_npa; > -/** > - * @internal > - */ > -int otx2_logtype_nix; > -/** > - * @internal > - */ > -int otx2_logtype_npc; > -/** > - * @internal > - */ > -int otx2_logtype_tm; > -/** > - * @internal > - */ > -int otx2_logtype_sso; > -/** > - * @internal > - */ > -int otx2_logtype_tim; > -/** > - * @internal > - */ > -int otx2_logtype_dpi; > -/** > - * @internal > - */ > -int otx2_logtype_ep; > - > -RTE_INIT(otx2_log_init); > -static void > -otx2_log_init(void) > -{ > - otx2_logtype_base = rte_log_register("pmd.octeontx2.base"); > - if (otx2_logtype_base >= 0) > - rte_log_set_level(otx2_logtype_base, RTE_LOG_NOTICE); > - > - otx2_logtype_mbox = rte_log_register("pmd.octeontx2.mbox"); > - if (otx2_logtype_mbox >= 0) > - rte_log_set_level(otx2_logtype_mbox, RTE_LOG_NOTICE); > - > - otx2_logtype_npa = rte_log_register("pmd.mempool.octeontx2"); > - if (otx2_logtype_npa >= 0) > - rte_log_set_level(otx2_logtype_npa, RTE_LOG_NOTICE); > - > - otx2_logtype_nix = rte_log_register("pmd.net.octeontx2"); > - if (otx2_logtype_nix >= 0) > - rte_log_set_level(otx2_logtype_nix, RTE_LOG_NOTICE); > - > - otx2_logtype_npc = rte_log_register("pmd.net.octeontx2.flow"); > - if (otx2_logtype_npc >= 0) > - rte_log_set_level(otx2_logtype_npc, RTE_LOG_NOTICE); > - > - otx2_logtype_tm = rte_log_register("pmd.net.octeontx2.tm"); > - if (otx2_logtype_tm >= 0) > - rte_log_set_level(otx2_logtype_tm, RTE_LOG_NOTICE); > - > - otx2_logtype_sso = rte_log_register("pmd.event.octeontx2"); > - if (otx2_logtype_sso >= 0) > - rte_log_set_level(otx2_logtype_sso, RTE_LOG_NOTICE); > - > - otx2_logtype_tim = rte_log_register("pmd.event.octeontx2.timer"); > - if (otx2_logtype_tim >= 0) > - rte_log_set_level(otx2_logtype_tim, RTE_LOG_NOTICE); > - > - otx2_logtype_dpi = rte_log_register("pmd.raw.octeontx2.dpi"); > - if (otx2_logtype_dpi >= 0) > - rte_log_set_level(otx2_logtype_dpi, RTE_LOG_NOTICE); > - > - otx2_logtype_ep = rte_log_register("pmd.raw.octeontx2.ep"); > - if (otx2_logtype_ep >= 0) > - rte_log_set_level(otx2_logtype_ep, RTE_LOG_NOTICE); > - > -} > +RTE_LOG_REGISTER(otx2_logtype_base, pmd.octeontx2.base, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_mbox, pmd.octeontx2.mbox, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_npa, pmd.mempool.octeontx2, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_nix, pmd.net.octeontx2, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_npc, pmd.net.octeontx2.flow, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_tm, pmd.net.octeontx2.tm, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_sso, pmd.event.octeontx2, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_tim, pmd.event.octeontx2.timer, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_dpi, pmd.raw.octeontx2.dpi, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_ep, pmd.raw.octeontx2.ep, NOTICE); > diff --git a/drivers/common/qat/qat_logs.c b/drivers/common/qat/qat_logs.c > index dfd0cbe5d..fa48be53c 100644 > --- a/drivers/common/qat/qat_logs.c > +++ b/drivers/common/qat/qat_logs.c > @@ -7,9 +7,6 @@ > > #include "qat_logs.h" > > -int qat_gen_logtype; > -int qat_dp_logtype; > - > int > qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title, > const void *buf, unsigned int len) > @@ -20,15 +17,5 @@ qat_hexdump_log(uint32_t level, uint32_t logtype, const char *title, > return 0; > } > > -RTE_INIT(qat_pci_init_log) > -{ > - /* Non-data-path logging for pci device and all services */ > - qat_gen_logtype = rte_log_register("pmd.qat_general"); > - if (qat_gen_logtype >= 0) > - rte_log_set_level(qat_gen_logtype, RTE_LOG_NOTICE); > - > - /* data-path logging for all services */ > - qat_dp_logtype = rte_log_register("pmd.qat_dp"); > - if (qat_dp_logtype >= 0) > - rte_log_set_level(qat_dp_logtype, RTE_LOG_NOTICE); > -} > +RTE_LOG_REGISTER(qat_gen_logtype, pmd.qat_general, NOTICE); > +RTE_LOG_REGISTER(qat_dp_logtype, pmd.qat_dp, NOTICE);