After starting the timestamping block, hardware begins calculating precise offsets through a process of vernier calibration. This process measures the effective phase offset of the various internal clocks used in the PHY. Once hardware completes these measurements, the P_REG_TX_OV_STATUS and P_REG_RX_OV_STATUS registers are updated to indicate that the hardware offset measurements are done. This process does not happen immediately, but requires that at least one packet be sent or received in order for the offset in that direction to be calculated. This poses a problem in some setups, because software expects the first packet sent to be timestamped. This most often occurs if the clock time is set by an application during startup. This set time command triggers a PHY restart. Because of this, the timestamping block is reset, and timestamps are not enabled until vernier calibration is complete. Since this process won't complete until at least one packet is sent through the PHY, timestamps of the very first packet sent will not be obtained. This can result in the application failing due to missing timestamps. To avoid this, allow starting the PHY in bypass mode. This mode enables timestamps immediately, and skips adding the precise offset measurement. This reduces the accuracy of the timestamp slightly, but ensures that we get a reasonable value for the first packet. The driver can continue monitoring the P_REG_TX_OV_STATUS and P_REG_RX_OV_STATUS registers and exit bypass mode once the total calibration is completed. In this way, once calibration is complete, the timestamps will have the precise offset, but we do not break applications which expect to be able to timestamp immediately. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> Acked-by: Junfeng Guo <junfeng.guo@intel.com>
DPDK is a set of libraries and drivers for fast packet processing. It supports many processor architectures and both FreeBSD and Linux. The DPDK uses the Open Source BSD-3-Clause license for the core libraries and drivers. The kernel components are GPL-2.0 licensed. Please check the doc directory for release notes, API documentation, and sample application information. For questions and usage discussions, subscribe to: users@dpdk.org Report bugs and issues to the development mailing list: dev@dpdk.org
Description
Languages
C
99.1%
Meson
0.5%
Python
0.2%
Shell
0.1%