From 0defa678590c9f83d74dd42a14f743425ab6f489 Mon Sep 17 00:00:00 2001 From: Chenghao Zhao Date: Tue, 12 Nov 2024 21:17:37 +0800 Subject: [PATCH] ANDROID: GKI: net: add vendor hook to check if out of order occurs 1.android_vh_tcp_rcv_established_fast_path Check if there are received packets out of order for the fast path. 2.android_vh_tcp_rcv_established_slow_path Check if there are received packets out of order for the slow path. Bug: 378600969 Change-Id: Ifad16bd9523ac0c3cc0c0c98dfb0884635f3a537 Signed-off-by: Chenghao Zhao (cherry picked from commit c6058890859531826c574aaee2ffd2ed95c38e59) --- drivers/android/vendor_hooks.c | 2 ++ include/trace/hooks/net.h | 4 ++++ net/ipv4/tcp_input.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index a99803fc67f9..121f51e1f48d 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -194,6 +194,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_clean_rtx_queue); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_rcv_synack); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_udp_unicast_rcv_skb); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_udp6_unicast_rcv_skb); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_rcv_established_fast_path); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_rcv_established_slow_path); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_capacity_show); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_init); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake); diff --git a/include/trace/hooks/net.h b/include/trace/hooks/net.h index 86a449d0d875..edd1c7fc2729 100644 --- a/include/trace/hooks/net.h +++ b/include/trace/hooks/net.h @@ -34,6 +34,10 @@ DECLARE_HOOK(android_vh_udp_unicast_rcv_skb, DECLARE_HOOK(android_vh_udp6_unicast_rcv_skb, TP_PROTO(struct sk_buff *skb, struct sock *sk), TP_ARGS(skb, sk)); +DECLARE_HOOK(android_vh_tcp_rcv_established_fast_path, + TP_PROTO(struct sock *sk), TP_ARGS(sk)); +DECLARE_HOOK(android_vh_tcp_rcv_established_slow_path, + TP_PROTO(struct sock *sk), TP_ARGS(sk)); /* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_NET_VH_H */ diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a76ae44d6f2e..b1977fd8b043 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -6228,6 +6228,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) __tcp_ack_snd_check(sk, 0); no_ack: + trace_android_vh_tcp_rcv_established_fast_path(sk); if (eaten) kfree_skb_partial(skb, fragstolen); tcp_data_ready(sk); @@ -6267,6 +6268,8 @@ step5: tcp_data_snd_check(sk); tcp_ack_snd_check(sk); + + trace_android_vh_tcp_rcv_established_slow_path(sk); return; csum_error: