ANDROID: GKI: net: add vendor hooks net qos for gki purpose

Add vendor hooks to support net qos policy feature:

1.android_rvh_tcp_rcv_spurious_retrans
With this hook we could trace the ACK path through the segments which
are spuriously retransmitted by sender.

Bug: 351960112

Change-Id: I739cef428f4a43999d99393a205b3d53a1eb52da
Signed-off-by: Jyu Jiang <jyu.jiang@vivo.corp-partner.google.com>
This commit is contained in:
Jyu Jiang 2024-07-10 11:13:49 +08:00 committed by Treehugger Robot
parent 359c132bee
commit c4db168998
3 changed files with 5 additions and 0 deletions

View File

@ -89,6 +89,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_tcp_select_window);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_inet_sock_create);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_inet_sock_release);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_bpf_skb_load_bytes);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_tcp_rcv_spurious_retrans);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_rtt_estimator);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_udp_enqueue_schedule_skb);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_build_skb_around);

View File

@ -46,6 +46,8 @@ DECLARE_RESTRICTED_HOOK(android_rvh_bpf_skb_load_bytes,
TP_PROTO(const struct sk_buff *skb, u32 offset, void *to, u32 len,
int *handled, int *err),
TP_ARGS(skb, offset, to, len, handled, err), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_tcp_rcv_spurious_retrans,
TP_PROTO(struct sock *sk), TP_ARGS(sk), 1);
DECLARE_HOOK(android_vh_dc_send_copy,
TP_PROTO(struct sk_buff *skb, struct net_device *dev), TP_ARGS(skb, dev));
DECLARE_HOOK(android_vh_dc_receive,

View File

@ -4510,6 +4510,8 @@ static void tcp_rcv_spurious_retrans(struct sock *sk, const struct sk_buff *skb)
* The receiver remembers and reflects via DSACKs. Leverage the
* DSACK state and change the txhash to re-route speculatively.
*/
trace_android_rvh_tcp_rcv_spurious_retrans(sk);
if (TCP_SKB_CB(skb)->seq == tcp_sk(sk)->duplicate_sack[0].start_seq &&
sk_rethink_txhash(sk))
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPDUPLICATEDATAREHASH);