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

sockmap: some performance optimizations #2854

Closed
wants to merge 5 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: sockmap: some performance optimizations
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=630798

@kernel-patches-bot
Copy link
Author

Master branch: 34ba23b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=630798
version: 1

@kernel-patches-bot
Copy link
Author

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

@kernel-patches-bot
Copy link
Author

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

@kernel-patches-bot
Copy link
Author

Master branch: 33fc250
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=630798
version: 1

@kernel-patches-bot
Copy link
Author

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

@kernel-patches-bot
Copy link
Author

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

@kernel-patches-bot
Copy link
Author

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

@kernel-patches-bot
Copy link
Author

Master branch: 0f86199
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=630798
version: 1

Kernel Patches Daemon and others added 3 commits April 13, 2022 13:02
This patch inroduces tcp_read_skb() based on tcp_read_sock(),
a preparation for the next patch which actually introduces
a new sock ops.

TCP is special here, because it has tcp_read_sock() which is
mainly used by splice(). tcp_read_sock() supports partial read
and arbitrary offset, neither of them is needed for sockmap.

Cc: Eric Dumazet <edumazet@google.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Currently both splice() and sockmap use ->read_sock() to
read skb from receive queue, but for sockmap we only read
one entire skb at a time, so ->read_sock() is too conservative
to use. Introduce a new proto_ops ->read_skb() which supports
this sematic, with this we can finally pass the ownership of
skb to recv actors.

For non-TCP protocols, all ->read_sock() can be simply
converted to ->read_skb().

Cc: Eric Dumazet <edumazet@google.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
@kernel-patches-bot
Copy link
Author

Master branch: 68477ed
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=630798
version: 1

Cong Wang added 2 commits April 13, 2022 13:02
With ->read_skb() now we have an entire skb dequeued from
receive queue, now we just need to grab an addtional refcnt
before passing its ownership to recv actors.

And we should not touch them any more, particularly for
skb->sk. Fortunately, skb->sk is already set for most of
the protocols except UDP where skb->sk has been stolen,
so we have to fix it up for UDP case.

Cc: Eric Dumazet <edumazet@google.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
We always allocate skmsg with kzalloc(), so there is no need
to call memset(0) on it, the only thing we need from
sk_msg_init() is sg_init_marker(). So introduce a new helper
which is just kzalloc()+sg_init_marker(), this saves an
unncessary memset(0) for skmsg on fast path.

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

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

@kernel-patches-bot kernel-patches-bot deleted the series/630798=>bpf-next branch April 16, 2022 06:01
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