技术专栏
nvidia nx平台使用ptp 同步两台nx设备
1. 前言
使用PTP同步时间之间的两个xavier nx设备
(与一个xavier nx设备为主和另一个xavier nx设备为slave)。
Master side
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.1/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
date 010100002018
phc_ctl /dev/ptp0 set
phc_ctl /dev/ptp0 get
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -m
slave side
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.2/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
phc_ctl /dev/ptp0 get
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -s -m
使用“date”命令和“phc_ctl /dev/ptp0 get”命令检查了时间
主设备中发送的日期和时间没有反映在从设备中
2. 尝试如下命令
在主/从设备上执行以下命令
$ systemctl stop ptp4l
$ systemctl disable ptp4l
$ systemctl reboot
尝试在主服务器和从服务器上执行这些命令
但是仍然不能同步从时钟到主时钟
查看release标签,
$ cat /etc/nv_tegra_release作为参考,
R32 (release), REVISION: 5.1, GCID: 26202423,
BOARD: t186ref, EABI: aarch64, DATE: Fri Feb 19 16:50:29 UTC 2021
3.查询gPTP.cfg
Default Data Set
twoStepFlag 1
gmCapable 1
priority1 248
priority2 248
domainNumber 0
clockClass 248
clockAccuracy 0xFE
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
Port Data Set
logAnnounceInterval 1
logSyncInterval -3
logMinPdelayReqInterval 0
announceReceiptTimeout 3
syncReceiptTimeout 3
delayAsymmetry 0
fault_reset_interval 4
neighborPropDelayThresh 800
min_neighbor_prop_delay -20000000
Run time options
assume_two_step 1
logging_level 6
path_trace_enabled 1
follow_up_info 1
hybrid_e2e 0
tx_timestamp_timeout 1
use_syslog 1
verbose 0
summary_interval 0
kernel_leap 1
check_fup_sync 0
Servo options
pi_proportional_const 0.0
pi_integral_const 0.0
pi_proportional_scale 0.0
pi_proportional_exponent -0.3
pi_proportional_norm_max 0.7
pi_integral_scale 0.0
pi_integral_exponent 0.4
pi_integral_norm_max 0.3
step_threshold 0.0
first_step_threshold 0.00002
max_frequency 900000000
clock_servo pi
sanity_freq_limit 200000000
ntpshm_segment 0
Transport options
transportSpecific 0x1
ptp_dst_mac 01:80:C2:00:00:0E
p2p_dst_mac 01:80:C2:00:00:0E
uds_address /var/run/ptp4l
Default interface options
network_transport L2
delay_mechanism P2P
time_stamping hardware
tsproc_mode filter
delay_filter moving_median
delay_filter_length 10
egressLatency 0
ingressLatency 0
boundary_clock_jbod 0
4. 修改配置
Host side
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.1/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
date 010100002018
phc_ctl /dev/ptp0 set
phc_ctl /dev/ptp0 get
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -m
slave side
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.2/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
phc_ctl /dev/ptp0 get
ptp4l -f gPTP.cfg -i eth0 -p /dev/ptp0 -s -m
尝试以上的命令,仍不能在从属设备上得到时间同步
下面是我的设备上的phc_ctl /dev/ptp0输出
phc_ctl[235.617]:
capabilities:
62500000 maximum frequency adjustment (ppb)
0 programable alarms
0 external time stamp channels
0 programmable periodic signals
doesn’t have pulse per second support
sudo phc_ctl /dev/ptp0 get
phc_ctl[255.518]: clock time is 1625919201.249458848 or Sat Jul 10 17:43:21 2021
使用linuxptp
git clone git://git.code.sf.net/p/linuxptp/code linuxptp
cd linuxptp/
make -j6
sudo make install
5. eth0的时间戳参数
ethtool -T eth0的输出如下
Capabilities:
hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE)
software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE)
hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE)
software-receive (SOF_TIMESTAMPING_RX_SOFTWARE)
software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE)
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
off (HWTSTAMP_TX_OFF)
on (HWTSTAMP_TX_ON)
Hardware Receive Filter Modes:
none (HWTSTAMP_FILTER_NONE)
ptpv1-l4-sync (HWTSTAMP_FILTER_PTP_V1_L4_SYNC)
ptpv1-l4-delay-req (HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ)
ptpv2-l4-sync (HWTSTAMP_FILTER_PTP_V2_L4_SYNC)
ptpv2-l4-delay-req (HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ)
ptpv2-l2-sync (HWTSTAMP_FILTER_PTP_V2_L2_SYNC)
ptpv2-l2-delay-req (HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ)
ptpv2-event (HWTSTAMP_FILTER_PTP_V2_EVENT)
从根终端运行了命令
但是客户端上的“phc_ctl /dev/ptp0 get”并没有返回主机端上的时间
Host side:
sudo ptpd -M -V -i eth0
Device side:
sudo ptpd -s -V -i eth0
6. 调试记录
主端使用下面的命令
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.1/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
date 010100002018
phc_ctl /dev/ptp0 set
phc_ctl /dev/ptp0 get
ptp4l -i eth0 -m -H
phc2sys -m -s CLOCK_REALTIME -c eth0 -w
从端使用以下命令
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 0.0.0.0
ip addr add 10.0.0.2/24 dev eth0
ip link set dev eth0 up
timedatectl set-ntp false
phc_ctl /dev/ptp0 get
ptp4l -i eth0 -p /dev/ptp0 -s -m
phc2sys -a -r -m
附加主从侧的日志
root@linux:/home/nvidia# ptp4l -i eth0 -m -H
ptp4l[186.842]: selected /dev/ptp0 as PTP clock
ptp4l[186.844]: port 1 (eth0): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[186.845]: port 0 (/var/run/ptp4l): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[186.845]: port 0 (/var/run/ptp4lro): INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[193.957]: port 1 (eth0): LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[193.957]: selected local clock 48b02d.fffe.07645e as best master
ptp4l[193.957]: port 1 (eth0): assuming the grand master role
ptp4l[245.714]: port 1 (eth0): link down
ptp4l[245.714]: port 1 (eth0): MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED)
ptp4l[245.714]: port 1 (eth0): assuming the grand master role
ptp4l[254.625]: port 1 (eth0): link up
ptp4l[254.626]: port 1 (eth0): FAULTY to LISTENING on INIT_COMPLETE
ptp4l[260.711]: port 1 (eth0): LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[260.711]: port 1 (eth0): assuming the grand master role
---------------------------------------------------------------------------------
root@linux:/home/nvidia# sudo /usr/local/sbin/phc2sys -m -s CLOCK_REALTIME -c eth0 -w
phc2sys[2640.073]: eth0 sys offset -39792 s0 freq +280 delay 3552
phc2sys[2641.074]: eth0 sys offset -40032 s1 freq +40 delay 3552
phc2sys[2642.074]: eth0 sys offset -96 s2 freq -56 delay 3552
phc2sys[2643.074]: eth0 sys offset -16 s2 freq -5 delay 3520
phc2sys[2644.075]: eth0 sys offset -16 s2 freq -9 delay 3520
phc2sys[2645.075]: eth0 sys offset 0 s2 freq +2 delay 3552
phc2sys[2646.075]: eth0 sys offset 0 s2 freq +2 delay 3552
phc2sys[2647.075]: eth0 sys offset 16 s2 freq +18 delay 3520
phc2sys[2648.076]: eth0 sys offset -16 s2 freq -9 delay 3552
phc2sys[2649.076]: eth0 sys offset -16 s2 freq -14 delay 3552
phc2sys[2650.076]: eth0 sys offset 16 s2 freq +13 delay 3520
phc2sys[2651.077]: eth0 sys offset 0 s2 freq +2 delay 3520
phc2sys[2652.077]: eth0 sys offset -16 s2 freq -14 delay 3488
phc2sys[2653.077]: eth0 sys offset 0 s2 freq -3 delay 3552
phc2sys[2654.077]: eth0 sys offset -16 s2 freq -19 delay 3520
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包
92
收藏
评论
打赏
- 分享
- 举报
评论
0个
手气红包
暂无数据
相关专栏
-
浏览量:9480次2021-05-25 17:31:40
-
浏览量:9321次2021-05-19 17:32:00
-
浏览量:7556次2021-05-20 17:08:14
-
浏览量:7981次2021-05-25 15:32:16
-
浏览量:7156次2021-05-20 16:37:42
-
浏览量:7271次2021-07-31 15:26:23
-
浏览量:4347次2021-07-22 14:48:32
-
浏览量:8673次2021-05-14 14:43:43
-
浏览量:9515次2021-04-27 17:56:41
-
浏览量:7503次2021-05-11 17:51:48
-
浏览量:9578次2021-05-26 14:17:15
-
2021-04-23 15:54:21
-
浏览量:7214次2021-07-29 14:18:58
-
浏览量:5984次2021-05-28 13:52:17
-
浏览量:5113次2021-07-29 11:53:53
-
浏览量:7482次2021-05-27 16:16:56
-
浏览量:10964次2021-05-06 16:22:01
-
2021-05-06 16:03:00
-
浏览量:7140次2021-05-11 17:04:57
切换马甲
上一页
下一页
打赏用户
共 1 位
我要创作
分享技术经验,可获取创作收益
分类专栏
-
178篇
热门专栏
- Jetson Nano平台更改DP1上DisplayPort的设备树4
- GameWorks如何将先进的水特特效带到的游戏中?
- NVIDIA Tegra K1设备包揽Futuremark 12月GPU榜单前三甲!
- NVIDIA Tegra K1在Google I/O大会大放异彩
- 《战锤40K:永恒远征》介绍:史诗级战役等你参加
- nvidia xavier nx平台GStreamer pipeline挂起问题调试2
- 准备接招吧!你必须知道的《魔兽世界•德拉诺之王》
- xavier nx平台调试spi从模式3
- 简单两步让Adobe Illustrator CC速度提升十倍
- Nfan的盛大节日!2014英伟达游戏群英汇正式开幕!
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者
free-jdx
您的支持将鼓励我继续创作!
打赏金额:
¥1
¥5
¥10
¥50
¥100
支付方式:
微信支付
打赏成功!
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注