-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tcp_bpf: update the rmem scheduling for #4763
base: bpf_base
Are you sure you want to change the base?
Conversation
Upstream branch: fac04ef |
4ccd610
to
fe405ce
Compare
Upstream branch: 11d5245 |
460d63f
to
546b9d9
Compare
fe405ce
to
a0377d8
Compare
Upstream branch: 978c448 |
546b9d9
to
e92f35c
Compare
a0377d8
to
686dfee
Compare
Upstream branch: cf8b876 |
e92f35c
to
6f43385
Compare
686dfee
to
6e8d4bd
Compare
Upstream branch: c4441ca |
6f43385
to
98590c5
Compare
6e8d4bd
to
23d9813
Compare
Upstream branch: 7d0d673 |
When bpf_tcp_ingress() is called, the skmsg is being redirected to the ingress of the destination socket. Therefore, we should charge its receive socket buffer, instead of sending socket buffer. Because sk_rmem_schedule() tests pfmemalloc of skb, we need to introduce a wrapper and call it for skmsg. Fixes: 604326b ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Cong Wang <[email protected]>
When we do sk_psock_verdict_apply->sk_psock_skb_ingress, an sk_msg will be created out of the skb, and the rmem accounting of the sk_msg will be handled by the skb. For skmsgs in __SK_REDIRECT case of tcp_bpf_send_verdict, when redirecting to the ingress of a socket, although we sk_rmem_schedule and add sk_msg to the ingress_msg of sk_redir, we do not update sk_rmem_alloc. As a result, except for the global memory limit, the rmem of sk_redir is nearly unlimited. Thus, add sk_rmem_alloc related logic to limit the recv buffer. Since the function sk_msg_recvmsg and __sk_psock_purge_ingress_msg are used in these two paths. We use "msg->skb" to test whether the sk_msg is skb backed up. If it's not, we shall do the memory accounting explicitly. Fixes: 604326b ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Zijian Zhang <[email protected]>
98590c5
to
d001ec9
Compare
Pull request for series with
subject: tcp_bpf: update the rmem scheduling for
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=916174