I have an RTL8125B-CG NIC which, from what I gather from their product page, has hardware support for PTP. However, sudo ethtool -T
does not detect any HW timestamping capabilities.
I've tried with the r8169
driver and with the r8125
driver from Realtek (both this one from Github and this one from Realtek's download page), but without success. In the Makefile in the source code, there seems to be a flag which indicate that PTP support is not enabled by default, but when I enable this flag I can't compile (I get the error presented in this issue).
Anyone have any experience or know what I can do to get PTP support enabled?
I'm running Ubuntu 20.04 and the 5.11.0-36-generic
kernel.
See the issue on Github for an answer: https://github.com/awesometic/realtek-r8125-dkms/issues/9
In short, the issue with compilation was that in the newest version of the driver (9.006.04) Realtek had removed the
spinlock_t lock
member variable fromstruct rtl8125_private
, but not updated the PTP file accordingly. Hence, all thespin_lock_irqsave
andspin_lock_irqrestore
routines won't compile. There are two ways to fix this:spin_lock_irqsave
andspin_lock_irqrestore
routines in the PTP file, orspinlock_t lock
member in thestruct rtl8125_private
.The latter is probably more safe since we don't know if the IRQs are vital for the function of the driver. That being said, I did try both solutions and both made the driver compile and report PTP HW capabilities, so I don't know which is best.
However, I still think the driver is quite buggy, as I still can't use HW timestamping is slave mode, and I have trouble getting reliable results. I often run into the problem that
ptp4l
fromlinuxptp
times out trying to get a timestamp from the driver. I have two different computers withr8125
NICs, and it works sometimes on one computer and very seldomly on the other. I suspect the PTP function has not been well tested by Realtek, although this is just speculation on my part.