-
Notifications
You must be signed in to change notification settings - Fork 97
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
Conversation
Upstream branch: fcd1ed8 |
e20303c
to
cd94b05
Compare
Upstream branch: 80c5a07 |
005c124
to
4ec1ca7
Compare
cd94b05
to
673bb7e
Compare
Upstream branch: 20a759d |
4ec1ca7
to
d93730d
Compare
673bb7e
to
e08d78a
Compare
Upstream branch: bbe91a9 |
d93730d
to
8525133
Compare
e08d78a
to
7d6f39f
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=852477 expired. Closing PR. |
Upstream branch: 5c16727 |
8525133
to
d637217
Compare
537592d
to
9eec413
Compare
80e6eff
to
692463b
Compare
Upstream branch: d9cbd83 |
9eec413
to
8d5ba40
Compare
692463b
to
abd1962
Compare
Upstream branch: 4b3529e |
8d5ba40
to
f6a1869
Compare
abd1962
to
8619fbd
Compare
Upstream branch: 4b3529e |
f6a1869
to
3ea5a13
Compare
8619fbd
to
a9e43a2
Compare
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>
Upstream branch: eb4e772 |
3ea5a13
to
a918950
Compare
a9e43a2
to
d728df7
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=855838 irrelevant now. Closing PR. |
Pull request for series with
subject: use network helpers, part 5
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=852477