From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E227BA00C2; Thu, 10 Feb 2022 10:03:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 719C54013F; Thu, 10 Feb 2022 10:03:21 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id B15C240041; Thu, 10 Feb 2022 10:03:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644483800; x=1676019800; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=9oHEw7UBUevec7zRLkS/XvBsOGw5VAloU/MfXc1Xwlk=; b=W5c0KzuIzfEuCF43b0VeKZ3uYe+6HaDyOenMw+KNyKKlvxkk8vdKg0RS +iy/8r0GY46q+qn6NO+JqPYraBPMZG/XfTMyOATyCxhK8rblYCPPzTGfw 9QWEpUL/x8ObCNUaIYjCKimuKohA5vLrXx0mEuYPxsbp7qu34vEw3KMRl M3c04D64AjnshbR1PFl+xQS8ir3RdEFH8696YxivhzQCDLIWgjq8qIvzO qD+1mqjnRE/A+UIuCG8lgivjHsxLO6dpdkyAzDGp9t5lyOMxXajXutxz5 MHm1WUgT8nuph/3w7KDdLlJpiKphWzNuRo/HXo++fTWfmPid1UM8v6/Fm Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="249392189" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="249392189" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 01:02:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="485609342" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 01:02:56 -0800 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 10 Feb 2022 01:02:56 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 10 Feb 2022 01:02:56 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.172) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 10 Feb 2022 01:02:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ImguWSeVbVZaF3Oe4D80nvaAXiWhXxPA8hP6Su0jO1k+Llo3vOA1d3CCypJSl0WPyPjKyFvAGpGafiHew8/ISOZ8Tlzoh8oV6Ck7pwtOiDFJGlsyeJV8m901hQyxjrajJiJUisIbRwHs4ARUhnWSTK26XdUPiZFDMrmILQWbyxNtxDPEgCgs0J9SH8UTy0rpLouV030BTUvoxhAcv+h8J9Af3lJmRUF0yvhF48d8dkO8ntPdrdURNbMhhbelW094/no8EeC9Bb2wW2qPddBQf35spuC/tPCFVrhWGLlDr92Uc/vGrpBVfb2Trzaznoh5znoZT1kV8N4NgKKNAwYw5g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q+JVDKmt1GSF/sKDTrjZDDcE0VpQDkT6WMFHNWRWTnU=; b=h5VQnNoOFH4B2LK9j/GiahyfO7LD3vwcIi69OHCf+J1n8q4iaxi5MBnhgk+Sgg3DNQiGnYUSjwXNmmIdgL1m5seTQjn/zFLP409wWDmDGeqO6rSubzAJ7wJ+sATF+FpQXg9NxlwwzJe3W4MQryVNbU7nT17RP7yMW4b8XW8dqnc2l6eEfD4nXIitBdBEiiBgFVshQw3cqIXFJpS7RSRhYbazazDm0KEU+52fAvjK9I+J/TTJMeeFi9g5MTBphvhi2wl4nDFworCKEGIRMvzf9kli5bkF18qIunO/FPoKGyLZEtRaRyZ9UhV7U0S2Hmxfo7TlubbrTCZclBfsJVvsDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by CO1PR11MB4867.namprd11.prod.outlook.com (2603:10b6:303:9a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 09:02:54 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2%4]) with mapi id 15.20.4975.011; Thu, 10 Feb 2022 09:02:54 +0000 Message-ID: <09f2fe07-b15b-9b05-b57c-54eaef14fc94@intel.com> Date: Thu, 10 Feb 2022 09:02:49 +0000 Content-Language: en-US To: Jiawen Wu , CC: References: <20220209104213.602728-1-jiawenwu@trustnetic.com> <20220209104213.602728-9-jiawenwu@trustnetic.com> <004201d81e54$c0401160$40c03420$@trustnetic.com> From: Ferruh Yigit Subject: Re: [PATCH v2 08/12] net/ngbe: fix debug log X-User: ferruhy In-Reply-To: <004201d81e54$c0401160$40c03420$@trustnetic.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB3PR08CA0007.eurprd08.prod.outlook.com (2603:10a6:8::20) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a4402f5-3555-4440-0f9c-08d9ec741fc6 X-MS-TrafficTypeDiagnostic: CO1PR11MB4867:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XsbmWgGaROMG7/JiV2su31Ah1417MHmX3qxNdaABSpD5Y+w3/nKOwgve5genckwSJ/JIBOftVJgawgOEQO/myn0QllkexJh02Su2NzAJoJgFIoAQEe4ProuIbSyaAo70XxwCFMF60fqpnarCrR6yzNKRjHHUwi1qVccKz80Q9zwzPhk6Cjq92eg/JJvAo2OyjlPAu/XAwaXW2MHDkGp3TirG2aOSIER/NPJ9HPJSZ7hAUaTQHXTni3n+kAMz4CUhFtZHUctJDkzoU22OEq4L9XusME2cc952LBFIDmrVy0YHPTb1NSx+Gx6/fAaEsWXConiR4iCS32vfXLySC30U8+8clC3AVGg6wuiALtg0K476XlLGnznnUihsjzvIGFCa8EZXiCXi708B/2j+oDrdHp58POc865WegGE+aM77UHVMklA5OtcDg8Zhuwt8tKx4yHWlV74xA6raR/9bMoeRUcWy7kRSvIEB/jjH04Y5toEY/sNSzH6gMTXxxUbwNMLosap/gFmm5THifwb1oF+4SzAf8Owp7og3nhdrV7glaBiAWZo0D38V1aQzAqQ7iZOAjN62TWZw9g/5ZbcKlOfCYxGyu2QPf4mRkhdbP2DEMNVFHBaR3dzkYVh84+M9WlAnPXSC4+yDog/5FFrD83Opl86eMXah6k9fW25UdU0G3ih5cQxk9gbINOGyT+3XjYrUOsIF5sM6MlijLH4zRzIQpg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(316002)(5660300002)(8936002)(44832011)(82960400001)(2906002)(6512007)(6506007)(55236004)(53546011)(6486002)(4326008)(508600001)(26005)(2616005)(186003)(86362001)(31686004)(66556008)(66476007)(66946007)(36756003)(6666004)(8676002)(38100700002)(83380400001)(31696002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TndZMlEveWxIQnBGcXp2dllFTXlCUXVPZ3owbzlGb3RQdTEvdTdpSmhSS2RW?= =?utf-8?B?MmdrREpTUWZHWWFIai96eUsrQUJTL3FFSkpHN3FSKzNXaElwQnl2TS9FNG01?= =?utf-8?B?RzZyM0dycm9CZ0JjaUtYbXVMU3hYUldBMnk0Z096Ri9TTWg4SUhSekcvNXNE?= =?utf-8?B?MEs5TFVpWTQ4c1g2Z1JKcG9SSjhKbHI5TzZLa09MVHZZdk1hYkc0SjRKM2ZU?= =?utf-8?B?U0Q1RGFrSndieGRDK2lMUjh3amVjSEloUEY4Q0Z5USsrYVg5MFZ0YU9paUd4?= =?utf-8?B?VkZRZUxFQ01oWjdyWTZxMG0vSUhsczRLRmJUYVFBeTh4QzhEdHlhalFacXRY?= =?utf-8?B?ZFNyOUYycUkzTTVTNmhQY3ZNS2psSlgybXdtZ3BmYVgyU3ovY1RFT013SGNC?= =?utf-8?B?S25iUXZPdlJlVGpoaitFZUpBNjd5WllDbFNtenRpOFA1N1pHY3Vxd1FOcVEw?= =?utf-8?B?YkR6QWpvZ0h1MVdacWhxWVc1TFVhTGVBNWZrcDNTTlhxVFhJOHNTdHFFcTli?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BVL1FpNDBsSXNGS3Qy?= =?utf-8?B?UUdJZEZkbW1SWVhDYndRSlJNSU9pUFFsWktOQmVnMFF5MDE4QmIvdUFBR2lZ?= =?utf-8?B?bVhlb25nTmQ0K2cvLzFPakVoaHhZc3BseDl6dVhOSlU2Skt4UzQ2NTBnYzVx?= =?utf-8?B?NEh3QWJPRlU2K2RBMlRpWmVyQnBmTHl4ajFOczc0SStVd3N0M1ZlL3J2VHFs?= =?utf-8?B?dmJCRjQ1OWVJNTVvWjdDN3JmQVBBdmZmeGxONTZHYzlIV0hkZllwb2FxVHJY?= =?utf-8?B?QW85cGN1TURKVkVqMFE5SXBQTU9mcklFR2NNSmwrUGZPbWJFbEVYc01KZU04?= =?utf-8?B?Z1B5L1JBQjFBYjFtUkQ5dGJrSmJNcFBGS0oyMnRuWkxPbGkraXJCQVVUTU12?= =?utf-8?B?OHZWcWUwZGhFTlQ2SVdoNlN5NDFUb29EaUR1TDhXb29OcitCRjZzbWM3azIx?= =?utf-8?B?REpONklNMXRBZXhHaVJmS3VxMkQybjliRWQ0MlVHK0U0VHJjcUlnemhhdXlN?= =?utf-8?B?UGF6M01YQTB6YmNRa1crRFBMWjhRbmhFUUk5VzM3T2xBTTl3U3lQdFJDeHFj?= =?utf-8?B?bE1KUC9Va1FKMG81SzUxV1VxaVVLS1RKNmkzMUxuRUFkcDFQUGg2Z3VMdGhV?= =?utf-8?B?clRYTDBRSHJWNEZMbFFtT0k2dkVrTFF3dlpMRjVmaUFqeEYrdE9nL0w0Qjly?= =?utf-8?B?c2dmcEM0Tk5XRWM5R1ZrNjRJWDFhaW5wUDBtUzlKMkM2Z1orQkZJTzZvVjdw?= =?utf-8?Q?EZv5pDHQbiC7d4+guoT19oE=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 1a4402f5-3555-4440-0f9c-08d9ec741fc6 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 09:02:54.5414 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ueAOyKUyTKQyZiQjMQqA3YbaDsvWi+IiLEY8ltOzZw7+MkB+Zlf+vs38s/DVQTLPGZ4oRfANsWWuteEQaoTKYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4867 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2/10/2022 8:03 AM, Jiawen Wu wrote: > On February 10, 2022 3:07 AM, Ferruh Yigit wrote: >> On 2/9/2022 10:42 AM, Jiawen Wu wrote: >>> Remove 'DEBUGFUNC' due to too many invalid debug log prints. And fix >>> that double line was added by using 'DEBUGOUT'. >>> >>> Fixes: cc934df178ab ("net/ngbe: add log and error types") >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Jiawen Wu >>> --- >>> drivers/net/ngbe/ngbe_logs.h | 11 +++++++---- >>> 1 file changed, 7 insertions(+), 4 deletions(-) >>> >>> diff --git a/drivers/net/ngbe/ngbe_logs.h >>> b/drivers/net/ngbe/ngbe_logs.h index fd306419e6..b7d78fb400 100644 >>> --- a/drivers/net/ngbe/ngbe_logs.h >>> +++ b/drivers/net/ngbe/ngbe_logs.h >>> @@ -15,9 +15,12 @@ extern int ngbe_logtype_init; >>> "%s(): " fmt "\n", __func__, ##args) >>> >>> extern int ngbe_logtype_driver; >>> -#define PMD_DRV_LOG(level, fmt, args...) \ >>> +#define PMD_TLOG_DRIVER(level, fmt, args...) \ >>> rte_log(RTE_LOG_ ## level, ngbe_logtype_driver, \ >>> - "%s(): " fmt "\n", __func__, ##args) >>> + "%s(): " fmt, __func__, ##args) >>> + >>> +#define PMD_DRV_LOG(level, fmt, args...) \ >>> + PMD_TLOG_DRIVER(level, fmt "\n", ## args) >>> >> >> Both 'DEBUGOUT' and 'PMD_DRV_LOG(DEBUG, ..' are in use for same thing, >> but one appends '\n' other doesn't, this is very error prune and there are >> already wrong usage in the driver. >> I think no need to add complexity for something as simple as this, what do you >> think to unify the DEBUG level macros, at least unify the line ending behavior? >> >> >>> #ifdef RTE_ETHDEV_DEBUG_RX >>> extern int ngbe_logtype_rx; >>> @@ -37,10 +40,10 @@ extern int ngbe_logtype_tx; >>> #define PMD_TX_LOG(level, fmt, args...) do { } while (0) >>> #endif >>> >>> -#define TLOG_DEBUG(fmt, args...) PMD_DRV_LOG(DEBUG, fmt, ##args) >>> +#define TLOG_DEBUG(fmt, args...) PMD_TLOG_DRIVER(DEBUG, fmt, >> ##args) >>> >>> #define DEBUGOUT(fmt, args...) TLOG_DEBUG(fmt, ##args) >>> #define PMD_INIT_FUNC_TRACE() TLOG_DEBUG(" >>") >> >> What is difference between 'PMD_INIT_FUNC_TRACE' and 'DEBUGFUNC'? >> As far as I can see they are for same reason, and both macros are used. If they >> are for same reason can you please unify the usage? >> >>> -#define DEBUGFUNC(fmt) TLOG_DEBUG(fmt) >>> +#define DEBUGFUNC(fmt) do { } while (0) >> >> If 'DEBUGFUNC' can be removed, why not removing from the code, instead of >> above define? This is your driver, you have full control on it. > > Okay. I just realize that this is going to be a big change, so I want to keep it to a minimum. > Anyway, 'DEBUGFUNC' should be removed, because 'DEBUGOUT' already contains the function name. > If it will be big, we can move the fix out of this set, to not block set, and send a log fix later as a separate patch, what do you think?