ANDROID: GKI: net: add vendor hooks for link data path

add vendor hooks to support link data path feature.
1.android_vh_dc_send_copy
For send copy pkt on the other ways
2.android_vh_dc_receive
For Drop duplicated pkt when dual connection connected

Bug: 343838581
Change-Id: I31acba1827205c366a4f54c4b940d4d8f2c21bff
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
(cherry picked from commit 86dd89554f8308fcd58af6156fd67ac2ac7facbf)
This commit is contained in:
Dezhi Huang
2024-05-31 14:22:24 +08:00
committed by Treehugger Robot
parent 3165cd1163
commit f949397a1b
3 changed files with 15 additions and 1 deletions

View File

@@ -214,6 +214,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_shmem_get_folio);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_pcpu_rwsem_time_early);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_mmap_file);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_file_open);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dc_send_copy);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dc_receive);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_bpf_syscall);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ignore_dmabuf_vmap_bounds);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rproc_recovery);

View File

@@ -16,6 +16,7 @@ DECLARE_HOOK(android_vh_ptype_head,
struct nf_conn;
struct sock;
struct net_device;
DECLARE_RESTRICTED_HOOK(android_rvh_nf_conn_alloc,
TP_PROTO(struct nf_conn *nf_conn), TP_ARGS(nf_conn), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_nf_conn_free,
@@ -31,7 +32,10 @@ DECLARE_HOOK(android_vh_netlink_poll,
TP_PROTO(struct file *file, struct socket *sock, poll_table *wait,
__poll_t *mask),
TP_ARGS(file, sock, wait, mask));
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,
TP_PROTO(struct sk_buff *skb, int *flag), TP_ARGS(skb, flag));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_NET_VH_H */

View File

@@ -3632,6 +3632,9 @@ static int xmit_one(struct sk_buff *skb, struct net_device *dev,
len = skb->len;
trace_net_dev_start_xmit(skb, dev);
trace_android_vh_dc_send_copy(skb, dev);
rc = netdev_start_xmit(skb, dev, txq, more);
trace_net_dev_xmit(skb, rc, dev, len);
@@ -5331,6 +5334,7 @@ static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
bool deliver_exact = false;
int ret = NET_RX_DROP;
__be16 type;
int flag = 0;
net_timestamp_check(!READ_ONCE(netdev_tstamp_prequeue), skb);
@@ -5350,6 +5354,10 @@ another_round:
__this_cpu_inc(softnet_data.processed);
trace_android_vh_dc_receive(skb, &flag);
if (flag != 0)
return NET_RX_DROP;
if (static_branch_unlikely(&generic_xdp_needed_key)) {
int ret2;