From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <kerneljasonxing@gmail.com>
Cc: <davem@davemloft.net>, <dsahern@kernel.org>,
<edumazet@google.com>, <kernelxing@tencent.com>,
<kuba@kernel.org>, <netdev@vger.kernel.org>, <pabeni@redhat.com>,
<kuniyu@amazon.com>
Subject: Re: [PATCH v2 net-next 2/2] tcp: add more DROP REASONs in receive process
Date: Fri, 9 Feb 2024 01:14:54 -0800 [thread overview]
Message-ID: <20240209091454.32323-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20240209061213.72152-3-kerneljasonxing@gmail.com>
From: Jason Xing <kerneljasonxing@gmail.com>
Date: Fri, 9 Feb 2024 14:12:13 +0800
> From: Jason Xing <kernelxing@tencent.com>
>
> As the title said, add more reasons to narrow down the range about
> why the skb should be dropped.
>
> Signed-off-by: Jason Xing <kernelxing@tencent.com>
> ---
> include/net/dropreason-core.h | 11 ++++++++++-
> include/net/tcp.h | 4 ++--
> net/ipv4/tcp_input.c | 26 +++++++++++++++++---------
> net/ipv4/tcp_ipv4.c | 19 ++++++++++++-------
> net/ipv4/tcp_minisocks.c | 10 +++++-----
> net/ipv6/tcp_ipv6.c | 19 ++++++++++++-------
> 6 files changed, 58 insertions(+), 31 deletions(-)
>
> diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h
> index efbc5dfd9e84..9a7643be9d07 100644
> --- a/include/net/dropreason-core.h
> +++ b/include/net/dropreason-core.h
> @@ -31,6 +31,8 @@
> FN(TCP_AOFAILURE) \
> FN(SOCKET_BACKLOG) \
> FN(TCP_FLAGS) \
> + FN(TCP_CONNREQNOTACCEPTABLE) \
> + FN(TCP_ABORTONDATA) \
> FN(TCP_ZEROWINDOW) \
> FN(TCP_OLD_DATA) \
> FN(TCP_OVERWINDOW) \
[...]
> @@ -6654,7 +6657,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
> rcu_read_unlock();
>
> if (!acceptable)
> - return 1;
> + return SKB_DROP_REASON_TCP_CONNREQNOTACCEPTABLE;
This sounds a bit ambiguous, and I think it can be more specific
if tcp_conn_request() returns the drop reason and we change the
acceptable evaluation.
acceptable = icsk->icsk_af_ops->conn_request(sk, skb) >= 0;
> consume_skb(skb);
> return 0;
> }
next prev parent reply other threads:[~2024-02-09 9:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-09 6:12 [PATCH v2 net-next 0/2] add more drop reasons in tcp receive path Jason Xing
2024-02-09 6:12 ` [PATCH v2 net-next 1/2] tcp: add more DROP REASONs in cookie check Jason Xing
2024-02-09 6:12 ` [PATCH v2 net-next 2/2] tcp: add more DROP REASONs in receive process Jason Xing
2024-02-09 9:14 ` Kuniyuki Iwashima [this message]
2024-02-09 10:46 ` Jason Xing
2024-02-09 11:01 ` Eric Dumazet
2024-02-09 11:39 ` Jason Xing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240209091454.32323-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kerneljasonxing@gmail.com \
--cc=kernelxing@tencent.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).