pendulum-project / timestamped-socket

An asynchronous UDP socket that supports timestamping
Other
6 stars 5 forks source link

What kernel version do I need to use bind_phc #66

Closed teodly closed 2 weeks ago

teodly commented 1 month ago

I'm using Linux kernel 6.9.9-100.fc39.x86_64, yet socket.so_timestamping returns EINVAL when configure_timestamping is called with Some bind_phc.

SOF_TIMESTAMPING_BIND_PHC is not documented as of Linux 6.10 (with /latest/ in the documentation URL): https://www.kernel.org/doc/html/latest/networking/timestamping.html .

# ethtool --version
ethtool version 6.9
# ethtool -T enpxxx
Time stamping parameters for enpxxx:
Capabilities:
        hardware-transmit
        software-transmit
        hardware-receive
        software-receive
        software-system-clock
        hardware-raw-clock
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
        off
        on
Hardware Receive Filter Modes:
        none
        all
        ptpv1-l4-sync
        ptpv1-l4-delay-req
        ptpv2-l4-sync
        ptpv2-l4-delay-req
        ptpv2-l2-sync
        ptpv2-l2-delay-req
        ptpv2-event
        ptpv2-sync
        ptpv2-delay-req

Capabilities don't include bind-phc, should they?

davidv1992 commented 3 weeks ago

What configuration options were used to compile the kernel? The documentation of the kernel is spotty at best so that it is not in the documentation doesn't mean anything (unfortunately).

teodly commented 3 weeks ago

It is stock Fedora kernel.

config-6.9.9-100.fc39.x86_64

davidv1992 commented 2 weeks ago

Dove into this, it is a bug on our end. bind_phc can only be done with vclocks, not with the native hardware clocks. Gonna build a fix.

davidv1992 commented 2 weeks ago

Fixed in #70