Skip to content

linux/ena: report SOF_TIMESTAMPING_RAW_HARDWARE for RX timestamping capabilities#371

Open
5prairie wants to merge 1 commit into
amzn:masterfrom
5prairie:fix/ethtool-rx-ts-infos-flags
Open

linux/ena: report SOF_TIMESTAMPING_RAW_HARDWARE for RX timestamping capabilities#371
5prairie wants to merge 1 commit into
amzn:masterfrom
5prairie:fix/ethtool-rx-ts-infos-flags

Conversation

@5prairie
Copy link
Copy Markdown

The driver reports SOF_TIMESTAMPING_TX_HARDWARE together with SOF_TIMESTAMPING_RAW_HARDWARE for TX timestamping, but for RX it only advertises SOF_TIMESTAMPING_RX_HARDWARE.

According to the kernel timestamping documentation [1], SOF_TIMESTAMPING_*_HARDWARE flags control timestamp generation, while SOF_TIMESTAMPING_RAW_HARDWARE controls reporting of hardware timestamps to userspace. In practice, both are required to fully describe hardware timestamping capabilities: one to indicate that timestamps are generated in hardware, and the other to indicate that they are exposed to user space.

By omitting SOF_TIMESTAMPING_RAW_HARDWARE from RX capabilities, the reported feature set is inconsistent with TX and may cause userspace to incorrectly assume that RX hardware timestamps are not available.

This is not purely theoretical: some userspace components (e.g. libpcap [2]) check only for SOF_TIMESTAMPING_RAW_HARDWARE when deciding whether to enable adapter-level timestamping. As a result, RX hardware timestamping may be silently unused even when supported by the device.

Report SOF_TIMESTAMPING_RAW_HARDWARE for RX as well to accurately reflect the device capabilities and align RX reporting with TX.

[1] https://docs.kernel.org/networking/timestamping.html
[2] https://github.com/the-tcpdump-group/libpcap/blob/master/pcap-linux.c#L5097

@5prairie 5prairie changed the title ena: report SOF_TIMESTAMPING_RAW_HARDWARE for RX timestamping capabilities linux/ena: report SOF_TIMESTAMPING_RAW_HARDWARE for RX timestamping capabilities Apr 26, 2026
…apabilities

The driver reports SOF_TIMESTAMPING_TX_HARDWARE together with
SOF_TIMESTAMPING_RAW_HARDWARE for TX timestamping, but for RX it only
advertises SOF_TIMESTAMPING_RX_HARDWARE.

According to the kernel timestamping documentation [1],
SOF_TIMESTAMPING_*_HARDWARE flags control timestamp generation, while
SOF_TIMESTAMPING_RAW_HARDWARE controls reporting of hardware timestamps
to userspace. In practice, both are required to fully describe hardware
timestamping capabilities: one to indicate that timestamps are generated
in hardware, and the other to indicate that they are exposed to user
space.

By omitting SOF_TIMESTAMPING_RAW_HARDWARE from RX capabilities, the
reported feature set is inconsistent with TX and may cause userspace to
incorrectly assume that RX hardware timestamps are not available.

This is not purely theoretical: some userspace components (e.g.
libpcap [2]) check only for SOF_TIMESTAMPING_RAW_HARDWARE when deciding
whether to enable adapter-level timestamping. As a result, RX hardware
timestamping may be silently unused even when supported by the device.

Report SOF_TIMESTAMPING_RAW_HARDWARE for RX as well to accurately reflect
the device capabilities and align RX reporting with TX.

[1] https://docs.kernel.org/networking/timestamping.html
[2] https://github.com/the-tcpdump-group/libpcap/blob/master/pcap-linux.c#L5097
@5prairie 5prairie force-pushed the fix/ethtool-rx-ts-infos-flags branch from 79c4bc4 to ccce229 Compare April 26, 2026 14:22
@akiyano
Copy link
Copy Markdown
Contributor

akiyano commented Apr 26, 2026

Hi @5prairie
Thanks for the contribution and the detailed analysis!
We've flagged this for internal review by the feature implementer. We'll follow up once we've had a
chance to look at it more closely.

@davidarinzon
Copy link
Copy Markdown
Contributor

Hi @5prairie

Apologies for the delay in the response.
We will incorporate this change in our next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants