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 B105943B67; Fri, 8 Mar 2024 14:35:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A062543370; Fri, 8 Mar 2024 14:35:45 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mails.dpdk.org (Postfix) with ESMTP id 86F6240E2D for ; Fri, 8 Mar 2024 14:35:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709904944; x=1741440944; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=+gf3gOSWXIiTfea9C3yUqyzSvd9A2kZM7L44GItTjOo=; b=ly3CfVm994QLyUTOufjliwvwGM3YHRDQ7jxZeXaBS+6esXBKZg1h3E0M Ome5gRVXPRRyhbGRFU+6KHjTzgL3HbMmiQNWuLXmTvxEsoSK1QCR1nYCL P3+qUi7ByqwUiNzK4wnEsLcaiFpgy+DhkjENq819XHAba2u8br+HZ7y6F fBiV0jAy/EuGrN7EP/Cklr3hhjLk4qaMpH8hgCOftDJ76oXEAfZNuWPtY 9eF8Zeoi4VY+yujS3A+LhbFTxX4ujnAn1p6mGbEpq60r0E5zem5NjyYSA LxYWB9y+Ws+dPoe6wDZNjXqTHIS/mrZCRCQRzo8w6wMve6pkilWzDUVR2 w==; X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="22148721" X-IronPort-AV: E=Sophos;i="6.07,109,1708416000"; d="scan'208";a="22148721" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2024 05:35:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,109,1708416000"; d="scan'208";a="15023095" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 08 Mar 2024 05:35:43 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 8 Mar 2024 05:35:42 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 8 Mar 2024 05:35:42 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 8 Mar 2024 05:35:41 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RdIU3n6mFpmcCM2ng9UqEOlO1IOZ2lQv+upFlZTsUBfa8vl0OEvLcguh3wgZNzfy+vjzl+g8r1/Bv9E+9+/0XQPfNIK2XkqDKlhvVUERNvObJEiNG9XSHRAfZHbWMvaWe7WwqVcvUpU0H7721wiLeue+h9oG2NWvqNyDn0MT86gXp4SKH1KTsx9cptsf941UIgpSLg7vVOc3B+MGcA47Yfo5ZIHICCg+SqmEtl3nJoigOq16C33sD8qiz/WukiGFe3jYjpG57OLyquABUAOLuIdud1AEsv8di6Lmmnv84b1eU4dETyidAPstlZYXKsJJDKNltiVVSfTy/Y8tgCVY/Q== 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=AS2ygCVmEghNRizcErR5uAy3Git/y1ZkgHcDQH7aqhQ=; b=mcB1wzoZfQ0x40o/hrHDuUMU090CK6wa7aAgHhp6r4/FO2tqDti+vKbWX/ucx1vMKkqc8gRVRJ2j+DhZFevkJHKCqgm5hY9CRNaTv6frMfFePryzZv7CzT/S+TF75zWQOWbsmS4Xzlw5cNwxs/b42o12ELXjRv12UW7/W1Ooa5xbpvNY5R2xx0PrswEuXr1+bFuKnfRSIbP0hQHZhjboNfnrXOIgwFvB+0lz21UfqCR8GdLe1FvykOYXC59s5JaBzRdk5W1maAc1kdb94gvq2W2B4pfvIDtS97YySDtrIXlFW9on9pFK6EiCb6Dl7D3a6Qjx0J+N+bkYqBdrL7PTnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from IA1PR11MB6074.namprd11.prod.outlook.com (2603:10b6:208:3d6::14) by CH3PR11MB8313.namprd11.prod.outlook.com (2603:10b6:610:17c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.9; Fri, 8 Mar 2024 13:35:39 +0000 Received: from IA1PR11MB6074.namprd11.prod.outlook.com ([fe80::4d95:78d0:b30a:b5c5]) by IA1PR11MB6074.namprd11.prod.outlook.com ([fe80::4d95:78d0:b30a:b5c5%6]) with mapi id 15.20.7386.005; Fri, 8 Mar 2024 13:35:39 +0000 Message-ID: Date: Fri, 8 Mar 2024 19:05:32 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] testpmd: replace EAL logtype TESTPMD_LOG To: Stephen Hemminger , CC: Huisong Li , Yuying Zhang References: <20231211172437.61958-1-stephen@networkplumber.org> <20240216033743.150800-1-stephen@networkplumber.org> <20240216033743.150800-4-stephen@networkplumber.org> Content-Language: en-US From: "Singh, Aman Deep" In-Reply-To: <20240216033743.150800-4-stephen@networkplumber.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0209.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:e9::20) To IA1PR11MB6074.namprd11.prod.outlook.com (2603:10b6:208:3d6::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR11MB6074:EE_|CH3PR11MB8313:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e783cf4-079c-4cee-b83c-08dc3f74a490 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WBdXOPHkabHIz8nKzxG9BczV4FoF3JIdNy3wWC/Q3L7GRjIbywPE+ej2jY2VTj7JBQw64fUbk8wWpOpQKcmFsY15WluXyX7Jm/exR6Oi38Ba+1GnV1knOq4S5BFC0jKftDlUWuUINxW+tAZLQPYDFKwp5jsE0dH4jLY3Nm9oxd58RRMlwVq7xe7zVgL0fmJgUsp1WMqe4SiqJl+uj+4GWz+iRSvXY3l6iSbuiyEEU1csrWW0xJAGaoLQ2A0jgSdLIbs+rkorNL/XdUmSacazZmzf64ZffBh7quqOOQB52fn69Q7j4PMNU4e4zwwDTCGfNakn7lTTKAowMMM3XdSOsDkA216KufGOWJFeuRjDlMTw75wLrQzeh50OuLCqM4NyrOJFXeSVWVrrlA94Ez1Pohs/vdP7JS9ceC/FzGdopQpoPUm8K2jtKi/Ir+9TaDJOOPSVRt7EHSTBGeRKAl69u4XCVcQA6WRj49IqWWkDo1cysMyMRPlDpiyyRTRhcLVeH+QS7RiIAQ6t33HUubJ+/Xekxdq4w6iMuelSRYQD2QZrQO3U/5+9Yy38NbwGeTSyJWq+X1No8cTFdRedpUl0NWzMO6BT22OFpcu0MYdQy8WGfyfTQnyaQExXsoLVj6TIzEeQwYA9P9gNqYuF4lvtbNn78xvbbPXRITrhCMGe7yU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR11MB6074.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OERvREY2cGtHZk1ueE1QZWRMRWxGcVdvSkRaYk9hTFhVYlpZeWU5RjFMK0Js?= =?utf-8?B?TERLbnZPelpmNkFuZWY2aFFiaVFHT2VaRUNtLy8zdHp3T1FPQ3I1SWcvUUtK?= =?utf-8?B?L0FGUWYycm5iSWpBUDRJWkNKYko3SGdSNWt3dDQ1RjA0eE9QNDJsb0x0NjJ3?= =?utf-8?B?dS8rb1I1STVnR1FoTmpWTEg3Nld4Z2p4blBGOUhPdkxabjliRS91OGVxc29j?= =?utf-8?B?OXQvNURLV0VmcmRJM2htUzF3QmpYRTN0M0t5MDlKTVJqRCtRUzZyTnNhUGFm?= =?utf-8?B?dFUxQ3RxYU4zVWdpZnNJYzczbmRRWXFDVjA5VlE2NlZ3NFFENVNSYjE0aHkz?= =?utf-8?B?aTB1VEdnbDY3Z2pKU1NwZHNzeCtxOVhKVW5YTkJVNU03dklaV0U0Y2NERldz?= =?utf-8?B?Y2dqdnNnbzdXc0EvdUJNcG0rcC9VaW9lM1dFZVRwYkFScmNGQjlhdHF0RDZP?= =?utf-8?B?MUhNYXUzYUJJcDI3YzE2MmIvcUZWU1F2dmxXWVN6bS80dGtsRXcwZkQzRFZi?= =?utf-8?B?NjI3emZSYStVY2VzeEIzL0hZQXo2NVFBQm1paGhnaUdjczZaRjJRVyt3dWRJ?= =?utf-8?B?Wm5ZdHRKNmMxZnFm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-8?B?Y2FHeGY0TGsrWHAyazg0b3ZTNE1lajZzZWxHQVNUVERvdG1UemkrcW9CbzVt?= =?utf-8?B?dll0QXZzUnBJT1ZDNkVmV3ZTOTJSMHpoSlJwbXlYQTVjRURKRHE1MThNeTJz?= =?utf-8?B?dUVWK2Iyc0dGcURRL1lQSEVuaWY3UGxmdUR1VHZ6ZW1aZnVleFRmQVlNUDBi?= =?utf-8?B?ZjV2TkZpQXpZc0xUSHdtclJZMjYwR2diOXVyRnVlZ21HdGhvVm5UY1dGWXBO?= =?utf-8?B?K0ZKKy9TN3pLRy9qZS8yV3RCTGQ1THFiOWxQV1U2NW1QTVhaZHYwamxhZ2RD?= =?utf-8?B?K0V1d3FEcEdFdHUxaFpXUzQ4eG0vU3pjQ3JEY05vVHI1TEwvUVdPTWZRclBE?= =?utf-8?B?ZFRSY0JmV0owRlRGZHpremw2eFdvT2dDNGlCeFJrUXV1OEREZE9vcUUwYTVH?= =?utf-8?B?Y1dRUCtuT0ErdzBzMStmMWhDd0hFaVRaMHowR01yRjE2eUwwTkU2NVdJSHky?= =?utf-8?B?ODRIeDNwK3E1aGs4Q0xDRitQdVBtRUxFS2hvTTdkTWRmcG1xTUlsc1ptK3Iz?= =?utf-8?B?c09KbSt1eklHU0FNbHk0aHl6c1NHb3B0Tm5icnVLUEVtOGp0L1kxZ3J6Zytr?= =?utf-8?B?ZHUzeE1INTBMenE5c29XUUVZR2FlTThBYXg2aDF1YVdOeTVFMGFzeDloQk5I?= =?utf-8?B?T2c9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 7e783cf4-079c-4cee-b83c-08dc3f74a490 X-MS-Exchange-CrossTenant-AuthSource: IA1PR11MB6074.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 13:35:39.2734 (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: trJydpeyJXar7Boep3+lpRKLC009wQNZBt2KN9/1UDPTpaDXjGiNg3snMpmpaVYqW6HYorbbvqdz/jeApy4/UtBw/Mz1/2rqSQzz4yPBqlw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB8313 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/16/2024 9:06 AM, Stephen Hemminger wrote: > Testpmd is misusing EAL logtype for some errors. > Since the code directly has a macro for logging, use that. > > Signed-off-by: Stephen Hemminger > Acked-by: Huisong Li > > fix testpmd > --- > app/test-pmd/testpmd.c | 42 +++++++++++++++--------------------------- > 1 file changed, 15 insertions(+), 27 deletions(-) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 9e4e99e53b9a..249e934a3013 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -3413,8 +3413,8 @@ stop_port(portid_t pid) > > ret = eth_dev_stop_mp(pi); > if (ret != 0) { > - RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for port %u\n", > - pi); > + TESTPMD_LOG(ERR, > + "rte_eth_dev_stop failed for port %u\n", pi); > /* Allow to retry stopping the port. */ > port->port_status = RTE_PORT_STARTED; > continue; > @@ -3423,8 +3423,7 @@ stop_port(portid_t pid) > if (port->port_status == RTE_PORT_HANDLING) > port->port_status = RTE_PORT_STOPPED; > else > - fprintf(stderr, "Port %d can not be set into stopped\n", > - pi); > + TESTPMD_LOG(ERR, "Port %d can not be set into stopped\n", pi); > need_check_link_status = 1; > } > if (need_check_link_status && !no_link_check) > @@ -3812,23 +3811,20 @@ pmd_test_exit(void) > if (hot_plug) { > ret = rte_dev_event_monitor_stop(); > if (ret) { > - RTE_LOG(ERR, EAL, > - "fail to stop device event monitor."); > + TESTPMD_LOG(ERR, "fail to stop device event monitor."); > return; > } > > ret = rte_dev_event_callback_unregister(NULL, > dev_event_callback, NULL); > if (ret < 0) { > - RTE_LOG(ERR, EAL, > - "fail to unregister device event callback.\n"); > + TESTPMD_LOG(ERR, "fail to unregister device event callback.\n"); > return; > } > > ret = rte_dev_hotplug_handle_disable(); > if (ret) { > - RTE_LOG(ERR, EAL, > - "fail to disable hotplug handling.\n"); > + TESTPMD_LOG(ERR, "fail to disable hotplug handling.\n"); > return; > } > } > @@ -4062,12 +4058,10 @@ dev_event_callback(const char *device_name, enum rte_dev_event_type type, > > switch (type) { > case RTE_DEV_EVENT_REMOVE: > - RTE_LOG(DEBUG, EAL, "The device: %s has been removed!\n", > - device_name); > + TESTPMD_LOG(INFO, "The device: %s has been removed!\n", device_name); > ret = rte_eth_dev_get_port_by_name(device_name, &port_id); > if (ret) { > - RTE_LOG(ERR, EAL, "can not get port by device %s!\n", > - device_name); > + fprintf(stderr, "Can not get port by device %s!\n", device_name); Any specific reason to use fprintf() here rather than TESTPMD_LOG > return; > } > /* > @@ -4081,12 +4075,10 @@ dev_event_callback(const char *device_name, enum rte_dev_event_type type, > */ > if (rte_eal_alarm_set(100000, > rmv_port_callback, (void *)(intptr_t)port_id)) > - RTE_LOG(ERR, EAL, > - "Could not set up deferred device removal\n"); > + TESTPMD_LOG(ERR, "Could not set up deferred device removal\n"); > break; > case RTE_DEV_EVENT_ADD: > - RTE_LOG(ERR, EAL, "The device: %s has been added!\n", > - device_name); > + TESTPMD_LOG(INFO, "The device: %s has been added!\n", device_name); > /* TODO: After finish kernel driver binding, > * begin to attach port. > */ > @@ -4632,23 +4624,19 @@ main(int argc, char** argv) > if (hot_plug) { > ret = rte_dev_hotplug_handle_enable(); > if (ret) { > - RTE_LOG(ERR, EAL, > - "fail to enable hotplug handling."); > + TESTPMD_LOG(ERR, "fail to enable hotplug handling."); > return -1; > } > > ret = rte_dev_event_monitor_start(); > if (ret) { > - RTE_LOG(ERR, EAL, > - "fail to start device event monitoring."); > + TESTPMD_LOG(ERR, "fail to start device event monitoring."); > return -1; > } > > - ret = rte_dev_event_callback_register(NULL, > - dev_event_callback, NULL); > + ret = rte_dev_event_callback_register(NULL, dev_event_callback, NULL); > if (ret) { > - RTE_LOG(ERR, EAL, > - "fail to register device event callback\n"); > + TESTPMD_LOG(ERR, "fail to register device event callback\n"); > return -1; > } > } > @@ -4658,7 +4646,7 @@ main(int argc, char** argv) > rte_eal_cleanup(); > rte_exit(EXIT_FAILURE, "Start ports failed\n"); > } > - fprintf(stderr, "Start ports failed\n"); > + TESTPMD_LOG(ERR, "Start ports failed\n"); > } > > /* set all ports to promiscuous mode by default */