On Tue, Mar 28, 2023 at 11:29:02AM +0200, Riccardo Laiolo wrote:
> Hi there,
> I'm working on a custom NXP iMX8 SoM connected to a Marvell MV88E6390 switch 
> on port0 (eth0 as management port).
> Five switch ports are exposed to the outside and bridged together in a dsa 
> device (br0 soft bridge).
> I'm running iMX linux-5.15.71 from NXP downstream repository.
> 
> I need my device to be a ptp device (master or slave depending on the 
> specific application).
> 
> Since I can ping other PCs on the network I think Marvell DSA drivers are 
> working, but ptp is not working.
> 
> I found and backported this patch 
> (https://github.com/torvalds/linux/commit/9627c981ac82209c66c1b6c0e15c6cceb8656f01)
> into my codebase, but when I launch ptp4l it's not working properly. 
> Launching ptp4l on eth0 it says eth0 is
> rejecting HWTSTAMP filtering configuration. Launching ptp4l on an outside 
> facing port (lan1:5), instead, using IPv4
> or IPv6 transport, it's like my SoM can't talk to other ptp devices: if my 
> SoM is a ptp master i see announce, sync,
> and follow-up messages get sent, and I see dly_req from other slaves coming 
> back, but there are no dly_resp at all.
> When my som is slave there are no packets from it. It's like all ptp related 
> packets get ignored.
> 
> Is it possible to run ptp on eth0 (or on br0)? I want to syncronize devices 
> on all the front facing ports.
> 
> I've attached `ip a` output, `ethtool -T eth0` output, and `ethtool -T lan1` 
> output.

"ethtool -T lan1" reports that the switch ports only support L2 PTP, so
no IPv4 and no IPv6.

PTP hardware timestamping on eth0 (the DSA master) is rejected if the
switch supports hardware timestamping too, because the kernel does not
support reporting more than 1 TX timestamp per packet (or rather, it
does report multiple timestamps, but it doesn't tell user space where
they came from). Since a choice needs to be made even with the
limitations in place, that current choice is to only allow PTP hardware
timestamping on the DSA switch ports, if those support this operation,
or on the DSA master if the switch doesn't support hardware timestamping.

PTP hardware timestamping does not work on a bridge interface, for the
same basic reason that a bridge forwards packets to potentially multiple
ports, and it is not immediately clear, when an application sees a
timestamp coming from a bridge interface, which bridge port took that
timestamp (they may have different PHCs).

This only leaves you a single option:

ptp4l -i lan1 -i lan2 -i lan3 [ ... ] -2 -P -m --tx_timestamp_timeout 40


_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to