-
Notifications
You must be signed in to change notification settings - Fork 97
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
sockmap: Fix reading with splice(2) #7158
Conversation
Upstream branch: 0720887 |
cf94588
to
7ea168b
Compare
Upstream branch: 7015843 |
27c390e
to
adbfef4
Compare
7ea168b
to
988ce34
Compare
Upstream branch: b24862b |
adbfef4
to
e9eb832
Compare
Upstream branch: 08ac454 |
988ce34
to
d4f6810
Compare
e9eb832
to
e053865
Compare
d4f6810
to
2c69871
Compare
Upstream branch: f85af9d |
e053865
to
ec97d4d
Compare
2c69871
to
efc6995
Compare
Upstream branch: 2ebb87f |
ec97d4d
to
bf4b3fa
Compare
efc6995
to
2d4d540
Compare
Upstream branch: bb678f0 |
bf4b3fa
to
276113b
Compare
2d4d540
to
6a90984
Compare
Upstream branch: 98b303c |
276113b
to
584700c
Compare
6a90984
to
4abe0a1
Compare
The TCP BPF code will need to override splice_read(), so add it to prot. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@datadoghq.com>
If a socket is added to a sockmap with a verdict program which returns SK_PASS, splice(2) is not able to read from the socket. The verdict code removes skbs from the receive queue, checks them using the bpf program, and then re-queues them onto a separate queue (psock->ingress_msg). The sockmap code modifies the TCP recvmsg hook to check this second queue also so that works. But the splice_read hooks is not modified and the default tcp_read_splice() only reads the normal receive queue so it never sees the skbs which have been re-queued. Fix it by using copy_splice_read() when replacing the proto for the sockmap. This could eventually be replaced with a more efficient custom version. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@datadoghq.com>
If any tests failed, exit the program with a non-zero error code. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@datadoghq.com>
Add an option to always return SK_PASS in the verdict callback instead of redirecting the skb. This allows testing cases which are not covered by the test program as of now. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@datadoghq.com>
Add a test mode which uses splice(2) to do a read from the socket. Can be run with something like the below: ./test_sockmap -t splice --txmsg_omit_skb_parser --txmsg_pass_skb Signed-off-by: Vincent Whitchurch <vincent.whitchurch@datadoghq.com>
Upstream branch: 4ff5747 |
584700c
to
863d6bc
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=859429 expired. Closing PR. |
Pull request for series with
subject: sockmap: Fix reading with splice(2)
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=859429