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 6633D42C12; Fri, 2 Jun 2023 21:44:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BEB440ED8; Fri, 2 Jun 2023 21:44:34 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2052.outbound.protection.outlook.com [40.107.102.52]) by mails.dpdk.org (Postfix) with ESMTP id CAFCF406B8 for ; Fri, 2 Jun 2023 21:44:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RU5jhy1X/MpkNe+BudQ2piRvcIDiYjNfvv4qd96bZUyvGcVO4Be9/C7YAZA9orpMT+xEQoRmM6d7Q6dUccyZHSwlDQ2+7sedqt7cKhY8svXYdGweoIUb1QVluShrGt2DY4uJA37o8goKvDUOeqOwzfsnyMCZPyUo7o7RwqrjFbBSf5KvVQhGX8ALcECbmsbX9tcACwRMk0RTWGWwVsnjXOhuIebi/TIbuvdMrKCmFL649ua2Br32Aj+McXU9Cg6FoFdQPCQk7BFyLzUAPeqLgicafIFoU0wGppnVqXAO9VZgNM6SXjAmCq/ya9v7bH2oFOFrzJecpdbdmDozdbT17w== 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=kSUwXerLnLBXpQgTSzdus1kmfVeaye/2GYuDeRI4Kz4=; b=XPt0ouxdIaxbMvn98rVBCI26ADqocKRcqLUYbrNhDJ/UZRgVJntfN8r4++coUitiKnpfEzpzQgNwbUWrQIdRTdi+HpjDzIJzg9P2/6qcvH5Owcep6REJiLqbTB9BwPRXccNbgX+h2xGUOkYwcORBCZ4QvplXFv725F1bC9O6F4LD30gZT54KPD8iXV7PtbUqK6oTzowZgS2474hwsNK58bfg0ZCY60KPPlbS5PcMFzc6Cj0fc8cez2FTiB7eDsRZlZzq2HjI8NE+PM4ETGAekYETx8JDvElddrbamjZ2nWTkLoTha7FyOKYCaxO97GPuD55Sbpy3NFsoxjEO/2Yhmw== 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=kSUwXerLnLBXpQgTSzdus1kmfVeaye/2GYuDeRI4Kz4=; b=DPDIcVclMwKVvJ+nqOMB7sPqPiJtCoowLum4S3kuTVKfrMTk/T+j0sEmDVoF2sU95BbBs4LFq2SVp3VtTw7gf4hTt+zq5REHRhb6p7c7Jt2sgDip7z5Pe2KgVHBUNQxnV4ljCL0QeG4rVJFwtigOvd+yAXNXJolJ3DKCNOezR+A= 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 MW4PR12MB6975.namprd12.prod.outlook.com (2603:10b6:303:20a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.23; Fri, 2 Jun 2023 19:44:29 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a%4]) with mapi id 15.20.6433.022; Fri, 2 Jun 2023 19:44:28 +0000 Message-ID: Date: Fri, 2 Jun 2023 20:44:21 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Content-Language: en-US To: Simei Su , thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, kirill.rybalchenko@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, wenjun1.wu@intel.com References: <20230403092248.81551-1-simei.su@intel.com> <20230522132332.102030-1-simei.su@intel.com> From: Ferruh Yigit Subject: Re: [RFC v3 0/3] add frequency adjustment support for PTP timesync In-Reply-To: <20230522132332.102030-1-simei.su@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P265CA0010.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:339::7) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MW4PR12MB6975:EE_ X-MS-Office365-Filtering-Correlation-Id: b6c3682c-8e12-41b7-cd3a-08db63a1c69e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JqQ2YXTlMGqBAo/bMH6P5TCYdCROwFiobG3KnwSGN/B8oTc9yuuadsIH00JUaW3OBOqul1d+tNGPAiDTs7JwjtUNZQI6QWRLHDUq3XiJr0cbnkhnHVYq6mbV0bN778fClJYbh5ZCssJ2ofkjS8XeBTb8UTGvc0nkQfM0YnHcwX3Do7n1JtfIP+l7txe1sXAp2lgk410yJXMcdaCRIyxvUv+Dk1iNiBmRZMM+y69HCdFSjwcGzcYyDJkNBh//U4pRtUzCKB+Qt5I22ketv3T5Zfh7RQ/6ankSxgKxTGkKG8C46IuSdNXawAgS49bHEtwiY+mo26yFdL5iNlc9OJZHrLvF5vtVUeZNgDzw0+fX0I4ZXXxvmjg+UYdV/vcmsIwDuJ7mdbUhAWzmKkgc33KoAQmekLNnQf9FxCnmtCOJMG51Wkw2tFRjCzYoOM2sWsrIxUWM/sELMYqcOzi/L/7cjTEswburjirQlTlTgzvc2pjoRFxI4K4IMnyMh2v3Gx68FxGdvh35JKM13f/g2nnTU8TqgTGDd50RI+682x1ar2/sbJtazY5m64Pl4jiPH/awR9cgxXt5+h0QzwKXCy7r8xqsIqK0ZuCCPZ8QDaK0Wb3LVy/JtAAqh0ulQsckofirs3Xvi7c3GXHp0RdJnq0TAw== 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:(13230028)(4636009)(396003)(136003)(376002)(39860400002)(346002)(366004)(451199021)(83380400001)(186003)(2616005)(6666004)(4326008)(6486002)(66476007)(478600001)(66556008)(316002)(66946007)(2906002)(26005)(6512007)(6506007)(44832011)(5660300002)(53546011)(8676002)(41300700001)(8936002)(38100700002)(36756003)(31696002)(86362001)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Z1d0R0dDSldJdkdIb3RoL3pWYlNmTzl4cUN6Um1YZ3pFZ2dSQURXZmhtblJq?= =?utf-8?B?bklGM2k0QkV4dEhjeG4vbGtkcGJPL0MwRVZMc3JsMm1Oa1hBQm9GZWd6Yjhi?= =?utf-8?B?ZWZicUMweWswcGlFaEo0Q1hNT1RpWXRwU1g5VkNUYldrVVVxMlZTUSsxelJm?= =?utf-8?B?R0hkd1RYcUJmb25KL1RQZ1I4OHVZbkV1RlMzNlF6eVF1T0hQN3g1bys3Qm9T?= =?utf-8?B?T2w5WklXeDJxU1ozS2labEg0ck40M1FiSkxhSVorU2NIWk4xaXo1TEhCMW1J?= =?utf-8?B?VXhORzNIWUduNmRHczVKRjI2eGR3Qk05Q3I5YU5jcjVBRmdSZ0VUcVlUVDl3?= =?utf-8?B?TzJ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f?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6c3682c-8e12-41b7-cd3a-08db63a1c69e X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2023 19:44:27.9649 (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: pM9xohQdKVEmgL+Wrgu7nAgkRMfMFoD+I971KwGEZYfrUV/UR1RoU77iOdiEdWEX X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6975 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 5/22/2023 2:23 PM, Simei Su wrote: > This patchset cover below parts: > (1)Introduce a new timesync API called "rte_eth_timesync_adjust_freq" that > enables frequency adjustment during PTP timesync. This new API aligns with > the kernel PTP which already supports frequency adjustment. It brings DPDK > closer in alignment with the kernel's best practice. > Hi Simei, I am not expert on PTP, so please help me understand, I can see there is a new API to update device frequency by updating device clock, 'rte_eth_timesync_adjust_fine()', that part is OK. (Although I have some reservation with the API name, we can visit it later.) PTP doesn't enforce any specific sync method, right? Like adjusting by adding/subtracting or adjusting by updating clock frequency. As far as I understand updating device clock frequency is HW capability to adjust time, perhaps in a finer grain, is this correct? If so, is this HW capability should be exposed to user with a new API? If this is a generic HW capability, I think it is OK to have single responsibility API, but if this is a vendor specific feature it should be behind a generic API. Or should we hide this capability behind existing 'rte_eth_timesync_adjust_time()' API, and HW/driver use best possible method for synchronization, so this can be transparent the user. What is the benefit to make user selected explicitly one option or other? > (2)Refine the ptpclient application by applying a PI algorithm that leverages > the new API to further improve timesync accuracy. These changes doesn't break > original solution and creates a more accurate solution for DPDK-based high > accuracy PTP. We have provided significant improvements for timesync accuracy > on e810 and we believe these improvements will also benefit other devices. > What is "PI algorithm"? and what PI stands for? > The original command for starting ptpclient is: > ./build/examples/dpdk-ptpclient -a 0000:81:00.0 -c 1 -n 3 -- -T 0 -p 0x1 > > The command with PI algorithm is: > ./build/examples/dpdk-ptpclient -a 0000:81:00.0 -c 1 -n 3 -- -T 0 -p 0x1 -- controller=pi > > [RFC v3 1/3] ethdev: add frequency adjustment API. > [RFC v3 2/3] examples/ptpclient: refine application. > [RFC v3 3/3] examples/ptpclient: add frequency adjustment support. > > v3: > * Refine commit log in patch. > * Add more description for the new API. > > v2: > * Remove the ice PMD part from the RFC. > * Add description in cover letter. > * Refine commit log in patch. > > Simei Su (3): > ethdev: add frequency adjustment API > examples/ptpclient: refine application > examples/ptpclient: add frequency adjustment support > > examples/ptpclient/ptpclient.c | 222 +++++++++++++++++++++++++++++++++------ > lib/ethdev/ethdev_driver.h | 5 + > lib/ethdev/ethdev_trace.h | 9 ++ > lib/ethdev/ethdev_trace_points.c | 3 + > lib/ethdev/rte_ethdev.c | 19 ++++ > lib/ethdev/rte_ethdev.h | 38 +++++++ > 6 files changed, 265 insertions(+), 31 deletions(-) >