Thread (3 messages) 3 messages, 2 authors, 2025-06-30

Re: [PATCH net-next] tcp: add retransmission quit reasons to tracepoint

From: Eric Dumazet <edumazet@google.com>
Date: 2025-06-30 09:11:55
Also in: lkml, netdev

On Mon, Jun 30, 2025 at 1:05 AM [off-list ref] wrote:
From: Fan Yu <fan.yu9@zte.com.cn>

Problem
=======
When TCP retransmits a packet due to missing ACKs, the retransmission
may fail for various reasons (e.g., packets stuck in driver queues,
sequence errors, or routing issues). Currently, these failure reasons
are internally handled in __tcp_retransmit_skb() but lack visibility to
userspace, which makes it difficult to diagnose retransmission failures in
production environments.

Solution
=======
This patch adds a reason field to the tcp_retransmit_skb tracepoint,
enumerating with explicit failure cases:
TCP_RETRANS_IN_HOST_QUEUE          (packet still queued in driver)
TCP_RETRANS_END_SEQ_ERROR          (invalid end sequence)
TCP_RETRANS_TRIM_HEAD_NOMEM      (trim head no memory)
TCP_RETRANS_UNCLONE_NOMEM    (skb unclone keeptruesize no memory)
TCP_RETRANS_FRAG_NOMEM       (fragment no memory)
TCP_RETRANS_ROUTE_FAIL       (routing failure)
TCP_RETRANS_RCV_ZERO_WINDOW  (closed recevier window)
TCP_RETRANS_PSKB_COPY_NOBUFS (no buffer for skb copy)
TCP_RETRANS_QUIT_UNDEFINED   (quit reason undefined)
'undefined' ?
Impact
======
1. Enables BPF programs to filter retransmission failures by reason.
2. Allows precise failure rate monitoring via ftrace.

Co-developed-by: xu xin <xu.xin16@zte.com.cn>
Signed-off-by: xu xin <xu.xin16@zte.com.cn>
Signed-off-by: Fan Yu <fan.yu9@zte.com.cn>
Problem is that this patch breaks the original trace point, without
any mention of the potential consequences in the changelog ?

commit e086101b150ae8e99e54ab26101ef3835fa9f48d
Author: Cong Wang [off-list ref]
Date:   Fri Oct 13 13:03:16 2017 -0700

    tcp: add a tracepoint for tcp retransmission
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help