Skip to content

net: tcp: add skb drop reasons to connect request

[email protected] lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- don't free skb in conn_request, as Eric suggested, and use it's return value to pass drop reasons in the 1th patch.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: tcp: add skb drop reasons to tcp connect requestinclude/linux/skbuff.h include/trace/events/skb.h net/ipv4/tcp_input.c +2 more+23 -90 replies
2/2net: tcp: add skb drop reasons to route_req()include/linux/skbuff.h include/net/tcp.h include/trace/events/skb.h +4 more+33 -122 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJiang BiaoHao Peng
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net-next v2 0/2] net: tcp: add skb drop reasons to connect request

From: Menglong Dong <[email protected]>

Seems now the reasons of skb drop in TCP layer are almost supported, except the path of connect requesting. So let's just finish it.

The TCP connect requesting is processed by 'inet_csk(sk)->icsk_af_ops->conn_request()'. Yeah, it's a function pointer, so it's not easy to add function param to it. Luckily, it's return value can be reused. For now, 0 means a call of 'consume_skb()' and -1 means 'kfree_skb()', with a RESET be send. Therefore, we can return the drop reasons directly, as the positive is not used yet. With drop reasons returned, kfree_skb_reason() will be called instead of consume_skb() in tcp_rcv_state_process().

And in the 2th patch, skb drop reasons are added to route_req() in struct tcp_request_sock_ops by adding a function param to it.

Following new skb drop reasons are added:

SKB_DROP_REASON_LISTENOVERFLOWS
SKB_DROP_REASON_TCP_REQQFULLDROP
SKB_DROP_REASON_SECURITY

Changes since v1:
- don't free skb in conn_request, as Eric suggested, and use it's return value to pass drop reasons in the 1th patch.

Menglong Dong (2):
net: tcp: add skb drop reasons to tcp connect request
net: tcp: add skb drop reasons to route_req()

 include/linux/skbuff.h     |  5 +++++
 include/net/tcp.h          |  3 ++-
 include/trace/events/skb.h |  3 +++
 net/ipv4/tcp_input.c       | 22 +++++++++++++++-------
 net/ipv4/tcp_ipv4.c        | 16 ++++++++++++----
 net/ipv6/tcp_ipv6.c        | 18 +++++++++++++-----
 net/mptcp/subflow.c        | 10 ++++++----
 7 files changed, 56 insertions(+), 21 deletions(-)
Signature · 1 line
2.36.0