nxp-archive / openil_linuxptp

PTP IEEE 1588 stack for Linux
GNU General Public License v2.0
136 stars 60 forks source link

DSA switch port is stop receiving ptp packets from the master after ptp4l is started #48

Open msmudide opened 8 months ago

msmudide commented 8 months ago

Hi All,

I have a zynq 7000 board with an 88E6390 switch running linux kernel 6.1.30. The ports 3, 9 and 10 are external ports and another port is connected to zynq mac. port 3 is connected to ptp master. The following tcpdump command shows the announce, sync, follow up and pdelay request from master.

tcpdump -i lan3 ether proto 0x88f7.

When I ran ptp4l on lan3, the lan3 port stops receiving the ptp packets from the master and the tcpdump shows only pdelay requests go from the lan3.

ptp4l -i lan3 -2 -P -l 7 -m -s

Any idea what might be the problem?

vladimiroltean commented 8 months ago

https://github.com/torvalds/linux/commit/9627c981ac82209c66c1b6c0e15c6cceb8656f01

msmudide commented 8 months ago

torvalds/linux@9627c98

Thanks vlad for the reply. I need this patch. Am I correct?

vladimiroltean commented 8 months ago

Yes, it should apply straight away on linux-6.1.y.

msmudide commented 8 months ago

Yes, it should apply straight away on linux-6.1.y.

Thanks again. I will patch and let you know.

msmudide commented 8 months ago

Is there a way to generate a patch from the changes, posted here torvalds/linux@9627c98

vladimiroltean commented 8 months ago

git clone https://github.com/torvalds/linux.git; git format-patch -1 9627c981ac82209c66c1b6c0e15c6cceb8656f01

msmudide commented 8 months ago

git clone https://github.com/torvalds/linux.git; git format-patch -1 9627c981ac82209c66c1b6c0e15c6cceb8656f01

Thanks.

msmudide commented 8 months ago

git clone https://github.com/torvalds/linux.git; git format-patch -1 9627c981ac82209c66c1b6c0e15c6cceb8656f01

Hi Vlad, I applied the patch but no use. My hardware is receiving the ptp frames until I start the ptp4l. After I start ptp4l, the lan3 stopped receiving ptp frames.

ifconfig br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.x.x.x netmask 255.255.254.0 broadcast 10.x.x.x inet6 fe80::187a:54ff:fe6a:572d prefixlen 64 scopeid 0x20 ether 1a:7a:54:6a:57:2d txqueuelen 1000 (Ethernet) RX packets 130180 bytes 16159083 (15.4 MiB) RX errors 0 dropped 947 overruns 0 frame 0 TX packets 5230 bytes 732385 (715.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

end0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1504 ether aa:eb:76:4d:fb:9c txqueuelen 1000 (Ethernet) RX packets 140905 bytes 17581572 (16.7 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6735 bytes 1029513 (1005.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 41 base 0xb000

lan3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether aa:eb:76:4d:fb:9c txqueuelen 1000 (Ethernet) RX packets 139449 bytes 16800384 (16.0 MiB) RX errors 0 dropped 25 overruns 0 frame 0 TX packets 5279 bytes 737109 (719.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lan9: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether aa:eb:76:4d:fb:9c txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lan10: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether aa:eb:76:4d:fb:9c txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 43864 bytes 3323140 (3.1 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 43864 bytes 3323140 (3.1 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

brctl show bridge name bridge id STP enabled interfaces br0 8000.1a7a546a572d no lan10 lan3 lan9

lan3 is connected to GM.

vladimiroltean commented 8 months ago

Can you make some change to the kernel such that you are sure you are running the (patched) version you think you are? Or maybe the problem has now moved: the host Ethernet controller is filtering out these PTP messages for some other reason, but the switch is sending them. To check that, run ethtool -S end0 | grep -v ': 0' and look to see if p09_out_management increments proportionally to the number of PTP packets received (p09 in this case is the number of the CPU port of the switch directly attached to end0).

I own a board with an 88E6390 switch, and the patch I already mentioned, applied on top of a vanilla v6.1.69 tag (latest) from linux-stable, makes PTP reception work. So at least in terms of the switch driver, I doubt that there is more to change in the kernel than this patch, and am inclined to think it is a setup related issue now. But I also don't know what Xilinx do with their BSP kernels.

Attached are 2 logs, before and after applying the patch.

mox-6390-ptp-after.txt mox-6390-ptp-before.txt

msmudide commented 8 months ago

Yes, I can see my log messages which I put in the patches in the kernel logs. Actually, my switch is 88e6393X. Sorry for the confusion.

Also I do not see P09_out_management at all when I ran ethtool -S end0 | grep -v ': 0'. But I see P00_out_managenet, which is increasing.

ethtool -S end0 | grep -v ': 0' NIC statistics: tx_octets: 113216 tx_frames: 691 tx_broadcast_frames: 46 tx_multicast_frames: 118 tx_64_byte_frames: 43 tx_65_127_byte_frames: 467 tx_128_255_byte_frames: 50 tx_256_511_byte_frames: 111 tx_512_1023_byte_frames: 15 tx_1024_1518_byte_frames: 2 tx_greater_than_1518_byte_frames: 3 rx_octets: 1629761 rx_frames: 12699 rx_broadcast_frames: 2098 rx_multicast_frames: 9921 rx_65_127_byte_frames: 10049 rx_128_255_byte_frames: 1612 rx_256_511_byte_frames: 799 rx_512_1023_byte_frames: 100 rx_1024_1518_byte_frames: 135 rx_greater_than_1518_byte_frames: 4 q0_rx_packets: 12699 q0_rx_bytes: 1401179 q0_tx_packets: 691 q0_tx_bytes: 113216 p00_in_good_octets: 113216 p00_in_unicast: 527 p00_in_broadcasts: 46 p00_in_multicasts: 118 p00_out_octets: 1645724 p00_out_unicast: 693 p00_out_broadcasts: 2119 p00_out_multicasts: 10023 p00_hist_64bytes: 43 p00_hist_65_127bytes: 10626 p00_hist_128_255bytes: 1677 p00_hist_256_511bytes: 920 p00_hist_512_1023bytes: 115 p00_hist_1024_max_bytes: 145 p00_in_accepted: 691 p00_in_da_unknown: 157 p00_in_management: 134 p00_out_queue_0: 11934 p00_out_queue_2: 40 p00_out_queue_3: 72 p00_out_queue_6: 204 p00_out_queue_7: 585 p00_out_octets_a: 1170 p00_out_management: 891 p00_vtu_miss_violation: 72

ifconfig br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.x.y.z netmask 255.255.254.0 broadcast 10.x.y.255 inet6 fe80::fc64:14ff:fe24:873e prefixlen 64 scopeid 0x20 ether fe:64:14:24:87:3e txqueuelen 1000 (Ethernet) RX packets 28505 bytes 2777877 (2.6 MiB) RX errors 0 dropped 12471 overruns 0 frame 0 TX packets 587 bytes 87260 (85.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

end0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1504 inet6 fe80::f147:2991:7921:37dc prefixlen 64 scopeid 0x20 ether 8e:91:1f:d0:0f:6c txqueuelen 1000 (Ethernet) RX packets 29251 bytes 2978330 (2.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 834 bytes 137902 (134.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 41 base 0xb000

lan3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::6a07:d1cc:b011:f42c prefixlen 64 scopeid 0x20 ether 8e:91:1f:d0:0f:6c txqueuelen 1000 (Ethernet) RX packets 29045 bytes 2830658 (2.6 MiB) RX errors 0 dropped 192 overruns 0 frame 0 TX packets 628 bytes 97434 (95.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lan9: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 8e:91:1f:d0:0f:6c txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lan10: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 8e:91:1f:d0:0f:6c txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 5840 bytes 441760 (431.4 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 5840 bytes 441760 (431.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

brctl show bridge name bridge id STP enabled interfaces br0 8000.fe641424351e no lan10 lan3 lan9

Added entry to match the device tree

static const struct of_device_id mv88e6xxx_of_match[] = { { .compatible = "marvell,mv88e6393x", .data = &mv88e6xxx_table[MV88E6393X], },

Added following patch: git clone https://github.com/torvalds/linux.git; git format-patch -1 9627c981ac82209c66c1b6c0e15c6cceb8656f01

and changed

static const struct mv88e6xxx_ops mv88e6393x_ops = { / MV88E6XXX_FAMILY_6393 / .ptp_ops = &mv88e6390_ptp_ops, };

The following command show the sync, sync follow up and announce messages from the gm.

tcpdump -i lan3 ether proto 0x88f7

ls -l /dev/p* crw------- 1 root root 251, 0 Dec 20 19:16 /dev/pps0 crw-rw-rw- 1 root tty 5, 2 Dec 20 20:03 /dev/ptmx crw------- 1 root root 250, 0 Dec 20 19:15 /dev/ptp0

After I started ptp4l, my device does not receive ptp messages from GM anymore /usr/sbin/ptp4l -i lan3 -s -2 -H -P -l 7 -m --tx_timestamp_timeout 100

ptp4l log:

/usr/sbin/ptp4l -i lan3 -s -2 -H -P -l 7 -m --tx_timestamp_timeout 100 ptp4l[3124.505]: config item (null).assume_two_step is 0 ptp4l[3124.506]: config item (null).check_fup_sync is 0 ptp4l[3124.506]: config item (null).tx_timestamp_timeout is 100 ptp4l[3124.506]: config item (null).hwts_filter is 0 ptp4l[3124.507]: config item (null).clock_servo is 0 ptp4l[3124.507]: config item (null).clock_type is 32768 ptp4l[3124.507]: config item (null).clock_servo is 0 ptp4l[3124.507]: config item (null).clockClass is 248 ptp4l[3124.507]: config item (null).clockAccuracy is 254 ptp4l[3124.507]: config item (null).offsetScaledLogVariance is 65535 ptp4l[3124.507]: config item (null).productDescription is ';;' ptp4l[3124.507]: config item (null).revisionData is ';;' ptp4l[3124.507]: config item (null).userDescription is '' ptp4l[3124.507]: config item (null).manufacturerIdentity is '00:00:00' ptp4l[3124.508]: config item (null).domainNumber is 0 ptp4l[3124.508]: config item (null).slaveOnly is 1 ptp4l[3124.508]: config item (null).gmCapable is 1 ptp4l[3124.508]: config item (null).gmCapable is 1 ptp4l[3124.508]: config item (null).G.8275.defaultDS.localPriority is 128 ptp4l[3124.508]: config item (null).maxStepsRemoved is 255 ptp4l[3124.508]: config item (null).time_stamping is 1 ptp4l[3124.508]: config item (null).twoStepFlag is 1 ptp4l[3124.508]: config item (null).twoStepFlag is 1 ptp4l[3124.508]: config item (null).time_stamping is 1 ptp4l[3124.508]: config item (null).priority1 is 128 ptp4l[3124.509]: config item (null).priority2 is 128 ptp4l[3124.512]: interface index 5 is up ptp4l[3124.512]: config item (null).free_running is 0 ptp4l[3124.512]: selected /dev/ptp0 as PTP clock ptp4l[3124.513]: config item (null).clockIdentity is '000000.0000.000000' ptp4l[3124.513]: config item (null).uds_address is '/var/run/ptp4l' ptp4l[3124.513]: section item /var/run/ptp4l.announceReceiptTimeout now 0 ptp4l[3124.513]: section item /var/run/ptp4l.delay_mechanism now 0 ptp4l[3124.513]: section item /var/run/ptp4l.network_transport now 0 ptp4l[3124.513]: section item /var/run/ptp4l.delay_filter_length now 1 ptp4l[3124.513]: config item (null).free_running is 0 ptp4l[3124.513]: config item (null).freq_est_interval is 1 ptp4l[3124.513]: config item (null).write_phase_mode is 0 ptp4l[3124.513]: config item (null).gmCapable is 1 ptp4l[3124.514]: config item (null).kernel_leap is 1 ptp4l[3124.514]: config item (null).utc_offset is 37 ptp4l[3124.514]: config item (null).timeSource is 160 ptp4l[3124.531]: config item (null).pi_proportional_const is 0.000000 ptp4l[3124.531]: config item (null).pi_integral_const is 0.000000 ptp4l[3124.531]: config item (null).pi_proportional_scale is 0.000000 ptp4l[3124.531]: config item (null).pi_proportional_exponent is -0.300000 ptp4l[3124.531]: config item (null).pi_proportional_norm_max is 0.700000 ptp4l[3124.531]: config item (null).pi_integral_scale is 0.000000 ptp4l[3124.531]: config item (null).pi_integral_exponent is 0.400000 ptp4l[3124.531]: config item (null).pi_integral_norm_max is 0.300000 ptp4l[3124.531]: config item (null).step_threshold is 0.000000 ptp4l[3124.531]: config item (null).first_step_threshold is 0.000020 ptp4l[3124.531]: config item (null).max_frequency is 900000000 ptp4l[3124.531]: config item (null).servo_offset_threshold is 0 ptp4l[3124.531]: config item (null).servo_num_offset_values is 10 ptp4l[3124.531]: config item (null).dataset_comparison is 0 ptp4l[3124.531]: config item (null).tsproc_mode is 0 ptp4l[3124.532]: config item (null).delay_filter is 1 ptp4l[3124.532]: config item (null).delay_filter_length is 10 ptp4l[3124.532]: config item (null).initial_delay is 0 ptp4l[3124.532]: config item (null).summary_interval is 0 ptp4l[3124.532]: config item (null).sanity_freq_limit is 200000000 ptp4l[3124.532]: PI servo: sync interval 1.000 kp 0.700 ki 0.300000 ptp4l[3124.532]: config item /var/run/ptp4l.boundary_clock_jbod is 0 ptp4l[3124.532]: config item /var/run/ptp4l.network_transport is 0 ptp4l[3124.532]: config item /var/run/ptp4l.masterOnly is 0 ptp4l[3124.532]: config item /var/run/ptp4l.BMCA is 0 ptp4l[3124.532]: config item /var/run/ptp4l.delayAsymmetry is 0 ptp4l[3124.532]: config item /var/run/ptp4l.follow_up_info is 0 ptp4l[3124.532]: config item /var/run/ptp4l.freq_est_interval is 1 ptp4l[3124.532]: config item /var/run/ptp4l.msg_interval_request is 0 ptp4l[3124.532]: config item /var/run/ptp4l.net_sync_monitor is 0 ptp4l[3124.532]: config item /var/run/ptp4l.path_trace_enabled is 0 ptp4l[3124.533]: config item /var/run/ptp4l.tc_spanning_tree is 0 ptp4l[3124.533]: config item /var/run/ptp4l.ingressLatency is 0 ptp4l[3124.533]: config item /var/run/ptp4l.egressLatency is 0 ptp4l[3124.533]: config item /var/run/ptp4l.delay_mechanism is 0 ptp4l[3124.533]: config item /var/run/ptp4l.hybrid_e2e is 0 ptp4l[3124.533]: config item /var/run/ptp4l.fault_badpeernet_interval is 16 ptp4l[3124.533]: config item /var/run/ptp4l.fault_reset_interval is 4 ptp4l[3124.533]: config item /var/run/ptp4l.tsproc_mode is 0 ptp4l[3124.533]: config item /var/run/ptp4l.delay_filter is 1 ptp4l[3124.533]: config item /var/run/ptp4l.delay_filter_length is 1 ptp4l[3124.533]: config item (null).slave_event_monitor is '' ptp4l[3124.533]: config item lan3.boundary_clock_jbod is 0 ptp4l[3124.533]: config item lan3.network_transport is 3 ptp4l[3124.533]: config item lan3.masterOnly is 0 ptp4l[3124.533]: config item lan3.BMCA is 0 ptp4l[3124.533]: config item lan3.delayAsymmetry is 0 ptp4l[3124.533]: config item lan3.follow_up_info is 0 ptp4l[3124.533]: config item lan3.freq_est_interval is 1 ptp4l[3124.534]: config item lan3.msg_interval_request is 0 ptp4l[3124.534]: config item lan3.net_sync_monitor is 0 ptp4l[3124.534]: config item lan3.path_trace_enabled is 0 ptp4l[3124.534]: config item lan3.tc_spanning_tree is 0 ptp4l[3124.534]: config item lan3.ingressLatency is 0 ptp4l[3124.534]: config item lan3.egressLatency is 0 ptp4l[3124.534]: config item lan3.delay_mechanism is 2 ptp4l[3124.534]: config item lan3.unicast_master_table is 0 ptp4l[3124.534]: config item lan3.unicast_listen is 0 ptp4l[3124.534]: config item lan3.hybrid_e2e is 0 ptp4l[3124.534]: config item lan3.fault_badpeernet_interval is 16 ptp4l[3124.534]: config item lan3.fault_reset_interval is 4 ptp4l[3124.534]: config item lan3.tsproc_mode is 0 ptp4l[3124.534]: config item lan3.delay_filter is 1 ptp4l[3124.534]: config item lan3.delay_filter_length is 10 ptp4l[3124.534]: config item lan3.logMinDelayReqInterval is 0 ptp4l[3124.535]: config item lan3.logAnnounceInterval is 1 ptp4l[3124.535]: config item lan3.inhibit_announce is 0 ptp4l[3124.535]: config item lan3.ignore_source_id is 0 ptp4l[3124.535]: config item lan3.announceReceiptTimeout is 3 ptp4l[3124.535]: config item lan3.syncReceiptTimeout is 0 ptp4l[3124.535]: config item lan3.transportSpecific is 0 ptp4l[3124.535]: config item lan3.ignore_transport_specific is 0 ptp4l[3124.535]: config item lan3.G.8275.portDS.localPriority is 128 ptp4l[3124.535]: config item lan3.logSyncInterval is 0 ptp4l[3124.535]: config item lan3.operLogSyncInterval is 0 ptp4l[3124.535]: config item lan3.logMinPdelayReqInterval is 0 ptp4l[3124.535]: config item lan3.operLogPdelayReqInterval is 0 ptp4l[3124.535]: config item lan3.neighborPropDelayThresh is 20000000 ptp4l[3124.535]: config item lan3.min_neighbor_prop_delay is -20000000 ptp4l[3124.535]: config item lan3.asCapable is 1 ptp4l[3124.535]: config item lan3.inhibit_delay_req is 0 ptp4l[3124.536]: config item lan3.ptp_dst_mac is '01:1B:19:00:00:00' ptp4l[3124.536]: config item lan3.p2p_dst_mac is '01:80:C2:00:00:0E' ptp4l[3124.536]: config item global.socket_priority is 0 ptp4l[3124.571]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[3124.571]: config item /var/run/ptp4l.logMinDelayReqInterval is 0 ptp4l[3124.571]: config item /var/run/ptp4l.logAnnounceInterval is 1 ptp4l[3124.571]: config item /var/run/ptp4l.inhibit_announce is 0 ptp4l[3124.571]: config item /var/run/ptp4l.ignore_source_id is 0 ptp4l[3124.572]: config item /var/run/ptp4l.announceReceiptTimeout is 0 ptp4l[3124.572]: config item /var/run/ptp4l.syncReceiptTimeout is 0 ptp4l[3124.572]: config item /var/run/ptp4l.transportSpecific is 0 ptp4l[3124.572]: config item /var/run/ptp4l.ignore_transport_specific is 0 ptp4l[3124.572]: config item /var/run/ptp4l.G.8275.portDS.localPriority is 128 ptp4l[3124.572]: config item /var/run/ptp4l.logSyncInterval is 0 ptp4l[3124.572]: config item /var/run/ptp4l.operLogSyncInterval is 0 ptp4l[3124.572]: config item /var/run/ptp4l.logMinPdelayReqInterval is 0 ptp4l[3124.572]: config item /var/run/ptp4l.operLogPdelayReqInterval is 0 ptp4l[3124.572]: config item /var/run/ptp4l.neighborPropDelayThresh is 20000000 ptp4l[3124.572]: config item /var/run/ptp4l.min_neighbor_prop_delay is -20000000 ptp4l[3124.572]: config item /var/run/ptp4l.asCapable is 1 ptp4l[3124.572]: config item /var/run/ptp4l.inhibit_delay_req is 0 ptp4l[3124.572]: config item (null).uds_address is '/var/run/ptp4l' ptp4l[3124.572]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[3124.573]: port 1: received link status notification ptp4l[3124.573]: interface index 5 is up ptp4l[3125.571]: port 1: delay timeout ptp4l[3126.572]: port 1: delay timeout ptp4l[3126.576]: port 1: setting asCapable ptp4l[3127.572]: port 1: delay timeout ptp4l[3128.572]: port 1: delay timeout ptp4l[3129.572]: port 1: delay timeout ptp4l[3130.573]: port 1: delay timeout ptp4l[3131.573]: port 1: delay timeout ptp4l[3132.498]: port 1: announce timeout ptp4l[3132.498]: selected local clock 8e911f.fffe.d00f6c as best master ptp4l[3132.573]: port 1: delay timeout ptp4l[3133.573]: port 1: delay timeout ptp4l[3134.573]: port 1: delay timeout ptp4l[3135.574]: port 1: delay timeout ptp4l[3136.574]: port 1: delay timeout ptp4l[3137.574]: port 1: delay timeout

vladimiroltean commented 8 months ago

Actually, my switch is 88e6393X. Sorry for the confusion.

This is new information. As I have no access to Marvell documentation, I can only speculate that the 6393X switch needs the same treatment as the 6390, which the patch below (applied in addition to the previous one from Kurt Kanzenbach) should do. But there's a chance it won't work, and if it doesn't work, I don't know what further debugging to do, you'd better ask Marvell to support their hardware.

From 4b75903a6c7fa92944e3bfbab1af6eef33268525 Mon Sep 17 00:00:00 2001
From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: Wed, 27 Dec 2023 10:11:19 +0200
Subject: [PATCH] net: dsa: mv88e6xxx: use mv88e6390_ptp_ops for the 6393X
 family

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 81488d86fd47..3fbb391e5d3c 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -5557,7 +5557,7 @@ static const struct mv88e6xxx_ops mv88e6393x_ops = {
    /* TODO: serdes stats */
    .gpio_ops = &mv88e6352_gpio_ops,
    .avb_ops = &mv88e6390_avb_ops,
-   .ptp_ops = &mv88e6352_ptp_ops,
+   .ptp_ops = &mv88e6390_ptp_ops,
    .phylink_get_caps = mv88e6393x_phylink_get_caps,
 };

-- 
2.34.1

Added entry to match the device tree

Actually the device tree schema for Marvell switches only uses the compatible string to locate the switch ID registers. It is almost never an exact match for the switch model. See the description below:

          marvell,mv88e6085: This switch uses base address 0x10.
            This switch and its siblings will be autodetected from
            ID registers found in the switch, so only "marvell,mv88e6085" should be
            specified. This includes the following list of MV88Exxxx switches:
            6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, 6171, 6172, 6175, 6176,
            6185, 6240, 6320, 6321, 6341, 6350, 6351, 6352
          marvell,mv88e6190: This switch uses base address 0x00.
            This switch and its siblings will be autodetected from
            ID registers found in the switch, so only "marvell,mv88e6190" should be
            specified. This includes the following list of MV88Exxxx switches:
            6190, 6190X, 6191, 6290, 6361, 6390, 6390X
          marvell,mv88e6250: This switch uses base address 0x08 or 0x18.
            This switch and its siblings will be autodetected from
            ID registers found in the switch, so only "marvell,mv88e6250" should be
            specified. This includes the following list of MV88Exxxx switches:
            6220, 6250

taken from https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/net/dsa/marvell.txt#L16

So no need to add a new compatible string, it should work just fine with "marvell,mv88e6190".

msmudide commented 8 months ago

Thanks for the response. I changed my code to use "marvell,mv88e6190" tag in the devicetree, and two patches. Same behavior. As soon a I start ptp4l, lan3 stops receiving the ptp frames from the GM. Before I start ptp4l, lan3 does receives ptp frames from the gm. In the output of the command ethtool -S end0 show the value for P00_out_management keep incrementing. Does this mean switch is receiving ptp frames?

vladimiroltean commented 8 months ago

In the output of the command ethtool -S end0 show the value for P00_out_management keep incrementing. Does this mean switch is receiving ptp frames?

It means the switch is sending management (L2 link-local multicast) traffic through the CPU port. That can be PTP event messages or can be something else (PTP general messages, STP or other PDUs, etc). Best way is to test with individual packet types, not with the full protocol.