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 A77E345AF5; Fri, 11 Oct 2024 21:37:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72B4E4028E; Fri, 11 Oct 2024 21:37:58 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2079.outbound.protection.outlook.com [40.107.243.79]) by mails.dpdk.org (Postfix) with ESMTP id 59A704028B for ; Fri, 11 Oct 2024 21:37:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GU/7rzjO0aG92kR7plBLsRPnex5/Ie4HOLNEgpmdzfB3aK0rQpLB0EyiEarJ1ZUjcjoI76+KwyD243d3bycv+21Yq53Y4CRWHjin6pbhwswcOvVQHpBmFoAor7fbGKBH0heqNGdV8XtmcyR5OHfpi0jvvj8Ac5jIv9dDlS83KHoFQKwy/3KB0hywjNey37TqbFAXP+pnCxVy0k9THsSUGT/WmxNQD42/dBLfgiBrItkJK/9t+lhSQidClwiH7gD9qUlK+/HSVxKOmPKtLMqkKDF2kR83ZTrAYA8X0H8KebhSXz1O/0BGMWxrbt52caae78UHE9pxfJhmytCtbXX1sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=0s9kyd1WNrNJKi64V58y8bE8m7qz3p340huFXEXKayc=; b=wqMJ8M0sOzRyJyStGhCSVqbSzzdnT0ux6wLMP6rFMAPbkStMK6JwGv5CuEhuZhop/DKxO000DiI74EhbweN6YnZZ0+tDTUku+O4OnhQKYiYf9S1JD8Z1kBgAxvXwMt6NZm9pvEWpvAa++s4hqx/E4ckzd2zV2vAHK5DCRoT9V+u5r4LcU6u3KZ0TIuGq03jvhTLkKWKfZUpALv8LYKomNDqIa316XqUYq47Ut+Fl2igsfr0Wj9sXMG3VaRUyl/PyEg4kdsNA++e5/mxwx+ZtL3oZYqwsQOYtTaH6r2Z69icUxl7rxq2GP0YsNg1G6+1+DRYaRM3TTjZXmptbVUxFFw== 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=0s9kyd1WNrNJKi64V58y8bE8m7qz3p340huFXEXKayc=; b=eNQPblssEMJMzb08DhHuuFD68yBMdTlzBKF2o9O+TrpUWXtYd4qqdDzY7d4zVfivvDpMuSMTJEN4v1PUGuH4VAQhyesg2B3Lahu0Ctqv8hzFzMuJrWkWDZNPMiRryJbLNNbIo4ckTB1n8YoPsmUwd40o3dZGvebJad84ga13utA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) by PH7PR12MB8121.namprd12.prod.outlook.com (2603:10b6:510:2b5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Fri, 11 Oct 2024 19:37:51 +0000 Received: from SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055]) by SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055%4]) with mapi id 15.20.8048.017; Fri, 11 Oct 2024 19:37:51 +0000 Message-ID: <05866089-c1a8-453d-9873-9b9020fb6a24@amd.com> Date: Fri, 11 Oct 2024 20:37:45 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 3/3] examples/ptpclient: add frequency adjustment To: Mingjin Ye , dev@dpdk.org Cc: Simei Su , Wenjun Wu , Kirill Rybalchenko References: <20241011025332.1423395-1-mingjinx.ye@intel.com> <20241011063407.1427421-1-mingjinx.ye@intel.com> <20241011063407.1427421-4-mingjinx.ye@intel.com> Content-Language: en-US From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhB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UMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20241011063407.1427421-4-mingjinx.ye@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P302CA0003.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c2::10) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|PH7PR12MB8121:EE_ X-MS-Office365-Filtering-Correlation-Id: d9b0a9a6-0e5a-4d16-348c-08dcea2c31b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?a3RVdU1vYmluTzZ5d3FUQjFaZTNjTzdoQ25hZkNNRTJVMGlTbEI2OEE3d1Uw?= =?utf-8?B?eWo0Mks5YW50VUgyR0hsL1J4SGFhUW9FRDAzWDE5L3MzRE9kdzQvNys4Y0o3?= =?utf-8?B?ZGRydUhLUDdHKzRybk1aLzFYM1R5L2hIQnZzVWhremQrblJScUJDNnpwVWJl?= =?utf-8?B?SkdGN29wREJlM0Jrc2Nva3dTTWN4QkYvczlmTHNEY1IzaTFyNFlycmhIbk42?= =?utf-8?B?YldMY0wweTByN0orNjh6UlA0S3ZvUVF3MWtqVEZ6T2xLMHFJbTBhSnRoRkhM?= =?utf-8?B?SSsvcDI5a2RNMG4yM2NWYjFnYy9ySkhMandDeGFYS3ZoTjVQN2lWdlNhTW9o?= =?utf-8?B?RlpTVlN4NldwUzRQK2dZSjdLK3I5RzFNcFpLN283SWMwTjlhNGN3U3NKcEYv?= =?utf-8?B?QkROc2RFUFhreUNQRkxvM3p5cVN1blQxaXRta0xrakVnVk1MVlArQ1kvZ0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UxTb0NpeEZZcGJ1aXNkenJp?= =?utf-8?B?N1VzQ21rcXRVV1BqMFZoRkRMUTBycXJWd21NZEV2Nm1vTzRkdnNqYXZFMDVk?= =?utf-8?B?c0FxVHRCaVBnUk1ZODk4R1lmb0JsMHF3UDNnL0J3OGhUaVJwYW45RFZId1pi?= =?utf-8?B?RngxbXFqTXpmOFVBc3pvc1hMczJMZFBGd3FqMVFFUnNibmQzczczVGYvRHF2?= =?utf-8?B?UU56VUZnNjRqRlZmLzA0K3pLODhtZzdobHJ3KzE1QytZM3FDQ3F3WXZzRDhY?= =?utf-8?B?VEdvUGYrWmRnMFQzbkxRMkg3Y3VJUFFlNHhhMkJYcks2ZkxRZitGNEZYOXVV?= =?utf-8?B?WHVPTXdVTzFMMVVoakEzTjFRczFUMmRPWXdPcDFBcS9rYWJQTEU1aXhBPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR12MB8830.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?L0JHQ1FjWDRrTDI0LzhadGpiZVhvR2w4NjlDTFlPK1Awd0FiRlNiMmlUa3Ra?= =?utf-8?B?cnVQWHRzZTQvSVpBTjRMZnVoYjM2cG5tWVFSUUM3RTVxLzR3eUo5UFNRMlZF?= =?utf-8?B?OFliQVFzQ2xzVDkzczF2Z2JaMCtHeGNERHFZYXVrYkdNS0dSdVZBdTVLOUlq?= =?utf-8?B?NG9LWS9Pb2tXYjdOUkVmemdUTFd3Q1d2T091QTF0eDJFVmlwRWN0RFZqdFJ4?= =?utf-8?B?WUNOclRJeWlsMGtFclpMREROUk1FMjRjZjhTejNNTkRseitOSGx1RlUxdm9H?= =?utf-8?B?aWNNUlhwSHNDcXRmM051MWhrdjZ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=?utf-8?Q?5a4k+oaafoUJ9jKR4sFsm9oTg?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9b0a9a6-0e5a-4d16-348c-08dcea2c31b0 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 19:37:51.3997 (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: 0Sx9z2u9nAhxYpFL/hEP7DTKFw2wSkPJy+oB6WeLDITIOItK0FJYw18Osr1DIa59 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8121 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 10/11/2024 7:34 AM, Mingjin Ye wrote: > This patch adds PI servo controller to support frequency > adjustment API for IEEE1588 PTP. > > For example, the command for starting ptpclient with PI controller is: > dpdk-ptpclient -a 0000:81:00.0 -c 1 -n 3 -- -T 0 -p 0x1 -c 1 > > Signed-off-by: Simei Su > Signed-off-by: Wenjun Wu > Signed-off-by: Mingjin Ye > --- > doc/guides/sample_app_ug/ptpclient.rst | 12 +- > examples/ptpclient/ptpclient.c | 284 +++++++++++++++++++++++-- > 2 files changed, 274 insertions(+), 22 deletions(-) > > diff --git a/doc/guides/sample_app_ug/ptpclient.rst b/doc/guides/sample_app_ug/ptpclient.rst > index d47e942738..89fe575b5f 100644 > --- a/doc/guides/sample_app_ug/ptpclient.rst > +++ b/doc/guides/sample_app_ug/ptpclient.rst > @@ -50,6 +50,10 @@ The adjustment for slave can be represented as: > If the command line parameter ``-T 1`` is used the application also > synchronizes the PTP PHC clock with the Linux kernel clock. > > +If the command line parameter ``-c 1`` is used, the application will also > +use the servo of the local clock. Only one type of servo is currently > +implemented, the PI controller. Default 0 (not used). > + > Compiling the Application > ------------------------- > > @@ -65,7 +69,7 @@ To run the example in a ``linux`` environment: > > .. code-block:: console > > - .//examples/dpdk-ptpclient -l 1 -n 4 -- -p 0x1 -T 0 > + .//examples/dpdk-ptpclient -l 1 -n 4 -- -p 0x1 -T 0 -c 1 > > Refer to *DPDK Getting Started Guide* for general information on running > applications and the Environment Abstraction Layer (EAL) options. > @@ -73,7 +77,13 @@ applications and the Environment Abstraction Layer (EAL) options. > * ``-p portmask``: Hexadecimal portmask. > * ``-T 0``: Update only the PTP slave clock. > * ``-T 1``: Update the PTP slave clock and synchronize the Linux Kernel to the PTP clock. > +* ``-c 0``: Not used clock servo controller. > +* ``-c 1``: The clock servo PI controller is used and the log will print information > + about "master offset". > > +Also, by adding ``-T 1`` and ``-c 1`` , the ``master offset`` value printed in the > +log will slowly converge and eventually stabilise at the nanosecond level. The > +synchronisation accuracy is much higher compared to not using a servo controller. > What is this new feature / argument dependency to the new 'rte_eth_timesync_adjust_freq()' API? Right now only one PMD supports it, should application check the support of the API when -c parameter provided, and fail it if is not supported? > Code Explanation > ---------------- > diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c > index afb61bba51..dea8d9d54a 100644 > --- a/examples/ptpclient/ptpclient.c > +++ b/examples/ptpclient/ptpclient.c > @@ -46,6 +46,35 @@ static volatile bool force_quit; > #define KERNEL_TIME_ADJUST_LIMIT 20000 > #define PTP_PROTOCOL 0x88F7 > > +#define KP 0.7 > +#define KI 0.3 > +#define FREQ_EST_MARGIN 0.001 > + > +enum servo_state { > + SERVO_UNLOCKED, > + SERVO_JUMP, > + SERVO_LOCKED, > +}; > + > +struct pi_servo { > + double offset[2]; > + double local[2]; > + double drift; > + double last_freq; > + int count; > + > + double max_frequency; > + double step_threshold; > + double first_step_threshold; > + int first_update; > +}; > + > +enum controller_mode { > + MODE_NONE, > + MODE_PI, > + MAX_ALL > +} mode = MODE_NONE; > + > struct rte_mempool *mbuf_pool; > uint32_t ptp_enabled_port_mask; > uint8_t ptp_enabled_port_nb; > @@ -135,6 +164,9 @@ struct ptpv2_data_slave_ordinary { > uint8_t ptpset; > uint8_t kernel_time_set; > uint16_t current_ptp_port; > + int64_t master_offset; > + int64_t path_delay; > + struct pi_servo *servo; > }; > > static struct ptpv2_data_slave_ordinary ptp_data; > @@ -293,36 +325,44 @@ print_clock_info(struct ptpv2_data_slave_ordinary *ptp_data) > ptp_data->tstamp3.tv_sec, > (ptp_data->tstamp3.tv_nsec)); > > - printf("\nT4 - Master Clock. %lds %ldns ", > + printf("\nT4 - Master Clock. %lds %ldns\n", > ptp_data->tstamp4.tv_sec, > (ptp_data->tstamp4.tv_nsec)); > > - printf("\nDelta between master and slave clocks:%"PRId64"ns\n", > + if (mode == MODE_NONE) { > + printf("\nDelta between master and slave clocks:%"PRId64"ns\n", > ptp_data->delta); > > - clock_gettime(CLOCK_REALTIME, &sys_time); > - rte_eth_timesync_read_time(ptp_data->current_ptp_port, &net_time); > + clock_gettime(CLOCK_REALTIME, &sys_time); > + rte_eth_timesync_read_time(ptp_data->current_ptp_port, > + &net_time); > > - time_t ts = net_time.tv_sec; > + time_t ts = net_time.tv_sec; > > - printf("\n\nComparison between Linux kernel Time and PTP:"); > + printf("\n\nComparison between Linux kernel Time and PTP:"); > > - printf("\nCurrent PTP Time: %.24s %.9ld ns", > + printf("\nCurrent PTP Time: %.24s %.9ld ns", > ctime(&ts), net_time.tv_nsec); > > - nsec = (int64_t)timespec64_to_ns(&net_time) - > + nsec = (int64_t)timespec64_to_ns(&net_time) - > (int64_t)timespec64_to_ns(&sys_time); > - ptp_data->new_adj = ns_to_timeval(nsec); > + ptp_data->new_adj = ns_to_timeval(nsec); > > - gettimeofday(&ptp_data->new_adj, NULL); > + gettimeofday(&ptp_data->new_adj, NULL); > > - time_t tp = ptp_data->new_adj.tv_sec; > + time_t tp = ptp_data->new_adj.tv_sec; > > - printf("\nCurrent SYS Time: %.24s %.6ld ns", > - ctime(&tp), ptp_data->new_adj.tv_usec); > + printf("\nCurrent SYS Time: %.24s %.6ld ns", > + ctime(&tp), ptp_data->new_adj.tv_usec); > > - printf("\nDelta between PTP and Linux Kernel time:%"PRId64"ns\n", > - nsec); > + printf("\nDelta between PTP and Linux Kernel time:%"PRId64"ns\n", > + nsec); > + } > + > + if (mode == MODE_PI) { > + printf("path delay: %"PRId64"ns\n", ptp_data->path_delay); > + printf("master offset: %"PRId64"ns\n", ptp_data->master_offset); > + } > > printf("[Ctrl+C to quit]\n"); > > @@ -529,6 +569,149 @@ update_kernel_time(void) > > } > > +static void > +clock_path_delay(struct ptpv2_data_slave_ordinary *ptp_data) > +{ > + uint64_t t1_ns, t2_ns, t3_ns, t4_ns; > + int64_t pd, diff; > + > + t1_ns = timespec64_to_ns(&ptp_data->tstamp1); > + t2_ns = timespec64_to_ns(&ptp_data->tstamp2); > + t3_ns = timespec64_to_ns(&ptp_data->tstamp3); > + t4_ns = timespec64_to_ns(&ptp_data->tstamp4); > + > + pd = (t2_ns - t3_ns) + (t4_ns - t1_ns); > + diff = t3_ns - t2_ns; > + if (diff <= INT32_MAX && diff >= INT32_MIN) > + ptp_data->path_delay = pd / 2; > + else > + ptp_data->path_delay = 0; > +} > + > +static double > +pi_sample(struct pi_servo *s, int64_t offset, double local_ts, > + enum servo_state *state) > +{ > + double ki_term, ppb = s->last_freq; > + double freq_est_interval, localdiff; > + > + switch (s->count) { > + case 0: > + s->offset[0] = offset; > + s->local[0] = local_ts; > + *state = SERVO_UNLOCKED; > + s->count = 1; > + break; > + case 1: > + s->offset[1] = offset; > + s->local[1] = local_ts; > + > + /* Make sure the first sample is older than the second. */ > + if (s->local[0] >= s->local[1]) { > + *state = SERVO_UNLOCKED; > + s->count = 0; > + break; > + } > + > + /* Wait long enough before estimating the frequency offset. */ > + localdiff = (s->local[1] - s->local[0]) / 1e9; > + localdiff += localdiff * FREQ_EST_MARGIN; > + freq_est_interval = 0.016 / KI; > + if (freq_est_interval > 1000.0) > + freq_est_interval = 1000.0; > + > + if (localdiff < freq_est_interval) { > + *state = SERVO_UNLOCKED; > + break; > + } > + > + /* Adjust drift by the measured frequency offset. */ > + s->drift += (1e9 - s->drift) * (s->offset[1] - s->offset[0]) / > + (s->local[1] - s->local[0]); > + > + if (s->drift < -s->max_frequency) > + s->drift = -s->max_frequency; > + else if (s->drift > s->max_frequency) > + s->drift = s->max_frequency; > + > + if ((s->first_update && > + s->first_step_threshold && > + s->first_step_threshold < llabs(offset)) || > + (s->step_threshold && > + s->step_threshold < llabs(offset))) > + *state = SERVO_JUMP; > + else > + *state = SERVO_LOCKED; > + > + ppb = s->drift; > + s->count = 2; > + break; > + case 2: > + /* > + * reset the clock servo when offset is greater than the max > + * offset value. Note that the clock jump will be performed in > + * step 1, so it is not necessary to have clock jump > + * immediately. This allows re-calculating drift as in initial > + * clock startup. > + */ > + if (s->step_threshold && > + s->step_threshold < llabs(offset)) { > + *state = SERVO_UNLOCKED; > + s->count = 0; > + break; > + } > + > + ki_term = KI * offset; > + ppb = KP * offset + s->drift + ki_term; > + if (ppb < -s->max_frequency) > + ppb = -s->max_frequency; > + else if (ppb > s->max_frequency) > + ppb = s->max_frequency; > + else > + s->drift += ki_term; > + > + *state = SERVO_LOCKED; > + break; > + } > + > + s->last_freq = ppb; > + return ppb; > +} > + > +static void > +ptp_adjust_servo(struct ptpv2_data_slave_ordinary *ptp_data) > +{ > + uint64_t t1_ns, t2_ns; > + double adj_freq; > + enum servo_state state = SERVO_UNLOCKED; > + > + t1_ns = timespec64_to_ns(&ptp_data->tstamp1); > + t2_ns = timespec64_to_ns(&ptp_data->tstamp2); > + ptp_data->master_offset = t2_ns - t1_ns - ptp_data->path_delay; > + if (!ptp_data->path_delay) > + return; > + > + adj_freq = pi_sample(ptp_data->servo, ptp_data->master_offset, t2_ns, > + &state); > + > + switch (state) { > + case SERVO_UNLOCKED: > + break; > + case SERVO_JUMP: > + ptp_data->servo->first_update = 0; > + rte_eth_timesync_adjust_freq(ptp_data->portid, > + -(long)(adj_freq * 65.536)); > + rte_eth_timesync_adjust_time(ptp_data->portid, > + -ptp_data->master_offset); > + break; > + case SERVO_LOCKED: > + ptp_data->servo->first_update = 0; > + rte_eth_timesync_adjust_freq(ptp_data->portid, > + -(long)(adj_freq * 65.536)); > + break; > + } > +} > + > /* > * Parse the DELAY_RESP message. > */ > @@ -553,11 +736,16 @@ parse_drsp(struct ptpv2_data_slave_ordinary *ptp_data) > ((uint64_t)ntohl(rx_tstamp->sec_lsb)) | > (((uint64_t)ntohs(rx_tstamp->sec_msb)) << 32); > > - /* Evaluate the delta for adjustment. */ > - ptp_data->delta = delta_eval(ptp_data); > + if (mode == MODE_PI) { > + clock_path_delay(ptp_data); > + ptp_adjust_servo(ptp_data); > + } else { > + /* Evaluate the delta for adjustment. */ > + ptp_data->delta = delta_eval(ptp_data); > > - rte_eth_timesync_adjust_time(ptp_data->portid, > - ptp_data->delta); > + rte_eth_timesync_adjust_time(ptp_data->portid, > + ptp_data->delta); > + } > > ptp_data->current_ptp_port = ptp_data->portid; > > @@ -652,7 +840,9 @@ print_usage(const char *prgname) > printf("%s [EAL options] -- -p PORTMASK -T VALUE\n" > " -T VALUE: 0 - Disable, 1 - Enable Linux Clock" > " Synchronization (0 default)\n" > - " -p PORTMASK: hexadecimal bitmask of ports to configure\n", > + " -p PORTMASK: hexadecimal bitmask of ports to configure\n" > + " -c CONTROLLER: 0 - Not used, 1 - PI. The servo which is" > + " used to synchronize the local clock. (0 default)\n", > prgname); > } > > @@ -688,6 +878,36 @@ parse_ptp_kernel(const char *param) > return 1; > } > > +static int > +parse_ptp_servo_mode(const char *param) > +{ > + char *end = NULL; > + unsigned long pm; > + > + /* Parse the hexadecimal string. */ > + pm = strtoul(param, &end, 10); > + > + if ((param[0] == '\0') || (end == NULL) || (*end != '\0')) > + return -1; > + > + return pm; > +} > + > +static void > +servo_init(struct pi_servo *servo) > +{ > + memset(servo, 0x00, sizeof(*servo)); > + > + servo->drift = 100000000; > + servo->last_freq = 100000000; > + servo->count = 0; > + > + servo->max_frequency = 100000000; > + servo->step_threshold = 0.1 * NSEC_PER_SEC; > + servo->first_step_threshold = 0.00002 * NSEC_PER_SEC; > + servo->first_update = 1; > +} > + > /* Parse the commandline arguments. */ > static int > ptp_parse_args(int argc, char **argv) > @@ -700,7 +920,7 @@ ptp_parse_args(int argc, char **argv) > > argvopt = argv; > > - while ((opt = getopt_long(argc, argvopt, "p:T:", > + while ((opt = getopt_long(argc, argvopt, "p:T:c:", > lgopts, &option_index)) != EOF) { > > switch (opt) { > @@ -724,6 +944,17 @@ ptp_parse_args(int argc, char **argv) > > ptp_data.kernel_time_set = ret; > break; > + case 'c': > + ret = parse_ptp_servo_mode(optarg); > + if (ret == 0) { > + mode = MODE_NONE; > + } else if (ret == 1) { > + mode = MODE_PI; > + } else { > + print_usage(prgname); > + return -1; > + } > + break; > > default: > print_usage(prgname); > @@ -778,6 +1009,14 @@ main(int argc, char *argv[]) > rte_exit(EXIT_FAILURE, "Error with PTP initialization\n"); > /* >8 End of parsing specific arguments. */ > > + if (mode == MODE_PI) { > + ptp_data.servo = malloc(sizeof(*(ptp_data.servo))); > + if (!ptp_data.servo) > + rte_exit(EXIT_FAILURE, "no memory for servo\n"); > + > + servo_init(ptp_data.servo); > + } > + > /* Check that there is an even number of ports to send/receive on. */ > nb_ports = rte_eth_dev_count_avail(); > > @@ -831,6 +1070,9 @@ main(int argc, char *argv[]) > rte_eth_dev_close(portid); > } > > + if (mode == MODE_PI) > + free(ptp_data.servo); > + > /* clean up the EAL */ > rte_eal_cleanup(); >