diff mbox series

[net-next,2/5] tcp: fully support sk reset reason in tcp_ack()

Message ID 20240509131306.92931-3-kerneljasonxing@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series tcp: support rstreasons in the passive logic | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
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: 2950 this patch: 2950
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: 979 this patch: 979
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: 3141 this patch: 3141
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 28 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc fail Errors and warnings before: 0 this patch: 1
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-10--00-00 (tests: 1009)

Commit Message

Jason Xing May 9, 2024, 1:13 p.m. UTC
From: Jason Xing <kernelxing@tencent.com>

Based on the existing skb drop reason, updating the rstreason map can
help us finish the rstreason job in this function.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
 include/net/rstreason.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Jason Xing May 10, 2024, 2:08 a.m. UTC | #1
On Thu, May 9, 2024 at 9:13 PM Jason Xing <kerneljasonxing@gmail.com> wrote:
>
> From: Jason Xing <kernelxing@tencent.com>
>
> Based on the existing skb drop reason, updating the rstreason map can
> help us finish the rstreason job in this function.
>
> Signed-off-by: Jason Xing <kernelxing@tencent.com>
> ---
>  include/net/rstreason.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/include/net/rstreason.h b/include/net/rstreason.h
> index f87814a60205..a32b0fa17de2 100644
> --- a/include/net/rstreason.h
> +++ b/include/net/rstreason.h
> @@ -10,6 +10,8 @@
>         FN(NO_SOCKET)                   \
>         FN(TCP_INVALID_ACK_SEQUENCE)    \
>         FN(TCP_RFC7323_PAWS)            \
> +       FN(TCP_TOO_OLD_ACK)             \
> +       FN(TCP_ACK_UNSENT_DATA)         \
>         FN(MPTCP_RST_EUNSPEC)           \
>         FN(MPTCP_RST_EMPTCP)            \
>         FN(MPTCP_RST_ERESOURCE)         \
> @@ -50,6 +52,10 @@ enum sk_rst_reason {
>          * LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED
>          */
>         SK_RST_REASON_TCP_RFC7323_PAWS,
> +       /** @SK_RST_REASON_TCP_TOO_OLD_ACK: TCP ACK is too old */
> +       SK_RST_REASON_TCP_TOO_OLD_ACK,
> +       /** @SK_RST_REASON_TCP_ACK_UNSENT_DATA */

I'll add the detailed comment into this kdoc which was found by
patchwork in V2 series to make sure every item has its own
explanation.

Thanks,
Jason

> +       SK_RST_REASON_TCP_ACK_UNSENT_DATA,
>
>         /* Copy from include/uapi/linux/mptcp.h.
>          * These reset fields will not be changed since they adhere to
> @@ -130,6 +136,10 @@ sk_rst_convert_drop_reason(enum skb_drop_reason reason)
>                 return SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE;
>         case SKB_DROP_REASON_TCP_RFC7323_PAWS:
>                 return SK_RST_REASON_TCP_RFC7323_PAWS;
> +       case SKB_DROP_REASON_TCP_TOO_OLD_ACK:
> +               return SK_RST_REASON_TCP_TOO_OLD_ACK;
> +       case SKB_DROP_REASON_TCP_ACK_UNSENT_DATA:
> +               return SK_RST_REASON_TCP_ACK_UNSENT_DATA;
>         default:
>                 /* If we don't have our own corresponding reason */
>                 return SK_RST_REASON_NOT_SPECIFIED;
> --
> 2.37.3
>
diff mbox series

Patch

diff --git a/include/net/rstreason.h b/include/net/rstreason.h
index f87814a60205..a32b0fa17de2 100644
--- a/include/net/rstreason.h
+++ b/include/net/rstreason.h
@@ -10,6 +10,8 @@ 
 	FN(NO_SOCKET)			\
 	FN(TCP_INVALID_ACK_SEQUENCE)	\
 	FN(TCP_RFC7323_PAWS)		\
+	FN(TCP_TOO_OLD_ACK)		\
+	FN(TCP_ACK_UNSENT_DATA)		\
 	FN(MPTCP_RST_EUNSPEC)		\
 	FN(MPTCP_RST_EMPTCP)		\
 	FN(MPTCP_RST_ERESOURCE)		\
@@ -50,6 +52,10 @@  enum sk_rst_reason {
 	 * LINUX_MIB_PAWSESTABREJECTED, LINUX_MIB_PAWSACTIVEREJECTED
 	 */
 	SK_RST_REASON_TCP_RFC7323_PAWS,
+	/** @SK_RST_REASON_TCP_TOO_OLD_ACK: TCP ACK is too old */
+	SK_RST_REASON_TCP_TOO_OLD_ACK,
+	/** @SK_RST_REASON_TCP_ACK_UNSENT_DATA */
+	SK_RST_REASON_TCP_ACK_UNSENT_DATA,
 
 	/* Copy from include/uapi/linux/mptcp.h.
 	 * These reset fields will not be changed since they adhere to
@@ -130,6 +136,10 @@  sk_rst_convert_drop_reason(enum skb_drop_reason reason)
 		return SK_RST_REASON_TCP_INVALID_ACK_SEQUENCE;
 	case SKB_DROP_REASON_TCP_RFC7323_PAWS:
 		return SK_RST_REASON_TCP_RFC7323_PAWS;
+	case SKB_DROP_REASON_TCP_TOO_OLD_ACK:
+		return SK_RST_REASON_TCP_TOO_OLD_ACK;
+	case SKB_DROP_REASON_TCP_ACK_UNSENT_DATA:
+		return SK_RST_REASON_TCP_ACK_UNSENT_DATA;
 	default:
 		/* If we don't have our own corresponding reason */
 		return SK_RST_REASON_NOT_SPECIFIED;