mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v6 0/7] Implement reset reason mechanism to detect
@ 2024-04-17  8:51 Jason Xing
  2024-04-17  8:51 ` [PATCH net-next v6 1/7] net: introduce rstreason to detect why the RST is sent Jason Xing
                   ` (8 more replies)
  0 siblings, 9 replies; 26+ messages in thread
From: Jason Xing @ 2024-04-17  8:51 UTC (permalink / raw)
  To: edumazet, dsahern, matttbe, martineau, geliang, kuba, pabeni,
	davem, rostedt, mhiramat, mathieu.desnoyers, atenart
  Cc: mptcp, netdev, linux-trace-kernel, kerneljasonxing, Jason Xing

From: Jason Xing <kernelxing@tencent.com>

In production, there are so many cases about why the RST skb is sent but
we don't have a very convenient/fast method to detect the exact underlying
reasons.

RST is implemented in two kinds: passive kind (like tcp_v4_send_reset())
and active kind (like tcp_send_active_reset()). The former can be traced
carefully 1) in TCP, with the help of drop reasons, which is based on
Eric's idea[1], 2) in MPTCP, with the help of reset options defined in
RFC 8684. The latter is relatively independent, which should be
implemented on our own.

In this series, I focus on the fundamental implement mostly about how
the rstreason mechnism works and give the detailed passive part as an
example, not including the active reset part. In future, we can go
further and refine those NOT_SPECIFIED reasons.

Here are some examples when tracing:
<idle>-0       [002] ..s1.  1830.262425: tcp_send_reset: skbaddr=x
        skaddr=x src=x dest=x state=x reason=NOT_SPECIFIED
<idle>-0       [002] ..s1.  1830.262425: tcp_send_reset: skbaddr=x
        skaddr=x src=x dest=x state=x reason=NO_SOCKET

[1]
Link: https://lore.kernel.org/all/CANn89iJw8x-LqgsWOeJQQvgVg6DnL5aBRLi10QN2WBdr+X4k=w@mail.gmail.com/

v6
1. add back casts, or else they are treated as error.

v5
Link: https://lore.kernel.org/all/20240411115630.38420-1-kerneljasonxing@gmail.com/
1. address format issue (like reverse xmas tree) (Eric, Paolo)
2. remove unnecessary casts. (Eric)
3. introduce a helper used in mptcp active reset. See patch 6. (Paolo)

v4
Link: https://lore.kernel.org/all/20240409100934.37725-1-kerneljasonxing@gmail.com/
1. passing 'enum sk_rst_reason' for readability when tracing (Antoine)

v3
Link: https://lore.kernel.org/all/20240404072047.11490-1-kerneljasonxing@gmail.com/
1. rebase (mptcp part) and address what Mat suggested.

v2
Link: https://lore.kernel.org/all/20240403185033.47ebc6a9@kernel.org/
1. rebase against the latest net-next tree



Jason Xing (7):
  net: introduce rstreason to detect why the RST is sent
  rstreason: prepare for passive reset
  rstreason: prepare for active reset
  tcp: support rstreason for passive reset
  mptcp: support rstreason for passive reset
  mptcp: introducing a helper into active reset logic
  rstreason: make it work in trace world

 include/net/request_sock.h |  4 +-
 include/net/rstreason.h    | 93 ++++++++++++++++++++++++++++++++++++++
 include/net/tcp.h          |  3 +-
 include/trace/events/tcp.h | 37 +++++++++++++--
 net/dccp/ipv4.c            | 10 ++--
 net/dccp/ipv6.c            | 10 ++--
 net/dccp/minisocks.c       |  3 +-
 net/ipv4/tcp.c             | 15 ++++--
 net/ipv4/tcp_ipv4.c        | 14 +++---
 net/ipv4/tcp_minisocks.c   |  3 +-
 net/ipv4/tcp_output.c      |  5 +-
 net/ipv4/tcp_timer.c       |  9 ++--
 net/ipv6/tcp_ipv6.c        | 17 ++++---
 net/mptcp/protocol.c       |  2 +-
 net/mptcp/protocol.h       | 11 +++++
 net/mptcp/subflow.c        | 27 ++++++++---
 16 files changed, 216 insertions(+), 47 deletions(-)
 create mode 100644 include/net/rstreason.h

-- 
2.37.3


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2024-04-20  3:23 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17  8:51 [PATCH net-next v6 0/7] Implement reset reason mechanism to detect Jason Xing
2024-04-17  8:51 ` [PATCH net-next v6 1/7] net: introduce rstreason to detect why the RST is sent Jason Xing
2024-04-17  9:01   ` Eric Dumazet
2024-04-17  9:22     ` Jason Xing
2024-04-17  8:51 ` [PATCH net-next v6 2/7] rstreason: prepare for passive reset Jason Xing
2024-04-17  8:51 ` [PATCH net-next v6 3/7] rstreason: prepare for active reset Jason Xing
2024-04-17  8:51 ` [PATCH net-next v6 4/7] tcp: support rstreason for passive reset Jason Xing
2024-04-17  8:51 ` [PATCH net-next v6 5/7] mptcp: " Jason Xing
2024-04-17  8:51 ` [PATCH net-next v6 6/7] mptcp: introducing a helper into active reset logic Jason Xing
2024-04-17  8:51 ` [PATCH net-next v6 7/7] rstreason: make it work in trace world Jason Xing
2024-04-17  9:41 ` [PATCH net-next v6 0/7] Implement reset reason mechanism to detect MPTCP CI
2024-04-18  3:30 ` Jason Xing
2024-04-18 15:46   ` Jakub Kicinski
2024-04-18 16:23     ` Jason Xing
2024-04-18 18:51       ` Eric Dumazet
2024-04-18 22:29         ` Jason Xing
2024-04-18 22:40           ` Jason Xing
2024-04-18 23:26         ` Jason Xing
2024-04-19  2:30           ` Jason Xing
2024-04-19  7:02             ` Eric Dumazet
2024-04-19  7:28               ` Jason Xing
2024-04-19  7:44                 ` Eric Dumazet
2024-04-19  8:00                   ` Jason Xing
2024-04-19  8:06                     ` Jason Xing
2024-04-20  2:35                     ` Steven Rostedt
2024-04-20  3:22                       ` Jason Xing

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