On 9/24/2021 7:57 AM, PATRICK KEROULAS wrote: > Hello, > > I'm running ptp4l as a slave in a VM on a ESXi host to sync with a > master running > on a separated device. With the default VMNET as a virtual NIC attached > to the VM, > /dev/ptp* didn't show up in the VM. So I replaced VMNET with the more > promising e1000e. > However, ptp clock appears to be malfunctioning. Here are the symptoms. > * ptp4l and phc2sys doesn't complain but reports ridiculously high values > [...] > ptp4l[55180]: [64494.452] port 1: UNCALIBRATED to SLAVE on > MASTER_CLOCK_SELECTED > ptp4l[55180]: [64505.577] rms 9613 max 23274 freq -5842 +/- 1303 > delay 24550 +/- 2445 > phc2sys[56628]: [66058.723] CLOCK_REALTIME phc offset 415929564434 > s1 freq +100000000 delay 8392 > * ethtool: looks good
Well.. The e1000e is a simulated device model. Not backed by actual hardware. It almost definitely isn't backing the "hardware" timestamping with real hardware. > Time stamping parameters for ens224: > Capabilities: > hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE) > software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE) > hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE) > software-receive (SOF_TIMESTAMPING_RX_SOFTWARE) > software-system-clock (SOF_TIMESTAMPING_SOFTWARE) > hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE) > PTP Hardware Clock: 1 > Hardware Transmit Timestamp Modes: > off (HWTSTAMP_TX_OFF) > on (HWTSTAMP_TX_ON) > Hardware Receive Filter Modes: > none (HWTSTAMP_FILTER_NONE) > all (HWTSTAMP_FILTER_ALL) > ptpv1-l4-sync (HWTSTAMP_FILTER_PTP_V1_L4_SYNC) > ptpv1-l4-delay-req (HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) > ptpv2-l4-sync (HWTSTAMP_FILTER_PTP_V2_L4_SYNC) > ptpv2-l4-delay-req (HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ) > ptpv2-l2-sync (HWTSTAMP_FILTER_PTP_V2_L2_SYNC) > ptpv2-l2-delay-req (HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ) > ptpv2-event (HWTSTAMP_FILTER_PTP_V2_EVENT) > ptpv2-sync (HWTSTAMP_FILTER_PTP_V2_SYNC) > ptpv2-delay-req (HWTSTAMP_FILTER_PTP_V2_DELAY_REQ) > * dmesg > e1000e 0000:13:00.0 ens224: Timesync Rx Control register not set > as expected > After turning ptp4l and phc2sys down: > * hwstamp: > SIOCSHWTSTAMP failed: Resource temporarily unavailable > * testptp > _PHC time can be set manually but doesn't run, i.e. time value is > constant._ > > Do I miss kernel or driver capabilities? > Would I have to investigate possible limitation of ESXi? > In my experience, the usual method of synchronizing time into a VM is to run PTP in the host and then expose time to the VM using something like a hypervisor-specific device? (ptp_kvm can expose a clock device into the VM that can be used to synchronize the VM time with the host time) I'm not super familiar with ESXi so I don't know if it has anything along these lines. I think I've also seen some work in trying to get hardware timestamping supported over a vnet type device, i.e. allowing a device with actual hardware timestamps to report these into the VM. It's possible there are some devices with PCIe SR-IOV functionality that support timestamping in their virtual functions. > Regards, > > Patrick > > Other details > - OS: Ubuntu 20.04 > - Kernel: 5.11.0-34 > - NIC driver e1000e > - I appended `pcie_aspm=off` to the linux command line, like recommended > at several places on the web > - timestamping method: software or hardware > > > _______________________________________________ > Linuxptp-users mailing list > Linuxptp-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linuxptp-users > _______________________________________________ Linuxptp-users mailing list Linuxptp-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-users