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 2986541BAE; Thu, 2 Feb 2023 13:53:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C338642D32; Thu, 2 Feb 2023 13:53:02 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2051.outbound.protection.outlook.com [40.107.95.51]) by mails.dpdk.org (Postfix) with ESMTP id 8DF254014F for ; Thu, 2 Feb 2023 13:53:01 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CuPlJZF8xSuTiR1TQjmQFpqVeiCliB13sj/twICOlxCGvpOKyNNmBBmUA/i/GF5v76sMjy6nnmqadbt+GHWFvbLK+c53aXSjPN3K2UASbOTihAfLzZ2w4JDC9N8HF11G2H1HLZ9oSUlfMgvCaPkEZOqRmveUQ1dbYWXmm2wWXwTgaR48r4u06e9OTPd3cqo5a3vvvHFO3GYlelYLD7mqN3BUUkBZH/Gxq7V7W73i1pmsa7gAdO+VdsOSwhBqL6bHWa6T1G2PP36445+2PACf8wbfSdFFn5euPuXEFTVFz8r1LTs9WYX/HbZuR5vzmbNAzCO20tzH+1lWm6wQf/gk/g== 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=U8mq12kTR8EH9fWEeRSvhvDjNDvN15eXjV46Ybh/c9s=; b=Ml6lYfD01F79Lfc4CiV9YZKrU7+FOKI5QGAI1n28lBrEZZvMw6sldCeGBh1ppXmJfRxsVVxWDUvN3onlSjXZJthBFgDPDp/aDb0HpKwKlkRUEI38dXixSBPyz+Rmft4YBsS3MrxaPCDMPtkQyYG5ecF/WZyKsqHMNChiCBYpbSz0IRQdvq6m4IS90IfL2qO1u3v8BFZYTd9lRAmopK2FNU7qcFCtwnXCN/7Zh21rhHzTlXJLkV3YXn7NEV6AT66KLD/49/dtNR6f78QrFEGd+R+1AD2QrqPcaJ5NUaM/CCN69EtYgZc7bHELd9dEkYq7q5cqZgknFLXVzmCpKFr5rA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U8mq12kTR8EH9fWEeRSvhvDjNDvN15eXjV46Ybh/c9s=; b=i8KKCm/ghaQ2/AqeTJCRP2IF+1ir0zlQG1Xkcvg8n8IRfTxYpQxW7zsXYCl4ulmKd94tsULnM/aig+vzi7QbrPcICPBANLAxck6sBc51dZ18smv7vUxZSiXEPaDZT/NaoR+kkA+y6K5lW3GaGJXW1anR3zTH263iTfjVoa7tUVc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DM4PR12MB6664.namprd12.prod.outlook.com (2603:10b6:8:bb::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 12:52:58 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%8]) with mapi id 15.20.6064.024; Thu, 2 Feb 2023 12:52:58 +0000 Message-ID: Date: Thu, 2 Feb 2023 12:52:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [EXT] Re: [PATCH v6 2/6] ethdev: add trace points for ethdev (part one) Content-Language: en-US To: Ankur Dwivedi , "dev@dpdk.org" , David Marchand , Jerin Jacob Kollanukkaran , Andrew Rybchenko Cc: "thomas@monjalon.net" , "mdr@ashroe.eu" , "orika@nvidia.com" , "chas3@att.com" , "humin29@huawei.com" , "linville@tuxdriver.com" , "ciara.loftus@intel.com" , "qi.z.zhang@intel.com" , "mw@semihalf.com" , "mk@semihalf.com" , "shaibran@amazon.com" , "evgenys@amazon.com" , "igorch@amazon.com" , "chandu@amd.com" , Igor Russkikh , "shepard.siegel@atomicrules.com" , "ed.czeck@atomicrules.com" , "john.miller@atomicrules.com" , "ajit.khaparde@broadcom.com" , "somnath.kotur@broadcom.com" , "Maciej Czekaj [C]" , Shijith Thotton , Srisivasubramanian Srinivasan , Harman Kalra , "rahul.lakkireddy@chelsio.com" , "johndale@cisco.com" , "hyonkim@cisco.com" , "liudongdong3@huawei.com" , "yisen.zhuang@huawei.com" , "xuanziyang2@huawei.com" , "cloud.wangxiaoyun@huawei.com" , "zhouguoyang@huawei.com" , "simei.su@intel.com" , "wenjun1.wu@intel.com" , "qiming.yang@intel.com" , "Yuying.Zhang@intel.com" , "beilei.xing@intel.com" , "xiao.w.wang@intel.com" , "jingjing.wu@intel.com" , "junfeng.guo@intel.com" , "rosen.xu@intel.com" , Nithin Kumar Dabilpuram , Kiran Kumar Kokkilagadda , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Liron Himi , "zr@semihalf.com" , Radha Chintakuntla , Veerasenareddy Burru , Sathesh B Edara , "matan@nvidia.com" , "viacheslavo@nvidia.com" , "longli@microsoft.com" , "spinler@cesnet.cz" , "chaoyong.he@corigine.com" , "niklas.soderlund@corigine.com" , "hemant.agrawal@nxp.com" , "sachin.saxena@oss.nxp.com" , "g.singh@nxp.com" , "apeksha.gupta@nxp.com" , "sachin.saxena@nxp.com" , "aboyer@pensando.io" , Rasesh Mody , Shahed Shaikh , Devendra Singh Rawat , "jiawenwu@trustnetic.com" , "jianwang@trustnetic.com" , "jbehrens@vmware.com" , "maxime.coquelin@redhat.com" , "chenbo.xia@intel.com" , "steven.webster@windriver.com" , "matt.peters@windriver.com" , "bruce.richardson@intel.com" , "mtetsuyah@gmail.com" , "grive@u256.net" , "jasvinder.singh@intel.com" , "cristian.dumitrescu@intel.com" , "jgrajcia@cisco.com" , "mb@smartsharesystems.com" References: <20230112112140.807233-1-adwivedi@marvell.com> <20230120084059.2926575-1-adwivedi@marvell.com> <20230120084059.2926575-3-adwivedi@marvell.com> <614e22c6-8485-0e8d-742e-b3d100f96468@amd.com> <91a635b5-3fe5-b47d-d8ba-44f9b1614bf9@amd.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0107.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::23) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM4PR12MB6664:EE_ X-MS-Office365-Filtering-Correlation-Id: b22501d8-d947-4652-a637-08db051c6885 X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FwV8jrO2adxFsAWRmq3OBzd9tZra7U8IanQ5gF5/sqYTErfchGq6DVYEKAuhe+xRa9cinElV96RaqA6azGRtJqvdfHXSna4Hho0zubm79UjvNblHLF9hpxQUaeQ95Dk9tMe3btm/AXR8DqR4mUiv2I6Y+0MoNLpGAWnsDRuAKedlukvP0X/UE/Fp20tQNccT2zRSGnRKzQ+ZIgHebkpZ6RkO0onKt7ey/fgoMYXNGIM/bptyeKPLSkFDug4qfXweHiSMezQi8UJQIu6FlIjO0kvrTCBk4pMqtaeWl8MVJCwNEZtjL/FeJxHpiluMrWbhdBQkkWn89bqw7U4vLnkJ2QOO8UOa4daJ5di+TYQJEv7wmmd5q4GHFR2g+oc5f5kVYOKNmd21RRtnJ93IamU/kPgKlNeRtCMz81+4MWqzhqUkcFr6HPCVCSY9rRf6d1qPTc9Hdf+9vmcS+Xf5Q6HbdGClwAfXjHI28oKRl2Wz+cWxFOKK2iVfUthMEeO/Qqimbp4x5Ozd4u8jhqL9g1c607wfql0wkKexFinI0UX/PXk7dLBKBpGcSFtrBbykt4qPH8Qoa1PBNmE4J8bQQe1t+l2nMaLnui2vk7HVKGZmowdlvquODoPkgisqJLfeRVteuZGk1sz/W2WauIqs8VDQHFxUaZX2SRnduaOoeAkDlHnvwpKHFMRDT9YflnwLDY/vGbTukdsl6WaXsdrRy5B+iJ2NuXKdBMTANsaPpJqverI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(366004)(136003)(396003)(346002)(39860400002)(451199018)(54906003)(36756003)(83380400001)(6506007)(5660300002)(38100700002)(6666004)(53546011)(110136005)(31696002)(316002)(7366002)(7406005)(7416002)(2906002)(2616005)(86362001)(7336002)(8936002)(41300700001)(186003)(44832011)(6512007)(26005)(4326008)(8676002)(31686004)(478600001)(66556008)(66476007)(66946007)(6486002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZkRRcEp4dXc1LzA1VEV3blFrbThxQ0lrM1N0Unp3TllISTQ3d2JZMXVvNTZF?= =?utf-8?B?VkI5T2Yxd09TTTNuUzJLWFJDeHVpQnBRNWh4cDNPaG5Nd2l5aW1rekcrRlM1?= =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aQU5xV2NGTEpLaWl6aGpTa2FkY1R1TnJFT2VadXc5ODZU?= =?utf-8?B?dCtmMTl3YkluTGMxUDZGZUlZVmZ3SjN3VFRjWk1BZFpPOU9Sc3l3OC9jYi9Y?= =?utf-8?B?U3VqZWZXUHpYNUwyMnQzYUN6OGxoQ2xyRGNyck5pVCtvcHhLZzM3bXlKTkdz?= =?utf-8?B?cFRxWUxwQVVwRmEzeWlESXltcEc0czhZQXA4M1pIQThGdlc1WTdnazZjVml5?= =?utf-8?Q?TKLWdKZcbkDRlDoteuKJJtPP8?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b22501d8-d947-4652-a637-08db051c6885 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 12:52:57.7619 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4h6HoY5D8lglVdZKO0CBm/jzCrcb07+1CFd1VXUzcp/drUDeJCoPWz3KPBfxX2IF X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6664 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/2/2023 10:20 AM, Ankur Dwivedi wrote: >>>>>>> +RTE_TRACE_POINT_FP( >>>>>>> + rte_eth_trace_find_next, >>>>>>> + RTE_TRACE_POINT_ARGS(uint16_t port_id), >>>>>>> + rte_trace_point_emit_u16(port_id); >>>>>>> +) >>>>>>> + >>>>>> >>>>>> Why 'rte_eth_trace_find_next' added as fast path? >>>>>> Can you please add comment for all why it is added as fast path, >>>>>> this help to evaluate/review this later. >>>>> >>>>> There were many functions for which I was not sure about whether >>>>> they >>>> should be slow path or fast path. I made the following assumption: >>>>> >>>>> For slow path I have chosen the function which do some setup, >>>>> configure or >>>> write some configuration. For an example >>>> rte_eth_trace_tx_hairpin_queue_setup, >>>> rte_eth_trace_tx_buffer_set_err_callback, >>>> rte_eth_trace_promiscuous_enable are slow path functions. >>>>> >>>>> The functions which read data are made as fastpath functions. Also >>>>> for >>>> functions for which I was not sure I made it as fastpath. >>>>> >>>>> For an example rte_ethdev_trace_owner_get, >>>> rte_eth_trace_hairpin_get_peer_port, rte_eth_trace_macaddr_get are >>>> made as fastpath. >>>>> >>>>> But there are few exceptions. Function like *_get_capability are >>>>> made as >>>> slowpath. Also rte_ethdev_trace_info_get is slowpath. >>>>> >>>>> The slowpath and fastpath functions are in separate files. >>>> rte_ethdev_trace.h (slowpath) and rte_ethdev_trace_fp.h (fastpath). >>>>> >>>>> Please let me know if any function needs to be swapped. I will make >>>>> that >>>> change. >>>>> >>>> >>>> Got it, I think most of the trace points in the 'rte_ethdev_trace_fp.h' >>>> are for control/helper functions like: >>>> 'rte_ethdev_trace_count_avail', 'rte_ethdev_trace_get_port_by_name', >> 'rte_eth_trace_promiscuous_get' ... >>>> >>>> I thought you did based on some analysis, that is why I asked to add >>>> that reasoning as code comment. >>>> >>>> >>>> I think we can generalize as: >>>> >>>> 1) Anything called by ethdev static inline functions are datapath, >>>> and must be 'RTE_TRACE_POINT_FP', like >>>> 'rte_eth_trace_call_[rt]x_callbacks', >>>> 'rte_ethdev_trace_[rt]x_burst', >>> >>> In this category the following functions come: >>> rte_eth_rx_burst >>> rte_eth_tx_burst >>> rte_eth_call_rx_callbacks (called from rte_eth_rx_burst) >>> rte_eth_call_tx_callbacks (called from rte_eth_tx_burst) >>> rte_eth_tx_buffer_count_callback (registered as error callback, called >>> from rte_eth_tx_buffer_flush) rte_eth_tx_buffer_drop_callback >>> (registered as error callback) >> >> ack >> >>>> >>>> 2) Anything that is called in endless loop in application/sample that >>>> has potential impact although it may not really be datapath >>> >>> Apart from functions in category [1], I have observed the following functions >> in ethdev library, called in some while loop in app/examples. >>> rte_eth_stats_get (called in while loop in examples/qos_sched and >>> examples/distributor) rte_eth_macaddr_get (called in while loop in >>> examples/bond and examples/ethtool) rte_eth_link_get (called in for >>> loop in examples/ip_pipeline) rte_eth_dev_get_mtu (called in for loop >>> in examples/ip_pipeline) rte_eth_link_speed_to_str (called in for loop >>> in examples/ip_pipeline) rte_eth_dev_rx_intr_enable ( called in loop >>> in examples/l3fwd-power) rte_eth_dev_rx_intr_disable ( called in loop >>> in examples/l3fwd-power) rte_eth_timesync_read_rx_timestamp (called in >>> loop in examples/ptpclient) rte_eth_timesync_read_tx_timestamp (called >>> in loop in examples/ptpclient) rte_eth_timesync_adjust_time (called in >>> loop in examples/ptpclient) rte_eth_timesync_read_time (called in loop >>> in examples/ptpclient) rte_flow_classifier_query (called in >>> examples/flow_classify) rte_mtr_create (in app/test-flow-perf loop) >>> rte_mtr_destroy (in app/test-flow-perf loop) >>> rte_mtr_meter_policy_delete ((in app/test-flow-perf loop) >>> rte_flow_create (in app/test-flow-perf) rte_flow_destroy (in >>> app/test-flow-perf) >>> >> >> Ack, and can you please add the note within the parenthesis as a comment, >> whoever visits these later knows why there trace points added as fast path >> trace point? >> >>> Apart from the above can all other functions be moved to slowpath >> tracepoints? >> >> I think yes, we can start with this. >> At least this gives us a logic to follow. >> >> And does trace point and fast path trace points needs to be in separate >> header files? > > I do not think separate header files is a requirement, but it is easy to segregate > slowpath/fastpath if they are in separate files. What do you think ? I think it is not good to expose trace points to user more than we have to, that is why I think better to segregate as public/internal. It is possible to group and comment them as slowpath/fastpath within the internal header.