diff mbox series

[net-next,v6,06/11] tcp: introduce dropreasons in receive path

Message ID 20240219032838.91723-7-kerneljasonxing@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series introduce drop reasons for tcp receive path | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5948 this patch: 5948
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 2074 this patch: 2074
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 6264 this patch: 6264
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 45 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest pending net-next-2024-02-19--09-00 (tests: 391)

Commit Message

Jason Xing Feb. 19, 2024, 3:28 a.m. UTC
From: Jason Xing <kernelxing@tencent.com>

Soon later patches can use these relatively more accurate
reasons to recognise and find out the cause.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
--
v5:
Link: https://lore.kernel.org/netdev/3a495358-4c47-4a9f-b116-5f9c8b44e5ab@kernel.org/
1. Use new name (TCP_ABORT_ON_DATA) for readability (David)
2. change the title of this patch
---
 include/net/dropreason-core.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Comments

Kuniyuki Iwashima Feb. 19, 2024, 4:47 a.m. UTC | #1
From: Jason Xing <kerneljasonxing@gmail.com>
Date: Mon, 19 Feb 2024 11:28:33 +0800
> From: Jason Xing <kernelxing@tencent.com>
> 
> Soon later patches can use these relatively more accurate
> reasons to recognise and find out the cause.
> 
> Signed-off-by: Jason Xing <kernelxing@tencent.com>
> --
> v5:
> Link: https://lore.kernel.org/netdev/3a495358-4c47-4a9f-b116-5f9c8b44e5ab@kernel.org/
> 1. Use new name (TCP_ABORT_ON_DATA) for readability (David)
> 2. change the title of this patch
> ---
>  include/net/dropreason-core.h | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h
> index 3c867384dead..402367bfa56f 100644
> --- a/include/net/dropreason-core.h
> +++ b/include/net/dropreason-core.h
> @@ -30,6 +30,7 @@
>  	FN(TCP_AOFAILURE)		\
>  	FN(SOCKET_BACKLOG)		\
>  	FN(TCP_FLAGS)			\
> +	FN(TCP_ABORT_ON_DATA)	\
>  	FN(TCP_ZEROWINDOW)		\
>  	FN(TCP_OLD_DATA)		\
>  	FN(TCP_OVERWINDOW)		\
> @@ -37,6 +38,7 @@
>  	FN(TCP_RFC7323_PAWS)		\
>  	FN(TCP_OLD_SEQUENCE)		\
>  	FN(TCP_INVALID_SEQUENCE)	\
> +	FN(TCP_INVALID_ACK_SEQUENCE)	\
>  	FN(TCP_RESET)			\
>  	FN(TCP_INVALID_SYN)		\
>  	FN(TCP_CLOSE)			\
> @@ -204,6 +206,11 @@ enum skb_drop_reason {
>  	SKB_DROP_REASON_SOCKET_BACKLOG,
>  	/** @SKB_DROP_REASON_TCP_FLAGS: TCP flags invalid */
>  	SKB_DROP_REASON_TCP_FLAGS,
> +	/**
> +	 * @SKB_DROP_REASON_TCP_ABORT_ON_DATA: abort on data, corresponding to
> +	 * LINUX_MIB_TCPABORTONDATA
> +	 */
> +	SKB_DROP_REASON_TCP_ABORT_ON_DATA,
>  	/**
>  	 * @SKB_DROP_REASON_TCP_ZEROWINDOW: TCP receive window size is zero,
>  	 * see LINUX_MIB_TCPZEROWINDOWDROP
> @@ -228,13 +235,19 @@ enum skb_drop_reason {
>  	SKB_DROP_REASON_TCP_OFOMERGE,
>  	/**
>  	 * @SKB_DROP_REASON_TCP_RFC7323_PAWS: PAWS check, corresponding to
> -	 * LINUX_MIB_PAWSESTABREJECTED
> +	 * LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED
>  	 */
>  	SKB_DROP_REASON_TCP_RFC7323_PAWS,
>  	/** @SKB_DROP_REASON_TCP_OLD_SEQUENCE: Old SEQ field (duplicate packet) */
>  	SKB_DROP_REASON_TCP_OLD_SEQUENCE,
>  	/** @SKB_DROP_REASON_TCP_INVALID_SEQUENCE: Not acceptable SEQ field */
>  	SKB_DROP_REASON_TCP_INVALID_SEQUENCE,
> +	/**
> +	 * @SKB_DROP_REASON_TCP_INVALID_ACK_SEQUENCE: Not acceptable ACK SEQ
> +	 * field. because of ack sequence is not in the window between snd_una

nit: s/. because of/ because/


> +	 * and snd_nxt
> +	 */
> +	SKB_DROP_REASON_TCP_INVALID_ACK_SEQUENCE,
>  	/** @SKB_DROP_REASON_TCP_RESET: Invalid RST packet */
>  	SKB_DROP_REASON_TCP_RESET,
>  	/**
> -- 
> 2.37.3
>
Jason Xing Feb. 19, 2024, 4:57 a.m. UTC | #2
On Mon, Feb 19, 2024 at 12:47 PM Kuniyuki Iwashima <kuniyu@amazon.com> wrote:
>
> From: Jason Xing <kerneljasonxing@gmail.com>
> Date: Mon, 19 Feb 2024 11:28:33 +0800
> > From: Jason Xing <kernelxing@tencent.com>
> >
> > Soon later patches can use these relatively more accurate
> > reasons to recognise and find out the cause.
> >
> > Signed-off-by: Jason Xing <kernelxing@tencent.com>
> > --
> > v5:
> > Link: https://lore.kernel.org/netdev/3a495358-4c47-4a9f-b116-5f9c8b44e5ab@kernel.org/
> > 1. Use new name (TCP_ABORT_ON_DATA) for readability (David)
> > 2. change the title of this patch
> > ---
> >  include/net/dropreason-core.h | 15 ++++++++++++++-
> >  1 file changed, 14 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h
> > index 3c867384dead..402367bfa56f 100644
> > --- a/include/net/dropreason-core.h
> > +++ b/include/net/dropreason-core.h
> > @@ -30,6 +30,7 @@
> >       FN(TCP_AOFAILURE)               \
> >       FN(SOCKET_BACKLOG)              \
> >       FN(TCP_FLAGS)                   \
> > +     FN(TCP_ABORT_ON_DATA)   \
> >       FN(TCP_ZEROWINDOW)              \
> >       FN(TCP_OLD_DATA)                \
> >       FN(TCP_OVERWINDOW)              \
> > @@ -37,6 +38,7 @@
> >       FN(TCP_RFC7323_PAWS)            \
> >       FN(TCP_OLD_SEQUENCE)            \
> >       FN(TCP_INVALID_SEQUENCE)        \
> > +     FN(TCP_INVALID_ACK_SEQUENCE)    \
> >       FN(TCP_RESET)                   \
> >       FN(TCP_INVALID_SYN)             \
> >       FN(TCP_CLOSE)                   \
> > @@ -204,6 +206,11 @@ enum skb_drop_reason {
> >       SKB_DROP_REASON_SOCKET_BACKLOG,
> >       /** @SKB_DROP_REASON_TCP_FLAGS: TCP flags invalid */
> >       SKB_DROP_REASON_TCP_FLAGS,
> > +     /**
> > +      * @SKB_DROP_REASON_TCP_ABORT_ON_DATA: abort on data, corresponding to
> > +      * LINUX_MIB_TCPABORTONDATA
> > +      */
> > +     SKB_DROP_REASON_TCP_ABORT_ON_DATA,
> >       /**
> >        * @SKB_DROP_REASON_TCP_ZEROWINDOW: TCP receive window size is zero,
> >        * see LINUX_MIB_TCPZEROWINDOWDROP
> > @@ -228,13 +235,19 @@ enum skb_drop_reason {
> >       SKB_DROP_REASON_TCP_OFOMERGE,
> >       /**
> >        * @SKB_DROP_REASON_TCP_RFC7323_PAWS: PAWS check, corresponding to
> > -      * LINUX_MIB_PAWSESTABREJECTED
> > +      * LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED
> >        */
> >       SKB_DROP_REASON_TCP_RFC7323_PAWS,
> >       /** @SKB_DROP_REASON_TCP_OLD_SEQUENCE: Old SEQ field (duplicate packet) */
> >       SKB_DROP_REASON_TCP_OLD_SEQUENCE,
> >       /** @SKB_DROP_REASON_TCP_INVALID_SEQUENCE: Not acceptable SEQ field */
> >       SKB_DROP_REASON_TCP_INVALID_SEQUENCE,
> > +     /**
> > +      * @SKB_DROP_REASON_TCP_INVALID_ACK_SEQUENCE: Not acceptable ACK SEQ
> > +      * field. because of ack sequence is not in the window between snd_una
>
> nit: s/. because of/ because/

Thanks. Will update it.

>
>
> > +      * and snd_nxt
> > +      */
> > +     SKB_DROP_REASON_TCP_INVALID_ACK_SEQUENCE,
> >       /** @SKB_DROP_REASON_TCP_RESET: Invalid RST packet */
> >       SKB_DROP_REASON_TCP_RESET,
> >       /**
> > --
> > 2.37.3
> >
diff mbox series

Patch

diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h
index 3c867384dead..402367bfa56f 100644
--- a/include/net/dropreason-core.h
+++ b/include/net/dropreason-core.h
@@ -30,6 +30,7 @@ 
 	FN(TCP_AOFAILURE)		\
 	FN(SOCKET_BACKLOG)		\
 	FN(TCP_FLAGS)			\
+	FN(TCP_ABORT_ON_DATA)	\
 	FN(TCP_ZEROWINDOW)		\
 	FN(TCP_OLD_DATA)		\
 	FN(TCP_OVERWINDOW)		\
@@ -37,6 +38,7 @@ 
 	FN(TCP_RFC7323_PAWS)		\
 	FN(TCP_OLD_SEQUENCE)		\
 	FN(TCP_INVALID_SEQUENCE)	\
+	FN(TCP_INVALID_ACK_SEQUENCE)	\
 	FN(TCP_RESET)			\
 	FN(TCP_INVALID_SYN)		\
 	FN(TCP_CLOSE)			\
@@ -204,6 +206,11 @@  enum skb_drop_reason {
 	SKB_DROP_REASON_SOCKET_BACKLOG,
 	/** @SKB_DROP_REASON_TCP_FLAGS: TCP flags invalid */
 	SKB_DROP_REASON_TCP_FLAGS,
+	/**
+	 * @SKB_DROP_REASON_TCP_ABORT_ON_DATA: abort on data, corresponding to
+	 * LINUX_MIB_TCPABORTONDATA
+	 */
+	SKB_DROP_REASON_TCP_ABORT_ON_DATA,
 	/**
 	 * @SKB_DROP_REASON_TCP_ZEROWINDOW: TCP receive window size is zero,
 	 * see LINUX_MIB_TCPZEROWINDOWDROP
@@ -228,13 +235,19 @@  enum skb_drop_reason {
 	SKB_DROP_REASON_TCP_OFOMERGE,
 	/**
 	 * @SKB_DROP_REASON_TCP_RFC7323_PAWS: PAWS check, corresponding to
-	 * LINUX_MIB_PAWSESTABREJECTED
+	 * LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED
 	 */
 	SKB_DROP_REASON_TCP_RFC7323_PAWS,
 	/** @SKB_DROP_REASON_TCP_OLD_SEQUENCE: Old SEQ field (duplicate packet) */
 	SKB_DROP_REASON_TCP_OLD_SEQUENCE,
 	/** @SKB_DROP_REASON_TCP_INVALID_SEQUENCE: Not acceptable SEQ field */
 	SKB_DROP_REASON_TCP_INVALID_SEQUENCE,
+	/**
+	 * @SKB_DROP_REASON_TCP_INVALID_ACK_SEQUENCE: Not acceptable ACK SEQ
+	 * field. because of ack sequence is not in the window between snd_una
+	 * and snd_nxt
+	 */
+	SKB_DROP_REASON_TCP_INVALID_ACK_SEQUENCE,
 	/** @SKB_DROP_REASON_TCP_RESET: Invalid RST packet */
 	SKB_DROP_REASON_TCP_RESET,
 	/**