[dpdk-dev] [PATCH 11/28] net/ice/base: add support for starting PHY in bypass mode

Guo, Junfeng junfeng.guo at intel.com
Tue Aug 10 06:39:26 CEST 2021



> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang at intel.com>
> Sent: Tuesday, August 10, 2021 10:51
> To: Yang, Qiming <qiming.yang at intel.com>
> Cc: Guo, Junfeng <junfeng.guo at intel.com>; dev at dpdk.org; Zhang, Qi Z
> <qi.z.zhang at intel.com>; Keller, Jacob E <jacob.e.keller at intel.com>
> Subject: [PATCH 11/28] net/ice/base: add support for starting PHY in
> bypass mode
> 
> 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 at intel.com>
> Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
> ---
>  drivers/net/ice/base/ice_ptp_hw.c | 84
> +++++++++++++++++++++++++++++++
>  drivers/net/ice/base/ice_ptp_hw.h |  1 +
>  2 files changed, 85 insertions(+)
> 
> --
> 2.26.2

Acked-by: Junfeng Guo <junfeng.guo at intel.com>

Regards,
Junfeng Guo


More information about the dev mailing list