public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Kohei Enju <kohei@enjuk.jp>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Willem de Bruijn <willemb@google.com>,
	David Ahern <dsahern@kernel.org>,
	Neal Cardwell <ncardwell@google.com>,
	Gerhard Engleder <gerhard@engleder-embedded.com>,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Kohei Enju <kohei@enjuk.jp>
Subject: [PATCH net v1 0/3] af_packet/tcp: fix late hardware timestamp handling
Date: Wed, 29 Apr 2026 09:16:16 +0000	[thread overview]
Message-ID: <20260429091632.26509-1-kohei@enjuk.jp> (raw)

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(-)

-- 
2.53.0


             reply	other threads:[~2026-04-29  9:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29  9:16 Kohei Enju [this message]
2026-04-29  9:16 ` [PATCH net v1 1/3] net: introduce helper to resolve hardware timestamps from skb Kohei Enju
2026-04-29 21:04   ` Willem de Bruijn
2026-04-30  4:50     ` Kohei Enju
2026-05-01 20:25   ` Gerhard Engleder
2026-04-29  9:16 ` [PATCH net v1 2/3] af_packet: use skb_get_hwtstamp() for hardware timestamps Kohei Enju
2026-04-29  9:16 ` [PATCH net v1 3/3] tcp: " Kohei Enju
2026-04-29 21:09   ` Willem de Bruijn
2026-04-30  5:07     ` Kohei Enju
2026-04-30  6:09       ` Eric Dumazet
2026-04-30  6:52         ` Kohei Enju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260429091632.26509-1-kohei@enjuk.jp \
    --to=kohei@enjuk.jp \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=gerhard@engleder-embedded.com \
    --cc=horms@kernel.org \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox