From patchwork Wed Aug 9 05:06:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simei Su X-Patchwork-Id: 26 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 137E543014; Wed, 9 Aug 2023 06:58:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E13FE40DDB; Wed, 9 Aug 2023 06:58:49 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 1FEFF400D6 for ; Wed, 9 Aug 2023 06:58:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691557128; x=1723093128; h=from:to:cc:subject:date:message-id; bh=QqYCSlZmCFWKaGOiaKq1Xki4WHfOwzCLI1+dv7eSYGI=; b=NHrlejaPfN/bs2m9p/N6w/8bzLZ7vZhtmjBGx2clmL0ld0GKozh1NUK4 oLgltDglvDMoKfXytTHUxojCdJVxYDBet+DW9is3Hh+P/UmDW8mQnVYuS vPnPnqjObXml5ffVS73D1XyvoF/ocamr9v6m4B5ymY+lpRTZ4woPg4Soe 2Pui7q2Sm7ibNzNlxBPs5ipsh+rzgWjc2hj7QVKdkmwM4eIlznIXYb3n9 sRd1KvgZpaq1r2L8VXiowNHpHpyA9I4xACvxSDr7HGQOHwhz1AVMr945S kPYsPYawLyWOnJNIE+XdhZH5lXbHhS4oguoDon7SrLvt35yixy1hs84i5 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="351329505" X-IronPort-AV: E=Sophos;i="6.01,158,1684825200"; d="scan'208";a="351329505" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 21:58:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="821684805" X-IronPort-AV: E=Sophos;i="6.01,158,1684825200"; d="scan'208";a="821684805" Received: from unknown (HELO npg-dpdk-simeisu-cvl-119d218.sh.intel.com) ([10.67.119.108]) by FMSMGA003.fm.intel.com with ESMTP; 08 Aug 2023 21:58:45 -0700 From: Simei Su To: thomas@monjalon.net, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, kirill.rybalchenko@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, wenjun1.wu@intel.com, Simei Su Subject: [PATCH 0/3] add frequency adjustment support for PTP timesync Date: Wed, 9 Aug 2023 13:06:57 +0800 Message-Id: <20230809050700.271534-1-simei.su@intel.com> X-Mailer: git-send-email 2.9.5 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 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. (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. 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 [1/3] ethdev: add frequency adjustment API. [2/3] examples/ptpclient: refine application. [3/3] examples/ptpclient: add frequency adjustment support. 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(-)