-
Notifications
You must be signed in to change notification settings - Fork 6
selftests/bpf: Extend sockmap_redir to test no-redir SK_DROP/SK_PASS #5901
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?
selftests/bpf: Extend sockmap_redir to test no-redir SK_DROP/SK_PASS #5901
Conversation
Upstream branch: 9621eb6 |
c979e9f
to
2d215b0
Compare
Upstream branch: e12873e |
56c83e2
to
351dc28
Compare
2d215b0
to
05282f4
Compare
Upstream branch: 93a83d0 |
351dc28
to
16668d6
Compare
05282f4
to
e2bfc81
Compare
Upstream branch: 60ef541 |
16668d6
to
1dd8fca
Compare
Upstream branch: 60ef541 |
1dd8fca
to
c868488
Compare
e2bfc81
to
ba991b7
Compare
Upstream branch: f859813 |
c868488
to
acd9429
Compare
ba991b7
to
cf2fd3b
Compare
Upstream branch: 5d87e96 |
acd9429
to
4947123
Compare
cf2fd3b
to
cd9a59e
Compare
try_recv() was meant to support both @expect_success cases, but all the callers use @expect_success=false anyway. Drop the unused logic and fold in MSG_DONTWAIT. Adapt callers. Subtle change here: recv() return value of 0 will also be considered (an unexpected) success. Signed-off-by: Michal Luczaj <[email protected]> Reviewed-by: Jakub Sitnicki <[email protected]>
In some test cases, OOB packets might have been left unread. Flush them out and introduce additional checks. Signed-off-by: Michal Luczaj <[email protected]>
Upstream branch: a578b54 |
Preparatory patch before adding SK_PASS/SK_DROP support: test_redir() => test_sockets() test_socket() => test_redir() test_send_redir_recv() => test_send_recv() After the change (and the following patch) the call stack will be: serial_test_sockmap_redir test_map test_sockets test_redir test_send_recv (test_verdict) (test_send_recv) Signed-off-by: Michal Luczaj <[email protected]>
Preparatory patch before adding SK_PASS/SK_DROP support: allow to dynamically switch BPF program's redirect_type. This way, after setting up for a redirection, test can make the BPF program skip the actual bpf_{sk,msg}_redirect_{map,hash} part and return a specified verdict. Signed-off-by: Michal Luczaj <[email protected]>
Add tests that make the BPF programs skip the actual redirect and immediately return SK_DROP/SK_PASS. Suggested-by: Jiayuan Chen <[email protected]> Signed-off-by: Michal Luczaj <[email protected]>
4947123
to
9413f0a
Compare
Pull request for series with
subject: selftests/bpf: Extend sockmap_redir to test no-redir SK_DROP/SK_PASS
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=999303