Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: tcp: add skb drop reasons to connect request
@ 2022-04-26  8:07 menglong8.dong
  2022-04-26  8:07 ` [PATCH net-next 1/2] net: add skb drop reasons to inet " menglong8.dong
  2022-04-26  8:07 ` [PATCH net-next 2/2] net: tcp: add skb drop reasons to route_req() menglong8.dong
  0 siblings, 2 replies; 5+ messages in thread
From: menglong8.dong @ 2022-04-26  8:07 UTC (permalink / raw)
  To: kuba
  Cc: rostedt, mingo, davem, yoshfuji, dsahern, pabeni, benbjiang,
	flyingpeng, imagedong, edumazet, kafai, talalahmad, keescook,
	mengensun, dongli.zhang, linux-kernel, netdev

From: Menglong Dong <imagedong@tencent.com>

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
free skb with 'kfree_skb_reason()' in 'conn_request()' and return 1.
While 1 is returned, we do nothing outside. This work is done in the
1th patch.

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

Menglong Dong (2):
  net: add skb drop reasons to inet 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/dccp/input.c           | 12 +++++-------
 net/ipv4/tcp_input.c       | 23 ++++++++++++++---------
 net/ipv4/tcp_ipv4.c        | 17 +++++++++++++----
 net/ipv6/tcp_ipv6.c        | 14 +++++++++++---
 net/mptcp/subflow.c        | 10 ++++++----
 8 files changed, 59 insertions(+), 28 deletions(-)

-- 
2.36.0


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

end of thread, other threads:[~2022-04-28  2:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-26  8:07 [PATCH net-next 0/2] net: tcp: add skb drop reasons to connect request menglong8.dong
2022-04-26  8:07 ` [PATCH net-next 1/2] net: add skb drop reasons to inet " menglong8.dong
2022-04-26 13:32   ` Eric Dumazet
2022-04-28  2:31     ` Menglong Dong
2022-04-26  8:07 ` [PATCH net-next 2/2] net: tcp: add skb drop reasons to route_req() menglong8.dong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox