Skip to content

Implement reset reason mechanism to detect

Jason Xing linux-trace-kernel mptcp netdev 10 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest7 patches 8 repliesApplied 7/7
  2. v87 patches 7 repliesSuperseded
  3. v77 patches 9 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v6 posting 2/27 patches1 replySuperseded
v6 posting 1/27 patches18 repliesSuperseded
v57 patches2 repliesSuperseded
v46 patches12 repliesSuperseded
v36 patches7 repliesSuperseded
v26 patches2 repliesSuperseded
v16 patches2 repliesSuperseded

Patches in v9 All 7 applied

#Subject and filesSizeRepliesApplied
1/7net: introduce rstreason to detect why the RST is sentinclude/net/rstreason.h+106 -01 replyApplied
2/7rstreason: prepare for passive resetinclude/net/request_sock.h net/dccp/ipv4.c net/dccp/ipv6.c +5 more+40 -251 replyApplied
3/7rstreason: prepare for active resetinclude/net/tcp.h net/ipv4/tcp.c net/ipv4/tcp_output.c +3 more+26 -131 replyApplied
4/7tcp: support rstreason for passive resetinclude/net/rstreason.h net/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c+29 -80 repliesApplied
5/7mptcp: support rstreason for passive resetnet/mptcp/protocol.h net/mptcp/subflow.c+44 -51 replyApplied
6/7mptcp: introducing a helper into active reset logicnet/mptcp/protocol.c net/mptcp/protocol.h net/mptcp/subflow.c+14 -71 replyApplied
7/7rstreason: make it work in trace worldinclude/trace/events/tcp.h net/ipv4/tcp_ipv4.c net/ipv4/tcp_output.c +1 more+25 -71 replyApplied

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMatthieu Baerts (NGI0)Steven Rostedt (Google)Eric Dumazet
SeriesR-b
1/7A-b R-b
2/7A-b R-b
3/7A-b R-b
4/7
5/7R-b R-b
6/7R-b R-b
7/7R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v9 thread

Cover letter [PATCH net-next v9 0/7] Implement reset reason mechanism to detect

From: Jason Xing <[email protected]>

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, such as active reset reasons which can not be replace by skb drop reason or something like this.

In this series, I focus on the fundamental implement mostly about how the rstreason mechanism 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

v9

1. address nit problem (Matt)
2. add acked-by and reviewed-by tags (Matt)

v8

1. put sk reset reasons into more natural order (Matt)
2. adjust those helper position (Matt)
3. rename two convert function (Matt)
4. make the kdoc format correct (Simon)

v7

1. get rid of enum casts which could bring potential issues (Eric)
2. use switch-case method to map between reset reason in MPTCP and sk reset reason (Steven)
3. use switch-case method to map between skb drop reason and sk reset reason

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

v5

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

1. passing 'enum sk_rst_reason' for readability when tracing (Antoine)

v3

1. rebase (mptcp part) and address what Mat suggested.

v2

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    | 121 +++++++++++++++++++++++++++++++++++++
 include/net/tcp.h          |   3 +-
 include/trace/events/tcp.h |  26 ++++++--
 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        |  17 ++++--
 net/ipv4/tcp_minisocks.c   |   3 +-
 net/ipv4/tcp_output.c      |   5 +-
 net/ipv4/tcp_timer.c       |   9 ++-
 net/ipv6/tcp_ipv6.c        |  20 +++---
 net/mptcp/protocol.c       |   2 +-
 net/mptcp/protocol.h       |  38 ++++++++++++
 net/mptcp/subflow.c        |  27 ++++++---
 16 files changed, 266 insertions(+), 47 deletions(-)
 create mode 100644 include/net/rstreason.h
Signature · 1 line
2.37.3