Description of problem: LinuxPTP sets the minor version of PTP packets to a non-zero value. Unfortunately, the PTP hardware included in the Raspberry Pi CM4 is unable to timestamp packets unless the minor version is unusable. The maintainer has adopted the policy of not working round broken hardware, and accordingly has declined to incorporate a patch that fixes the problem. The Raspberry Pi CM4 currently provides the cheapest way to implement a PTP grandmaster. But this is no longer possible with LinuxPTP 4.0 without a patch. Apart from this problem, Fedora 38 is quite useable on the CM4. I have written a guide here https://github.com/jclark/rpi-cm4-ptp-guide/blob/main/fedora.md There's more discussion here: https://github.com/jclark/rpi-cm4-ptp-guide/issues/23 There's discussion on the LinuxPTP mailing list here https://www.mail-archive.com/linuxptp-users@lists.sourceforge.net/msg03316.html and a possible patch here that makes the minor version configurable https://www.mail-archive.com/linuxptp-devel@lists.sourceforge.net/msg06374.html My question is whether Fedora would be open to including a patch. If so, I am happy to work on testing it. Version-Release number of selected component (if applicable): LinuxPTP 4.0 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Thanks for writing that guide. You linked to the Fedora upstreaming guidelines: https://docs.fedoraproject.org/en-US/package-maintainers/Staying_Close_to_Upstream_Projects/ There is a strong argument made to avoid Fedora-specific patches. That would be the patch adding a new option to configure older PTP version, which was rejected upstream. A Fedora-specific configuration option would lead to confusion and unhappy upstream. I think the only option here is to convince the upstream to make an exception in their policy of supporting broken hardware, e.g. if the CM4 is shown to be a popular choice for PTP.
@mlichvar I've had an idea for solving this that doesn't require any upstream change. As I understand it, the problem is that the hardware will only timestamp an outgoing packet if the minor version is 0. If so, I think it should be possible to work around this by using tc with an eBPF filter that modifies the packet to make the minor version 0, along the lines of https://taoshu.in/unix/modify-udp-packet-using-ebpf.html. Has this got a chance of working?
I've implemented this idea and in my limited testing it appears to work. https://github.com/jclark/bpf-ptpver20
That is an interesting workaround. It seems it won't be needed after all. The upstream changed their mind and accepted a patch adding new option ptp_minor_version in linuxptp-4.2 to make it configurable. I'll prepare an update for Fedora 39.