From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F9124F96A2 for ; Tue, 29 Sep 2026 23:54:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790726067; cv=none; b=olj+nhRx7oQ0iFh+uj0weP4mdqqb5zgIjYhX7Nsh5j4zGT7MbCAaxZ/5aX/lQscW1A88qsN6x6GHdyLet14bhICGS0uCMkynXarZhOb6ZtOVMQpw/c4qomyc9K8LU0ofQwhbIRQB9mxenfqmTJHYwOSym+GNsUIw/O2KTbWFy1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790726067; c=relaxed/simple; bh=3WvNXOlfS6CabQH25IEXP3zpWrTiOxHo8Wh+aTtho5A=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nanB7BHst2HLdxQhw/86gHBx8b/F4s2aKcKaQL5J6ROkQVOWNOKRpfStz5s2Tu18NDeY4UrIWP0OMaQJPriLGjrfZmR9rAr0rcVU04mUFMCBlUY1WBxdmf9hh13WMesHoR3zCojgg1sDTp0r127A77MUALP+X6VwKgg9Xseld2c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c0NVG0mf; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c0NVG0mf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD6DA1F000FF; Tue, 29 Sep 2026 23:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1790726066; bh=088anxMVmAJvfNo4nsPZ/sokgCk3ra7UkWK4fHd+0Lw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=c0NVG0mf0yd3CseNRAZ7cvSXBcNiu0yLMXTM1FCJSm1Vl3TrNXr6aPBn2Xhzbr72y HMgXsn7RBReakuEy49aB7xVO35kD3mPA5v6SOCPenDtvsBzdq2iFI1jG0Oxdm4WOBN yMMikXkcCjE+H8ZwwsdSISlRh2ZtQwhV+ZMqe3QeuWEt03AnqwP4/DiRcj6x7Os+LY ARzvZLWiHAZKdkpZKEMgSW+rVATXhw8JJM4yp6LPLSIyszzojjGi9jynGbzGhjcJVW IVw3X/YweM+EaaS+kIXU11btNDNHBuCLjkRFO24nJTCel/2JVT3+Ia7xOkLzUOP33o Jfo9HZcRf7i/g== Date: Tue, 29 Sep 2026 16:54:25 -0700 From: Jakub Kicinski To: edumazet@kernel.org Cc: Jason Xing , 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 Message-ID: <20260929165425.53ee002c@kernel.org> In-Reply-To: <20260929165318.6690d427@kernel.org> References: <20260924152529.5689-1-kerneljasonxing@gmail.com> <20260929165318.6690d427@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 > > --- > > 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