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

use network helpers, part 5 #7021

Closed

Conversation

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

Pull request for series with
subject: use network helpers, part 5
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=852477

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 80c5a07
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=852477
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 20a759d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=852477
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5c16727
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=853278
version: 2

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: d9cbd83
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=855838
version: 5

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4b3529e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=855838
version: 5

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 4b3529e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=855838
version: 5

Geliang Tang added 7 commits May 28, 2024 16:41
It's not possible to have one generic/common "struct post_socket_opts"
for all tests. It's better to have the individual test define its own
callback opts struct.

So this patch drops struct post_socket_opts, and changes the second
parameter of post_socket_cb as "void *" type.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
It's a tech debt that start_server() does not take the "opts" argument.
It's pretty handy to have start_server() as a helper that takes string
address.

So this patch creates a new helper start_server_str(). Then start_server()
can be a wrapper of it.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Since the post_socket_cb() callback is added in struct network_helper_opts,
it's make sense to use it not only in __start_server(), but also in
connect_to_fd_opts(). Then it can be used to set TCP_CONGESTION sockopt.

Add a "void *" type member cb_opts into struct network_helper_opts, and add
a new struct named cb_opts in prog_tests/bpf_tcp_ca.c, then cc can be moved
into struct cb_opts from network_helper_opts. Define a new callback cc_cb()
to set TCP_CONGESTION sockopt, and set it to post_socket_cb pointer of opts.
Define a new cb_opts cubic, set it to cb_opts of opts. Pass this opts to
connect_to_fd_opts() in test_dctcp_fallback().

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
This patch uses start_server_str() helper in test_dctcp_fallback() in
bpf_tcp_ca.c, instead of using start_server() and settcpca(). For
support opts in start_server_str() helper, opts->cb_opts needs to be
passed to post_socket_cb() in __start_server().

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
This patch uses new helper start_server_str() in do_test() in bpf_tcp_ca.c
to accept a struct network_helper_opts argument instead of using
start_server() and settcpca(). Then change the type of the first paramenter
of do_test() into a struct network_helper_opts one.

Define its own cb_opts and opts for each test, set its own cc name into
cb_opts.cc, and cc_cb() into post_socket_cb callback, then pass it to
do_test().

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
This patch uses connect_to_fd_opts() instead of using connect_fd_to_fd()
and settcpca() in do_test() in prog_tests/bpf_tcp_ca.c to accept a struct
network_helper_opts argument.

Then define a dctcp dedicated post_socket_cb callback stg_post_socket_cb(),
invoking both cc_cb() and bpf_map_update_elem() in it, and set it in
test_dctcp(). For passing map_fd into stg_post_socket_cb() callback, a new
member map_fd is added in struct cb_opts.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
For getting rid of the second parameter of do_test(), this patch adds a
new callback post_connect_cb in struct network_helper_opts, it will be
invoked after connect_fd_to_addr() in connect_to_fd_opts().

Then define a dctcp dedicated post_connect_cb callback, invoking
bpf_map_lookup_elem() in it, named stg_post_connect_cb() and set it in
test_dctcp().

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: eb4e772
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=855838
version: 5

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/852477=>bpf-next branch May 29, 2024 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
0 participants