This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMDS64EVM:TSN 设置中的 PTP 同步问题–Quot;master to fault_detected"Error

Guru**** 2393725 points
Other Parts Discussed in Thread: SK-AM64B, TMDS64EVM

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1489757/tmds64evm-ptp-synchronization-issue-in-tsn-setup-master-to-faulty-on-fault_detected-error

器件型号:TMDS64EVM
主题中讨论的其他器件:SK-AM64B

工具与软件:

您好、TI 社区:

我已经使用以下硬件设置了一个时间敏感网络(TSN):

- 2x SK-AM64B (TI 产品页面)
- 2个 TMDS64EVM (TI 产品页面)

该设置遵循 TI 的教程: 时间敏感网络(TSN)设置
我的网络拓扑的更详细图表已附在附件中。

PTP 配置
PTP 在所有板上进行配置以确保时间同步、板1 (TMDS64EVM)用作总主时钟(时间接收器)。 使用了以下命令:

在 Grandmaster 上(董事会1):
date -s "21 JAN 2025 15:12:00"  # Set system time
phc2sys -a -rr --transportSpecific=1 &  # Synchronize PTP time to system time

配置文件`/etc/gPTP.cfg`是使用以下设置创建的:
[global]

gmCapable               1
priority1               248
priority2               248
logAnnounceInterval     0
logSyncInterval         -3
syncReceiptTimeout      3
neighborPropDelayThresh 800
min_neighbor_prop_delay -20000000
assume_two_step         1
path_trace_enabled      1
follow_up_info          1
transportSpecific       0x1
ptp_dst_mac             01:80:C2:00:00:0E
network_transport       L2
delay_mechanism         P2P
ingressLatency          88
egressLatency           288

PTP 同步通过以下命令启动:
nohup ptp4l -P -2 -H -i eth0 -i eth1 -f /etc/gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp0 > /var/log/ptp4l.log 2>&1 &

在从器件(电路板2、3和4)上:
phc2sys -a -r --transportSpecific=1 &
nohup ptp4l -P -2 -H -i eth0 -i eth1 -f /etc/gPTP.cfg --step_threshold=1 -m -q -p /dev/ptp0 > /var/log/ptp4l.log 2>&1 &

PTP 状态通过以下方式进行监控:
tail -f /var/log/ptp4l.log

完成该设置后、所有电路板上的时间同步都能正常工作。

问题
每当使用 iperf 在 TSN 连接的电路板之间发送数据(例如延迟测试)时、的 PTP 日志中经常会出现以下错误 电路板2、3和4

ptp4l[125570.034]: port 2 (eth1): send sync failed
ptp4l[125570.034]: port 2 (eth1): MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED)

FAULT_DETECTED (FT_UNSPECIFIED)时主器件发生故障 错误似乎会导致临时去同步。

问题
1.可能是什么原因造成的 FAULT_DETECTED 错误?
2.这是否与在 iperf 测试期间影响 PTP 流量的高网络负载有关?
3.是否建议对`gPTP.cfg`设置进行任何调整以提高稳定性?
4.此问题是否是由配置错误、驱动程序错误或硬件问题引起的?

非常感谢您提供任何指导或故障排除建议!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    默认情况下运行的 ptp4l 是未修改/修补的开源代码。  https://github.com/richardcochran/linuxptp 您可以查看打印输出的位置。 我的第一个猜测是 iperf 会产生足够的 CPU 负载或网络流量、因此丢弃或处理某些 PTP 消息的时间太晚。 这可能会触发关于使用本地时钟或其他人作为主设备的某种协商。

    您在每个电路板上运行哪些软件版本?

    您正在运行的 iperf 命令是什么? 只是创建最大可能的流量还是某个有限量? 通常我会推荐使用 iperf3而不是旧的 iperf。

    注意:Priority1值是 对主控方进行硬编码的最简单方法、最低的 Priority1值胜出。 您可以在所有主板上运行相同的命令、只需使用 Priority1确定您要成为主板的用户即可。

     Pekka

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢您的答复和有用的提示!

    要回答您的问题:

    -我们已经在所有板上使用 iperf3。
    -所有电路板都运行 TI 提供的最新可用软件版本
    -我们不会生成最大流量—iperf3测试设计用于使用低带宽 UDP 数据包进行延迟测量

    以下是我们使用的测试脚本:

    电路板1–发送器脚本(Board1_SENSOR_LATENCY_TEST.sh):


    #!/bin/bash

    echo "Starting latency test from Board 1 to Board 4..."
    echo "Starting packet capture on Board 1..."
    tcpdump -i br0.100 udp port 5201 -w latency_sender.pcap -s 96 &
    TCPDUMP_PID=$!

    echo "Starting iperf3 client to send traffic to Board 4..."
    iperf3 -c 1.1.1.4 -u -b 1M -l 16 -t 60 -i 1 --pacing-timer=1000

    echo "Stopping iperf3 client..."
    pkill -f "iperf3 -c 1.1.1.4"
    sleep 2
    kill $TCPDUMP_PID

    echo "Latency test on Board 1 completed."

    电路板4–接收器脚本(board4_receiver_latency_test.sh):

    #!/bin/bash

    echo "Starting latency test server on Board 4..."
    echo "Starting packet capture on Board 4..."
    tcpdump -i br0.100 udp port 5201 -w latency_empfaenger.pcap -s 96 &
    TCPDUMP_PID=$!

    echo "Starting iperf3 server..."
    iperf3 -s &

    sleep 60

    echo "Stopping iperf3 server and packet capture..."
    pkill iperf3
    sleep 2
    kill $TCPDUMP_PID

    echo "Latency test on Board 4 completed."

    如果您在此设置中发现任何可疑情况、或提供有关调整`ptp4l`或测试方法的建议、请告诉我。

    再次感谢!