hulk inclusion category: feature bugzilla: https://atomgit.com/openeuler/kernel/issues/8376 -------------------------------- This reverts commit af4375846a8030a5df31ddf49c5653623aa01d38. Use the mainline solution for the fix. Signed-off-by: Dong Chenchen <dongchenchen2@huawei.com> --- net/core/skmsg.c | 10 +--------- net/ipv4/tcp_bpf.c | 11 ----------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/net/core/skmsg.c b/net/core/skmsg.c index fa2ccc6de0a4..4cf6e080788b 100644 --- a/net/core/skmsg.c +++ b/net/core/skmsg.c @@ -445,12 +445,8 @@ int sk_msg_recvmsg(struct sock *sk, struct sk_psock *psock, struct msghdr *msg, if (likely(!peek)) { sge->offset += copy; sge->length -= copy; - if (!msg_rx->skb) { -#if IS_ENABLED(CONFIG_NETACC_TERRACE) - atomic_sub(copy, &sk->sk_rmem_alloc); -#endif + if (!msg_rx->skb) sk_mem_uncharge(sk, copy); - } msg_rx->sg.size -= copy; if (!sge->length) { @@ -797,10 +793,6 @@ static void __sk_psock_purge_ingress_msg(struct sk_psock *psock) list_for_each_entry_safe(msg, tmp, &psock->ingress_msg, list) { list_del(&msg->list); -#if IS_ENABLED(CONFIG_NETACC_TERRACE) - if (!msg->skb) - atomic_sub(msg->sg.size, &psock->sk->sk_rmem_alloc); -#endif sk_msg_free(psock->sk, msg); kfree(msg); } diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c index 72974e4940a9..de22464314fb 100644 --- a/net/ipv4/tcp_bpf.c +++ b/net/ipv4/tcp_bpf.c @@ -43,13 +43,6 @@ static int bpf_tcp_ingress(struct sock *sk, struct sk_psock *psock, return -ENOMEM; lock_sock(sk); -#if IS_ENABLED(CONFIG_NETACC_TERRACE) - if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) { - kfree(tmp); - release_sock(sk); - return -EAGAIN; - } -#endif tmp->sg.start = msg->sg.start; i = msg->sg.start; do { @@ -82,10 +75,6 @@ static int bpf_tcp_ingress(struct sock *sk, struct sk_psock *psock, if (!ret) { msg->sg.start = i; sk_psock_queue_msg(psock, tmp); -#if IS_ENABLED(CONFIG_NETACC_TERRACE) - if (sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED)) - atomic_add(tmp->sg.size, &sk->sk_rmem_alloc); -#endif sk_psock_data_ready(sk, psock); } else { sk_msg_free(sk, tmp); -- 2.25.1