Skip to content

Conversation

kernel-patches-daemon-bpf-rc[bot]
Copy link

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

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 9621eb6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=999303
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: e12873e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=999303
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 93a83d0
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=999303
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 60ef541
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=999303
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 60ef541
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=999303
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: f859813
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=999303
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 5d87e96
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=999303
version: 1

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]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: a578b54
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=999303
version: 1

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant