Skip to content
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

sock_map: fix ->poll() and update selftests #1831

Closed
wants to merge 5 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: sock_map: fix ->poll() and update selftests
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=552643

@kernel-patches-bot
Copy link
Author

Master branch: 1997152
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=552643
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: a3debf1
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=552643
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: 2248c2f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=552643
version: 1

@kernel-patches-bot
Copy link
Author

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

@kernel-patches-bot
Copy link
Author

Master branch: 2248c2f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=553841
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: ca3a86d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=553841
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 79e2c30
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=553841
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: ced1858
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=553841
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 4ccb9f0
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=553841
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 571fa24
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=553841
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 732b74d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=560171
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: 732b74d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=560171
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: 6020e87
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=560171
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: 28fd085
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=560171
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: 1acfe7c
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=560171
version: 4

@kernel-patches-bot
Copy link
Author

Master branch: e8522c1
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=560171
version: 4

Nobody and others added 5 commits October 22, 2021 17:38
The proto ops ->stream_memory_read() is currently only used
by TCP to check whether psock queue is empty or not. We need
to rename it before reusing it for non-TCP protocols, and
adjust the exsiting users accordingly.

Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Cc: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
tcp_bpf_sock_is_readable() is pretty much generic,
we can extract it and reuse it for non-TCP sockets.

Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Cc: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Yucong noticed we can't poll() sockets in sockmap even
when they are the destination sockets of redirections.
This is because we never poll any psock queues in ->poll(),
except for TCP. With ->sock_is_readable() now we can
overwrite >sock_is_readable(), invoke and implement it for
both UDP and AF_UNIX sockets.

Reported-by: Yucong Sun <sunyucong@gmail.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Cc: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
We use non-blocking sockets in those tests, retrying for
EAGAIN is ugly because there is no upper bound for the packet
arrival time, at least in theory. After we fix poll() on
sockmap sockets, now we can switch to select()+recv().

Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Cc: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Yucong Sun <sunyucong@gmail.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
@kernel-patches-bot
Copy link
Author

Master branch: 04f8ef5
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=560171
version: 4

@kernel-patches-bot
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants