From: Jakub Kicinski <kuba@kernel.org>
To: edumazet@kernel.org
Cc: Jason Xing <kerneljasonxing@gmail.com>,
davem@davemloft.net, pabeni@redhat.com, horms@kernel.org,
willemb@google.com, kuniyu@google.com, netdev@vger.kernel.org
Subject: Re: [PATCH v3 net] tcp: preserve timestamps across receive queue collapse
Date: Tue, 29 Sep 2026 16:54:25 -0700 [thread overview]
Message-ID: <20260929165425.53ee002c@kernel.org> (raw)
In-Reply-To: <20260929165318.6690d427@kernel.org>
On Tue, 29 Sep 2026 16:53:18 -0700 Jakub Kicinski wrote:
> On Thu, 24 Sep 2026 23:25:29 +0800 Jason Xing wrote:
> > When tcp_collapse() rebuilds skbs under memory pressure, the copy
> > process doesn't include the right tstamp and hwtstamp from the
> > old skb. And memcpy(nskb->cb, skb->cb, ...) copies has_rxtstamp,
> > but nskb->tstamp and hwtstamps are left at zero, so
> > tcp_recv_timestamp() ends up emitting no cmsg at all.
> >
> > In net timestamping case, if such an skb happens to be the last
> > one consumed in a recvmsg() call, the application receives no RX
> > timestamp for that call.
> >
> > Fix this by copying both tstamp and hwtstamp of the last skb to
> > the new skb, matching tcp_try_coalesce()/tcp_add_backlog().
> >
> > Note that the has_rxtstamp flag can still be inherited through
> > the cb memcpy from an skb that contributes no bytes (fully covered
> > skb left in the ofo tree by the tcp_ooo_try_coalesce() ->
> > coalesce_done path), so set TCP_SKB_CB(nskb)->has_rxtstamp to false
> > which makes the new block the only place setting it.
> >
> > Fixes: 98aaa913b4ed ("tcp: Extend SOF_TIMESTAMPING_RX_SOFTWARE to TCP recvmsg")
> > Signed-off-by: Jason Xing <kerneljasonxing@gmail.com>
> > ---
> > V3
> > Link: https://lore.kernel.org/all/20260917132742.87117-1-kerneljasonxing@gmail.com/
> > 1. revise the commit message with more accurate description (Eric)
> > 2. fix a corner case (where a skb can contribute no bytes if OOO happens)
> > spotted by AI and Eric
>
> Looks good now, Eric?
> https://lore.kernel.org/all/20260924152529.5689-1-kerneljasonxing@gmail.com/
>
> (Jason, please see net for the up-to-date email addr for Eric)
I meant to also say - I'm leaning towards net-next on this one.
Please LMK if you disagree
next prev parent reply other threads:[~2026-09-29 23:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 15:25 [PATCH v3 net] tcp: preserve timestamps across receive queue collapse Jason Xing
2026-09-29 23:53 ` Jakub Kicinski
2026-09-29 23:54 ` Jakub Kicinski [this message]
2026-09-30 1:53 ` Jason Xing
2026-09-30 1:56 ` Jason Xing
2026-09-30 2:19 ` Jakub Kicinski
2026-09-30 6:35 ` Eric Dumazet
2026-09-30 6:37 ` Eric Dumazet
2026-09-30 21:00 ` patchwork-bot+netdevbpf
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=20260929165425.53ee002c@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kerneljasonxing@gmail.com \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).