Quantcast
Channel: Active questions tagged 22.04 - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4417

RealTek RTL8125 ethernet controller: IEEE-1588/PTP support in Ubuntu 22.04.3?

$
0
0

I have a desktop with a Gigabyte B650 AORUS ELITE AX motherboard, to which I've installed Ubuntu 22.04.3. I am trying to use this desktop as an IEEE-1588 (Precision Time Protocol) master, in a small local network which contains only an unmanaged switch and another device which I hope to synchronize time with.

I noticed when I went to launch ptp4l that I did not have any /dev/ptpX nodes, and after investingating with ethtool -T, I see that my interface seems to support neither hardware nor software timestamping (unless this page is incorrect, which says that my output indicates no support; either way I tried with software mode and the results were not stable enough for me to use):

$ ethtool -T enp8s0Time stamping parameters for enp8s0:Capabilities:    software-transmit    software-receive    software-system-clockPTP Hardware Clock: noneHardware Transmit Timestamp Modes: noneHardware Receive Filter Modes: none

Looking into the controller on my mobo, I find that its a RealTek R8125:

$ lspci | grep Ethernet08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)

Which according to RealTek, I think should support PTP hardware timestamping. RealTek does provide linux drivers for this device, however the driver I need (2.5G/5G Ethernet LINUX driver r8125) is listed as 'for up to kernel version 6.4' (I am on 6.5.0). I tried build/installing that anyway and was able to after enabling PTP in the makefile, and ethtool is now showing support:

ethtool -T enp8s0Time stamping parameters for enp8s0:Capabilities:    hardware-transmit    software-transmit    hardware-receive    software-receive    software-system-clock    hardware-raw-clockPTP Hardware Clock: 0Hardware Transmit Timestamp Modes:    off    onHardware Receive Filter Modes:    none    ptpv2-l4-event    ptpv2-l4-sync    ptpv2-l4-delay-req    ptpv2-event    ptpv2-sync    ptpv2-delay-req

However, when I try to launch ptp4l, it is killed, and I see the following in the kernel log:

$ sudo ptp4l -i enp8s0 -p /dev/ptp0 -mptp4l[2665.771]: selected /dev/ptp0 as PTP clockKilled$ sudo dmesg...[ 2891.569055] BUG: kernel NULL pointer dereference, address: 0000000000000000[ 2891.569059] #PF: supervisor instruction fetch in kernel mode[ 2891.569061] #PF: error_code(0x0010) - not-present page[ 2891.569063] PGD 0 P4D 0 [ 2891.569066] Oops: 0010 [#4] PREEMPT SMP NOPTI[ 2891.569068] CPU: 19 PID: 7502 Comm: ptp4l Tainted: P      D    OE      6.5.0-15-generic #15~22.04.1-Ubuntu[ 2891.569070] Hardware name: Gigabyte Technology Co., Ltd. B650 AORUS ELITE AX/B650 AORUS ELITE AX, BIOS FB 07/10/2023[ 2891.569072] RIP: 0010:0x0[ 2891.569092] Code: Unable to access opcode bytes at 0xffffffffffffffd6.[ 2891.569094] RSP: 0018:ffffc115866d3d10 EFLAGS: 00010286[ 2891.569096] RAX: 0000000000000000 RBX: ffff9b97039de000 RCX: 00000000071c71c7[ 2891.569097] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9b9722b20768[ 2891.569098] RBP: ffffc115866d3d40 R08: 0000000000000000 R09: 0000000000000000[ 2891.569099] R10: 0000000000000000 R11: 0000000000000000 R12: ffffc115866d3d98[ 2891.569101] R13: ffff9b97039df518 R14: 0000000000000000 R15: 0000000000000000[ 2891.569102] FS:  00007fdfdaa96740(0000) GS:ffff9ba6186c0000(0000) knlGS:0000000000000000[ 2891.569103] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033[ 2891.569105] CR2: ffffffffffffffd6 CR3: 000000010eb8e000 CR4: 0000000000750ee0[ 2891.569106] PKRU: 55555554[ 2891.569107] Call Trace:[ 2891.569109]  <TASK>[ 2891.569111]  ? show_regs+0x6d/0x80[ 2891.569116]  ? __die+0x24/0x80[ 2891.569119]  ? page_fault_oops+0x99/0x1b0[ 2891.569123]  ? do_user_addr_fault+0x31d/0x6b0[ 2891.569126]  ? exc_page_fault+0x83/0x1b0[ 2891.569130]  ? asm_exc_page_fault+0x27/0x30[ 2891.569136]  ptp_clock_adjtime+0xf5/0x230[ 2891.569140]  pc_clock_adjtime+0x70/0xc0[ 2891.569143]  __do_sys_clock_adjtime+0x9e/0x140[ 2891.569149]  __x64_sys_clock_adjtime+0x15/0x20[ 2891.569151]  do_syscall_64+0x58/0x90[ 2891.569154]  ? srso_alias_return_thunk+0x5/0x7f[ 2891.569157]  ? exit_to_user_mode_prepare+0x30/0xb0[ 2891.569160]  ? srso_alias_return_thunk+0x5/0x7f[ 2891.569162]  ? syscall_exit_to_user_mode+0x37/0x60[ 2891.569165]  ? srso_alias_return_thunk+0x5/0x7f[ 2891.569167]  ? do_syscall_64+0x67/0x90[ 2891.569169]  ? srso_alias_return_thunk+0x5/0x7f[ 2891.569171]  ? do_syscall_64+0x67/0x90[ 2891.569173]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8[ 2891.569175] RIP: 0033:0x7fdfda92644b[ 2891.569179] Code: 8b 15 e9 39 0f 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa b8 31 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 8b 15 b1 39 0f 00 f7 d8[ 2891.569180] RSP: 002b:00007ffd99830ad8 EFLAGS: 00000286 ORIG_RAX: 0000000000000131[ 2891.569182] RAX: ffffffffffffffda RBX: 0000556e69a442a0 RCX: 00007fdfda92644b[ 2891.569183] RDX: 00007ffd99830d70 RSI: 00007ffd99830b00 RDI: 00000000ffffffdb[ 2891.569185] RBP: 00000000ffffffdb R08: 0000000000000000 R09: 0000000000000000[ 2891.569186] R10: 0000000000000000 R11: 0000000000000286 R12: 00000000071c71c7[ 2891.569187] R13: 0000556e688c12db R14: 0000556e688ca720 R15: 0000556e688c136b[ 2891.569190]  </TASK>[ 2891.569191] Modules linked in: uhid rfcomm nfnetlink ccm cmac algif_hash algif_skcipher af_alg nvidia_uvm(PO) bnep intel_rapl_msr intel_rapl_common nvidia_drm(PO) snd_hda_codec_realtek edac_mce_amd snd_hda_codec_generic nvidia_modeset(PO) binfmt_misc ledtrig_audio snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi rtw89_8852ce snd_hda_codec rtw89_8852c snd_hda_core snd_hwdep rtw89_pci snd_pcm rtw89_core snd_seq_midi snd_seq_midi_event mac80211 kvm snd_rawmidi btusb btrtl btbcm btintel snd_seq irqbypass nvidia(PO) btmtk nls_iso8859_1 snd_seq_device rapl input_leds bluetooth ftdi_sio cdc_mbim snd_timer usbserial gigabyte_wmi cdc_wdm wmi_bmof cfg80211 ecdh_generic k10temp ccp ecc snd libarc4 soundcore mac_hid sch_fq_codel msr parport_pc ppdev lp parport efi_pstore ip_tables x_tables autofs4 dm_crypt hid_generic cdc_ncm cdc_ether usbnet mii usbhid hid amdgpu amdxcp iommu_v2 drm_buddy gpu_sched i2c_algo_bit drm_suballoc_helper drm_ttm_helper ttm drm_display_helper crct10dif_pclmul cec crc32_pclmul[ 2891.569257]  polyval_clmulni rc_core polyval_generic ghash_clmulni_intel aesni_intel drm_kms_helper crypto_simd cryptd nvme drm ahci xhci_pci i2c_piix4 libahci xhci_pci_renesas nvme_core r8125(OE) nvme_common video wmi[ 2891.569273] CR2: 0000000000000000[ 2891.569276] ---[ end trace 0000000000000000 ]---[ 2891.915705] RIP: 0010:0x0[ 2891.915712] Code: Unable to access opcode bytes at 0xffffffffffffffd6.[ 2891.915713] RSP: 0018:ffffc1159d207cb0 EFLAGS: 00010286[ 2891.915715] RAX: 0000000000000000 RBX: ffff9b97039de000 RCX: 00000000071c71c7[ 2891.915717] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9b9722b20768[ 2891.915718] RBP: ffffc1159d207ce0 R08: 0000000000000000 R09: 0000000000000000[ 2891.915719] R10: 0000000000000000 R11: 0000000000000000 R12: ffffc1159d207d38[ 2891.915720] R13: ffff9b97039df518 R14: 0000000000000000 R15: 0000000000000000[ 2891.915721] FS:  00007fdfdaa96740(0000) GS:ffff9ba6186c0000(0000) knlGS:0000000000000000[ 2891.915723] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033[ 2891.915724] CR2: ffffffffffffffd6 CR3: 000000010eb8e000 CR4: 0000000000750ee0[ 2891.915726] PKRU: 55555554[ 2891.915727] note: ptp4l[7502] exited with irqs disabled

EDIT:I did find another question which mentions that there is a version of this driver in apt repos: r8125-dkms which uses dkms (something I just learned of today). That version compiles without PTP support however:

$ ethtool -i enp8s0driver: r8125$ ethtool -T enp8s0Time stamping parameters for enp8s0:Capabilities:    software-transmit    software-receive    software-system-clockPTP Hardware Clock: noneHardware Transmit Timestamp Modes: noneHardware Receive Filter Modes: none

I am hoping someone can help me solve this problem at any level; be it through some ptp4l configuration or patching the driver/something else. I would really like to have hardware timestamping support, but a functional ptp synchronization is the main ask. (In software mode, I was not able to achieve offset stable under 1000ns, with may large jumps to +-100000ns)


Viewing all articles
Browse latest Browse all 4417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>