-
Notifications
You must be signed in to change notification settings - Fork 146
sockmap: Fix reading with splice(2) #9280
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
base: bpf-next_base
Are you sure you want to change the base?
Conversation
Upstream branch: ad97cb2 |
128441d
to
f818fa8
Compare
Upstream branch: ea2aecd |
c4e62b6
to
5d24620
Compare
f818fa8
to
d1180f2
Compare
Upstream branch: e860a98 |
5d24620
to
5031bdc
Compare
d1180f2
to
a3964d2
Compare
Upstream branch: 1f48966 |
5031bdc
to
ef3cd25
Compare
a3964d2
to
ec33c8e
Compare
Upstream branch: 62ef449 |
ef3cd25
to
46d2c4a
Compare
ec33c8e
to
1c89975
Compare
Upstream branch: 0768e98 |
46d2c4a
to
da2e198
Compare
1c89975
to
2bf6e60
Compare
Upstream branch: 0768e98 |
da2e198
to
6de3d57
Compare
2bf6e60
to
63bd3e4
Compare
Upstream branch: 0ee30d9 |
6de3d57
to
fe444ce
Compare
63bd3e4
to
1c4f46e
Compare
Upstream branch: 0ee30d9 |
fe444ce
to
cedaa95
Compare
1c4f46e
to
b5a617e
Compare
Upstream branch: beb1097 |
cedaa95
to
1bde990
Compare
b5a617e
to
ffefc6d
Compare
Upstream branch: 42be23e |
1bde990
to
1ffc2c8
Compare
ffefc6d
to
4ccf98a
Compare
Upstream branch: 42be23e |
1ffc2c8
to
b2476ed
Compare
4ccf98a
to
95edab2
Compare
The TCP BPF code will need to override splice_read(), so add it to prot. Signed-off-by: Vincent Whitchurch <[email protected]>
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 <[email protected]>
Upstream branch: 95993dc |
If any tests failed, exit the program with a non-zero error code. Signed-off-by: Vincent Whitchurch <[email protected]>
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 <[email protected]>
Add a test which checks that splice(2) is still able to read data from the socket if it is added to a verdict program which returns SK_PASS. Signed-off-by: Vincent Whitchurch <[email protected]>
b2476ed
to
1ef4d12
Compare
Pull request for series with
subject: sockmap: Fix reading with splice(2)
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=980517