mbox series

[net-next,0/2] tcp: update TCPCB_EVER_RETRANS after trace_tcp_retransmit_skb()

Message ID 20240421042009.28046-1-lulie@linux.alibaba.com (mailing list archive)
Headers show
Series tcp: update TCPCB_EVER_RETRANS after trace_tcp_retransmit_skb() | expand

Message

Philo Lu April 21, 2024, 4:20 a.m. UTC
Move TCPCB_EVER_RETRANS updating after the trace_tcp_retransmit_skb()
in __tcp_retransmit_skb(), and then we are aware of whether the skb has
ever been retransmitted in this tracepoint. This can be used, e.g., to get
retransmission efficiency by counting skbs w/ and w/o TCPCB_EVER_RETRANS
(through bpf tracing programs).

For this purpose, TCPCB_EVER_RETRANS is also needed to be exposed to bpf.
Previously, the flags are defined as macros in struct tcp_skb_cb. I moved them
out into a new enum, and then they can be accessed with vmlinux.h.

We have discussed to achieve this with BPF_SOCK_OPS in [0], and using
tracepoint is thought to be a better solution.

[0]
https://lore.kernel.org/all/20240417124622.35333-1-lulie@linux.alibaba.com/

Philo Lu (2):
  tcp: move tcp_skb_cb->sacked flags to enum
  tcp: update sacked after tracepoint in __tcp_retransmit_skb

 include/net/tcp.h     | 22 +++++++++++++---------
 net/ipv4/tcp_output.c | 11 ++++++-----
 2 files changed, 19 insertions(+), 14 deletions(-)

--
2.32.0.3.g01195cf9f

Comments

patchwork-bot+netdevbpf@kernel.org April 25, 2024, 8 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Sun, 21 Apr 2024 12:20:07 +0800 you wrote:
> Move TCPCB_EVER_RETRANS updating after the trace_tcp_retransmit_skb()
> in __tcp_retransmit_skb(), and then we are aware of whether the skb has
> ever been retransmitted in this tracepoint. This can be used, e.g., to get
> retransmission efficiency by counting skbs w/ and w/o TCPCB_EVER_RETRANS
> (through bpf tracing programs).
> 
> For this purpose, TCPCB_EVER_RETRANS is also needed to be exposed to bpf.
> Previously, the flags are defined as macros in struct tcp_skb_cb. I moved them
> out into a new enum, and then they can be accessed with vmlinux.h.
> 
> [...]

Here is the summary with links:
  - [net-next,1/2] tcp: move tcp_skb_cb->sacked flags to enum
    https://git.kernel.org/netdev/net-next/c/14b5fb2145ca
  - [net-next,2/2] tcp: update sacked after tracepoint in __tcp_retransmit_skb
    https://git.kernel.org/netdev/net-next/c/2bf90a57f0e6

You are awesome, thank you!