Skip to content

selftests/bpf: Test sockmap/sockhash redirection #8953

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

Closed

Conversation

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

Pull request for series with
subject: selftests/bpf: Test sockmap/sockhash redirection
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: d0445d7
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4dd372d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the series/952470=>bpf-next branch from d8bf0e9 to 8bdf2ce Compare May 14, 2025 22:37
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4dd372d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 9325d53
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the series/952470=>bpf-next branch from 06ee9bf to 9f24291 Compare May 15, 2025 00:53
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 9325d53
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 9325d53
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 1cb0f56
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: b615ce5
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: b615ce5
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 25b6d5d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4e2e684
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: d90f0bc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the series/952470=>bpf-next branch from 5c6ef39 to 3408614 Compare May 22, 2025 15:50
mmhal added 8 commits May 22, 2025 09:36
Handle af_unix in init_addr_loopback(). For pair creation, bind() the peer
socket to make SOCK_DGRAM connect() happy.

Reviewed-by: Jakub Sitnicki <[email protected]>
Acked-by: John Fastabend <[email protected]>
Signed-off-by: Michal Luczaj <[email protected]>
Add function that returns string representation of socket's domain/type.

Suggested-by: Jakub Sitnicki <[email protected]>
Reviewed-by: Jakub Sitnicki <[email protected]>
Acked-by: John Fastabend <[email protected]>
Signed-off-by: Michal Luczaj <[email protected]>
Add integer wrappers for convenient sockmap usage.

While there, fix misaligned trailing slashes.

Suggested-by: Jakub Sitnicki <[email protected]>
Reviewed-by: Jakub Sitnicki <[email protected]>
Acked-by: John Fastabend <[email protected]>
Signed-off-by: Michal Luczaj <[email protected]>
Instead of piggybacking on test_sockmap_listen, introduce
test_sockmap_redir especially for sockmap redirection tests.

Suggested-by: Jiayuan Chen <[email protected]>
Acked-by: John Fastabend <[email protected]>
Signed-off-by: Michal Luczaj <[email protected]>
Acked-by: John Fastabend <[email protected]>
Test redirection logic. All supported and unsupported redirect combinations
are tested for success and failure respectively.

BPF_MAP_TYPE_SOCKMAP
BPF_MAP_TYPE_SOCKHASH
	x
sk_msg-to-egress
sk_msg-to-ingress
sk_skb-to-egress
sk_skb-to-ingress
	x
AF_INET, SOCK_STREAM
AF_INET6, SOCK_STREAM
AF_INET, SOCK_DGRAM
AF_INET6, SOCK_DGRAM
AF_UNIX, SOCK_STREAM
AF_UNIX, SOCK_DGRAM
AF_VSOCK, SOCK_STREAM
AF_VSOCK, SOCK_SEQPACKET

Suggested-by: Jakub Sitnicki <[email protected]>
Acked-by: John Fastabend <[email protected]>
Signed-off-by: Michal Luczaj <[email protected]>
Remove tests covered by sockmap_redir.

Acked-by: John Fastabend <[email protected]>
Signed-off-by: Michal Luczaj <[email protected]>
Remove tests covered by sockmap_redir.

Acked-by: John Fastabend <[email protected]>
Signed-off-by: Michal Luczaj <[email protected]>
…tests

Remove tests covered by sockmap_redir.

Acked-by: John Fastabend <[email protected]>
Signed-off-by: Michal Luczaj <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5ead949
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=963002
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=963002 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/952470=>bpf-next branch May 22, 2025 22:21
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