Skip to content

af_packet/tcp: fix late hardware timestamp handling

Kohei Enju netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: introduce helper to resolve hardware timestamps from skbinclude/linux/skbuff.h net/core/skbuff.c net/socket.c+41 -243 replies
2/3af_packet: use skb_get_hwtstamp() for hardware timestampsnet/packet/af_packet.c+1 -10 replies
3/3tcp: use skb_get_hwtstamp() for hardware timestampsinclude/net/tcp.h net/ipv4/tcp_input.c net/ipv4/tcp_ipv4.c +1 more+9 -54 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net v1 0/3] af_packet/tcp: fix late hardware timestamp handling

Since commit 97dc7cd92ac6 ("ptp: Support late timestamp determination"), skb_shared_hwtstamps may carry netdev_data instead of a resolved hwtstamp. AF_PACKET and TCP could still read that storage as a ktime_t and report bogus hardware timestamps to userspace.

This series factors the late timestamp resolution logic into a common helper, then switches AF_PACKET and TCP to use it.

Notes on SOF_TIMESTAMPING_BIND_PHC:
The generic socket receive timestamping path honors it, but the AF_PACKET and TCP receive paths touched here haven't implemented that behavior.
This series doesn't change that; those paths always resolve timestamps with cycles == false and preserve their timestamp-domain semantics.

Kohei Enju (3):
net: introduce helper to resolve hardware timestamps from skb
af_packet: use skb_get_hwtstamp() for hardware timestamps
tcp: use skb_get_hwtstamp() for hardware timestamps

 include/linux/skbuff.h | 11 +++++++++++
 include/net/tcp.h      |  2 +-
 net/core/skbuff.c      | 27 +++++++++++++++++++++++++++
 net/ipv4/tcp_input.c   |  3 ++-
 net/ipv4/tcp_ipv4.c    |  6 ++++--
 net/ipv6/tcp_ipv6.c    |  3 ++-
 net/packet/af_packet.c |  2 +-
 net/socket.c           | 27 +++------------------------
 8 files changed, 51 insertions(+), 30 deletions(-)
Signature · 1 line
2.53.0