From: Geliang Tang
Since start_server_str() is added now, it can be used in script
test_tcp_check_syncookie_user.c instead of start_server_addr() to
simplify the code.
Signed-off-by: Geliang Tang
Acked-by: Eduard Zingerman
---
.../bpf/test_tcp_check_syncookie_user.c | 29
From: Geliang Tang
Since start_server_str() is added now, it can be used in mptcp.c in
start_mptcp_server() instead of using helpers make_sockaddr() and
start_server_addr() to simplify the code.
Signed-off-by: Geliang Tang
Acked-by: Eduard Zingerman
---
tools/testing/selftests/bpf/prog_tests
From: Geliang Tang
The opts.{type, noconnect, must_fail} is at least a bit non intuitive or
unnecessary. The only use case now is in test_bpf_ip_check_defrag_ok which
ends up bypassing most (or at least some) of the connect_to_fd_opts()
logic. It's much better that test should have its own
From: Geliang Tang
This patch extracts a new helper start_client() from connect_to_fd_opts()
to create the client socket, but don't connect to the server. Then
connect_to_fd_opts() can be implemented using start_client() and
connect_fd_to_addr().
In test_bpf_ip_check_defrag_ok(), the new helper
From: Geliang Tang
v2:
- update patch 2, extract a new helper start_client.
- drop patch 3, keep must_fail in network_helper_opts.
Drop type and noconnect from network_helper_opts. And use start_server_str
in mptcp and test_tcp_check_syncookie_user.
Patches 1-2 address Martin's comments
From: Geliang Tang
Incorrect arguments are passed to fcntl() in test_sockmap.c when invoking
it to set file status flags. If O_NONBLOCK is used as 2nd argument and
passed into fcntl, -EINVAL will be returned (See do_fcntl() in fs/fcntl.c).
The correct approach is to use F_SETFL as 2nd argument
From: Geliang Tang
tls_sw doesn't work for sk_redirect in nonblock mode, sk_msg_recvmsg()
returns 0 in that case in tls_sw_recvmsg(). This patch fixes this by using
"continue" to receive msg again instead of ending it if strp isn't ready
and rx_list is empty.
Signed-off-by: Ge
From: Geliang Tang
v7:
- a better fix for tls_sw_recvmsg.
v6:
- add a fix for tls_sw_recvmsg().
v5:
- add a new patch "Check recv lengths in test_sockmap" instead of using
"continue" in msg_loop.
v4:
- address Martin's comments for v3. (thanks.)
- add Yongho
On Tue, 2024-06-11 at 14:20 -0700, Eduard Zingerman wrote:
> On Tue, 2024-06-11 at 09:59 +0800, Geliang Tang wrote:
> > From: Geliang Tang
> >
> > The opts.{type, noconnect, must_fail} is at least a bit non
> > intuitive or
> > u
From: Geliang Tang
Incorrect arguments are passed to fcntl() in test_sockmap.c when invoking
it to set file status flags. If O_NONBLOCK is used as 2nd argument and
passed into fcntl, -EINVAL will be returned (See do_fcntl() in fs/fcntl.c).
The correct approach is to use F_SETFL as 2nd argument
From: Geliang Tang
tls_sw_recvmsg() doesn't work in nonblock mode, it returns -EAGAIN in
that case. This patch fixes it, always wait for receiving the next skb
for sk_redirect.
Signed-off-by: Geliang Tang
---
net/tls/tls_sw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/tls
From: Geliang Tang
v6:
- add a fix for tls_sw_recvmsg().
v5:
- add a new patch "Check recv lengths in test_sockmap" instead of using
"continue" in msg_loop.
v4:
- address Martin's comments for v3. (thanks.)
- add Yonghong's "Acked-by" tags. (thanks.)
- u
From: Geliang Tang
netns created by open_netns() should be closed in error paths in
test_vxlan_tunnel(), test_ip6vxlan_tunnel() and test_ipip_tunnel().
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/test_tunnel.c| 27 +--
1 file changed, 19 insertions(+), 8
From: Geliang Tang
The kconfigs CONFIG_INET_XFRM_TUNNEL and CONFIG_INET6_XFRM_TUNNEL are
needed by test_tunnel tests. This patch enables them together with the
dependent kconfigs CONFIG_INET_IPCOMP and CONFIG_INET6_IPCOMP.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/config | 4
From: Geliang Tang
v2:
- resend patch 1.
- another fix for test_tunnel.
Geliang Tang (2):
selftests/bpf: Enable INET_XFRM_TUNNEL in config
selftests/bpf: Close netns in error paths in test_tunnel
tools/testing/selftests/bpf/config| 4 +++
.../selftests/bpf/prog_tests
On Wed, May 29, 2024 at 02:01:06AM +0200, Ilya Leoshkevich wrote:
> On Fri, 2024-05-24 at 18:27 +0200, Daniel Borkmann wrote:
> > On 5/16/24 3:41 AM, Geliang Tang wrote:
> > > From: Geliang Tang
> > >
> > > The kconfigs CONFIG_INET_XFRM_TUNNEL and CONFIG_INET
From: Geliang Tang
Since start_server_str() is added now, it can be used in script
test_tcp_check_syncookie_user.c instead of start_server_addr() to
simplify the code.
Signed-off-by: Geliang Tang
---
.../bpf/test_tcp_check_syncookie_user.c | 29 ++-
1 file changed, 3
From: Geliang Tang
Since start_server_str() is added now, it can be used in mptcp.c in
start_mptcp_server() instead of using helpers make_sockaddr() and
start_server_addr() to simplify the code.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/prog_tests/mptcp.c | 7 +--
1 file
From: Geliang Tang
This patch adds another new parameter "must_fail" for __connect_to_fd_opts,
then opts->must_fail can be replaced by "must_fail" parameter in it. In
run_test() of cgroup_v1v2, true is passed to it, while false is passed in
other places. And the s
From: Geliang Tang
This patch adds another new parameter "noconnect" for __connect_to_fd_opts,
then opts->noconnect can be replaced by "noconnect" parameter in it. In
test_bpf_ip_check_defrag_ok(), true is passed to it. And the strcut member
"noconnect" of netwo
From: Geliang Tang
The opts.{type, noconnect, must_fail} is at least a bit non intuitive or
unnecessary. The only use case now is in test_bpf_ip_check_defrag_ok which
ends up bypassing most (or at least some) of the connect_to_fd_opts()
logic. It's much better that test should have its own
From: Geliang Tang
Drop type, noconnect and must_fail from network_helper_opts. And use
start_server_str in mptcp and test_tcp_check_syncookie_user.
Patches 1-3 address Martin's comments in the previous series.
Geliang Tang (5):
selftests/bpf: Drop type from network_helper_opts
selftests
On Fri, May 31, 2024 at 01:13:39PM +0200, Jakub Sitnicki wrote:
> On Thu, May 30, 2024 at 04:45 PM -07, John Fastabend wrote:
> > Geliang Tang wrote:
> >> On Mon, 2024-05-27 at 21:36 +0200, Jakub Sitnicki wrote:
> >> > On Mon, May 27, 2024 at 10:12 AM -07, John Fas
From: Geliang Tang
bpf_map_lookup_elem() has been removed from do_test(), it makes the
sk_stg_map argument of do_test() useless. In addition, two exactly the
same opts are passed in all the places where do_test() is invoked, so
cli_opts argument can be dropped too.
This patch drops these two
From: Geliang Tang
The "if (sk_stg_map)" block in do_test() is only used by test_dctcp(),
it makes sense to move it from do_test() into test_dctcp(). Then
do_test() can be used by other tests except test_dctcp().
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/bp
From: Geliang Tang
The newly added helper start_test() can be used in test_dctcp_fallback()
too, to replace start_server_str() and connect_to_fd_opts(). In that
way, two network_helper_opts srv_opts and cli_opts are used instead of
the previously shared opts.
Signed-off-by: Geliang Tang
From: Geliang Tang
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 settcpca
From: Geliang Tang
For moving the "if (sk_stg_map)" block out of do_test(), extract the
code before this block as a new function start_test(). It creates
server-side and client-side sockets and returns them to the caller.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/
From: Geliang Tang
For moving dctcp test dedicated code out of do_test() into test_dctcp().
This patchset adds a new helper start_test() in bpf_tcp_ca.c to refactor
do_test().
Address Martin's comments for the previous series.
Geliang Tang (5):
selftests/bpf: Use connect_to_fd_opts
Hi Lukasz,
On Wed, 2024-05-29 at 14:43 +0200, Lukasz Majewski wrote:
> Hi Geliang,
>
> First of all - thanks for spotting and fixing this error.
>
> > From: Geliang Tang
> >
> > The hsr_ping test reports the following errors:
> >
> > INFO: preparin
On Mon, 2024-05-27 at 21:36 +0200, Jakub Sitnicki wrote:
> On Mon, May 27, 2024 at 10:12 AM -07, John Fastabend wrote:
> > Geliang Tang wrote:
> > > From: Geliang Tang
> > >
> > > Switch attachments to bpf_link using
> > > bpf_program__atta
From: Geliang Tang
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
From: Geliang Tang
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
From: Geliang Tang
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
From: Geliang Tang
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: Geli
From: Geliang Tang
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 i
From: Geliang Tang
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-b
From: Geliang Tang
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 &qu
From: Geliang Tang
This patchset uses post_socket_cb and post_connect_cb callbacks of struct
network_helper_opts to refactor do_test() in bpf_tcp_ca.c to move dctcp
test dedicated code out of do_test() into test_dctcp().
v5:
- address Martin's comments in v4 (thanks)
- add patch 4, use
From: Geliang Tang
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
From: Geliang Tang
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
From: Geliang Tang
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
From: Geliang Tang
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-b
From: Geliang Tang
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 i
From: Geliang Tang
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 &qu
From: Geliang Tang
This patchset uses post_socket_cb and post_connect_cb callbacks of struct
network_helper_opts to refactor do_test() in bpf_tcp_ca.c to move dctcp
test dedicated code out of do_test() into test_dctcp().
v4:
- address Martin's comments in v3 (thanks).
- drop 2 patches, keep
This patch is "Rejected", according to Jakub's comments:
https://lore.kernel.org/bpf/87zfsiw3a3@cloudflare.com/
Thanks,
-Geliang
On Wed, 2024-05-22 at 18:08 +0800, Geliang Tang wrote:
> From: Geliang Tang
>
> Since prog_attach_type[] array is defined, it makes sense
From: Geliang Tang
bpf_map_lookup_elem is invoked in bpf_prog3() already, no need to invoke
it again. This patch drops it.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/progs/test_sockmap_kern.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tools/testing/selftests/bpf
From: Geliang Tang
The value of recv in msg_loop may be negative, like EWOULDBLOCK, so it's
necessary to check if it is positive before accumulating it to bytes_recvd.
Fixes: 16962b2404ac ("bpf: sockmap, add selftests")
Signed-off-by: Geliang Tang
---
tools/testing/sel
From: Geliang Tang
The array size of map_fd[] is 9, not 8. This patch changes it as a more
general form: ARRAY_SIZE(map_fd).
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/test_sockmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests
From: Geliang Tang
The program fds can be got by using bpf_program__fd(progs[]), then
prog_fd becomes useless. This patch drops it.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/test_sockmap.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools
From: Geliang Tang
bpf_program__attach_sockmap() needs to take a parameter of type bpf_program
instead of an fd, so tx_prog_fd becomes useless. This patch uses a pointer
tx_prog to point to an item in progs[] array.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/test_sockmap.c
From: Geliang Tang
Switch attachments to bpf_link using bpf_program__attach_sockmap() instead
of bpf_prog_attach().
This patch adds a new array progs[] to replace prog_fd[] array, set in
populate_progs() for each program in bpf object.
And another new array links[] to save the attached
From: Geliang Tang
There's already a definition of i in run_options() at the beginning, no
need to define a new one in "if (tx_prog_fd > 0)" block.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/test_sockmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-
From: Geliang Tang
The values of tx_prog_fd in run_options() should not be 0, so set it as -1
in else branch, and test it using "if (tx_prog_fd > 0)" condition, not
"if (tx_prog_fd)" or "if (tx_prog_fd >= 0)".
Signed-off-by: Geliang Tang
---
tools/test
From: Geliang Tang
This patchset contains some fixes and improvements for test_sockmap.
3-5: switching attachments to bpf_link as Jakub suggested in [1].
1-2, 6-8: Small fixes.
[1]
https://lore.kernel.org/bpf/87zfsiw3a3@cloudflare.com/
Geliang Tang (8):
selftests/bpf: Fix tx_prog_fd
From: Geliang Tang
The hsr_ping test reports the following errors:
INFO: preparing interfaces for HSRv0.
INFO: Initial validation ping.
INFO: Longer ping test.
INFO: Cutting one link.
INFO: Delay the link and drop a few packages.
INFO: All good.
INFO: preparing interfaces for HSRv1
On Wed, 2024-05-22 at 11:05 +0800, Hangbin Liu wrote:
> On Tue, May 21, 2024 at 04:49:44PM +0800, Geliang Tang wrote:
> > From: Geliang Tang
> >
> > The hsr_ping test reports the following errors:
> >
> > INFO: preparing interfaces for HSRv0.
> > I
From: Geliang Tang
Since prog_attach_type[] array is defined, it makes sense to use it paired
with prog_fd[] array for bpf_prog_attach() and bpf_prog_detach2() instead
of open-coding.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/test_sockmap.c | 44 +++---
1
From: Geliang Tang
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
From: Geliang Tang
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
From: Geliang Tang
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-b
From: Geliang Tang
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
From: Geliang Tang
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 i
From: Geliang Tang
Since "type" is a struct member of network_helper_opts, it makes sense
to drop the "type" parameter of connect_to_addr() helper, using opts->type
instead in this helper.
If no network_helper_opts is set, use SOCK_STREAM as default socket type.
Sign
From: Geliang Tang
Since "type" is a struct member of network_helper_opts, it makes sense
to drop the "type" parameter of start_server_addr() and __start_server()
helpers, using opts->type instead in the helpers.
If no network_helper_opts is set, use SOCK_STREAM as defau
From: Geliang Tang
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 &qu
From: Geliang Tang
This patchset uses post_socket_cb and post_connect_cb callbacks of struct
network_helper_opts to refactor do_test() in bpf_tcp_ca.c to move dctcp
test dedicated code out of do_test() into test_dctcp().
v3:
- Add 4 new patches, 1-3 are cleanups. 4 adds a new helper
From: Geliang Tang
The hsr_ping test reports the following errors:
INFO: preparing interfaces for HSRv0.
INFO: Initial validation ping.
INFO: Longer ping test.
INFO: Cutting one link.
INFO: Delay the link and drop a few packages.
INFO: All good.
INFO: preparing interfaces for HSRv1
From: Geliang Tang
bpf_prog5 and bpf_prog7 are removed from progs/test_sockmap_kern.h in
commit d79a32129b21 ("bpf: Selftests, remove prints from sockmap tests"),
now there are only 9 progs in it, not 11:
SEC("sk_skb1")
int bpf_prog1(struct __sk_buff *skb)
From: Geliang Tang
The kconfigs CONFIG_INET_XFRM_TUNNEL and CONFIG_INET6_XFRM_TUNNEL are
needed by test_tunnel tests. This patch enables them together with the
dependent kconfigs CONFIG_INET_IPCOMP and CONFIG_INET6_IPCOMP.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/config | 4
From: Geliang Tang
This patch uses netns helpers create_netns() and cleanup_netns() in
lwt_helpers.h instead of using the local function netns_create() and
netns_delete().
For using these helpers. network_helpers.h needs to be included in
lwt_helpers.h. Then '#include "network_help
From: Geliang Tang
This patch uses cleanup_netns() helper in BPF tests wide to replace
close_netns() and "ip netns del", included assign_reuse.c, crypto_sanity.c,
decap_sanity.c, fib_lookup.c, ns_current_pid_tgid.c, sock_destroy.c,
sock_iter_batch.c, xdp_dev_bound_only.c and xdp_do_
From: Geliang Tang
This patch adds a new struct member name in struct nstoken, to save
the name of the given network namespace. It dups the name string in
open_netns() and freed in close_netns().
Then move cleanup_netns() from mptcp.c into network_helpers.c as a
public helper. In it the newly
From: Geliang Tang
The newly added helper create_netns() can be used in assign_reuse.c,
fib_lookup.c, ns_current_pid_tgid.c, sock_destroy.c and sock_iter_batch.c
to simplify the code.
It changes the behavior of test fib_lookup.c a little bit, but doesn't
affect the results.
Signed-off
From: Geliang Tang
This patch moves create_netns() from mptcp.c into network_helpers.c, and
export it in network_helpers.h as a public helper.
The new helper accepts a string parameter, and uses SYS_NOFAIL() instead
of SYS() to execute the command, since SYS() deponds on test__fail()
which
From: Geliang Tang
This patch drops the duplicate local functions create_netns() in
bind_perm.c, bpf_iter_setsockopt.c, setget_sockopt.c, sock_fields.c
and tcp_hdr_options.c and uses unshare_netns() instead.
A new helper create_netns() will be added in network_helpers.c as a
public one.
Signed
From: Geliang Tang
The newly added helper unshare_netns() can be used to replace unshare()
and "ip link set dev lo up" in sk_assign.c, btf_skc_cls_ingress.c and
tcp_custom_syncookie.c to simplify the code.
Signed-off-by: Geliang Tang
---
.../testing/selftests/bpf/
From: Geliang Tang
Many BPF selftests create new test network namespaces by using CLONE_NEWNET
flag to unshare the network namespace, so that the calling process is moved
into a new network namespace which is not shared with any previously
existing process. So this patch adds a new helper
From: Geliang Tang
This patchset addresses Alexei's comment for commit "Handle SIGINT
when creating netns" [1]. Export local helpers create_netns() and
cleanup_netns() defined in mptcp.c into network_helpers.c as generic
ones. For this another helper unshare_netns() is added
Sorry, this patch breaks CI.
Changes Requested.
-Geliang
On Wed, 2024-05-15 at 13:59 +0800, Geliang Tang wrote:
> From: Geliang Tang
>
> This patch uses netns helpers create_netns() and cleanup_netns() in
> test_tunnel.c instead of using open_netns() and close_netns()
> direct
From: Geliang Tang
This patch uses netns helpers create_netns() and cleanup_netns() in
test_tunnel.c instead of using open_netns() and close_netns() directly.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/test_tunnel.c| 19 +--
1 file changed, 9 insertions
From: Geliang Tang
This patch uses netns helpers create_netns() and cleanup_netns() in
lwt_helpers.h instead of using the local function netns_create() and
netns_delete().
For using these helpers. network_helpers.h needs to be included in
lwt_helpers.h. Then '#include "network_help
From: Geliang Tang
This patch uses cleanup_netns() helper in BPF tests wide to replace
close_netns() and "ip netns del", included assign_reuse.c, crypto_sanity.c,
decap_sanity.c, fib_lookup.c, ns_current_pid_tgid.c, sock_destroy.c,
sock_iter_batch.c, xdp_dev_bound_only.c and xdp_do_
From: Geliang Tang
This patch adds a new struct member name in struct nstoken, to save
the name of the given network namespace. It dups the name string in
open_netns() and freed in close_netns().
Then move cleanup_netns() from mptcp.c into network_helpers.c as a
public helper. In it the newly
From: Geliang Tang
The newly added helper create_netns() can be used in assign_reuse.c,
fib_lookup.c, ns_current_pid_tgid.c, sock_destroy.c and sock_iter_batch.c
to simplify the code.
It changes the behavior of test fib_lookup.c a little bit, but doesn't
affect the results.
Signed-off
From: Geliang Tang
This patch moves create_netns() from mptcp.c into network_helpers.c, and
export it in network_helpers.h as a public helper.
The new helper accepts a string parameter, and uses SYS_NOFAIL() instead
of SYS() to execute the command, since SYS() deponds on test__fail()
which
From: Geliang Tang
This patch drops the duplicate local functions create_netns() in
bind_perm.c, bpf_iter_setsockopt.c, setget_sockopt.c, sock_fields.c
and tcp_hdr_options.c and uses unshare_netns() instead.
A new helper create_netns() will be added in network_helpers.c as a
public one.
Signed
From: Geliang Tang
The newly added helper unshare_netns() can be used to replace unshare()
and "ip link set dev lo up" in sk_assign.c, btf_skc_cls_ingress.c and
tcp_custom_syncookie.c to simplify the code.
Signed-off-by: Geliang Tang
---
.../testing/selftests/bpf/
From: Geliang Tang
Many BPF selftests create new test network namespaces by using CLONE_NEWNET
flag to unshare the network namespace, so that the calling process is moved
into a new network namespace which is not shared with any previously
existing process. So this patch adds a new helper
From: Geliang Tang
This patchset addresses Alexei's comment for commit "Handle SIGINT
when creating netns" [1]. Export local helpers create_netns() and
cleanup_netns() defined in mptcp.c into network_helpers.c as generic
ones. For this another helper unshare_netns() is added
From: Geliang Tang
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
From: Geliang Tang
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
From: Geliang Tang
This patch uses start_server_addr() in do_test() in prog_tests/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
From: Geliang Tang
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 post_socket_opts type member cb_opts into struct
From: Geliang Tang
This patchset uses post_socket_cb and post_connect_cb callbacks of struct
network_helper_opts to refactor do_test() in bpf_tcp_ca.c to move dctcp
test dedicated code out of do_test() into test_dctcp().
Patch 3 adds a new member in post_socket_opts and patch 4 adds a new
From: Geliang Tang
The strdup() function returns a pointer to a new string which is a
duplicate of the string "ifname". Memory for the new string is obtained
with malloc(), and need to be freed with free().
This patch adds this missing "free(saved_hwtstamp_ifname)" i
From: Geliang Tang
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
From: Geliang Tang
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
From: Geliang Tang
This patch uses start_server_addr() in do_test() in prog_tests/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
1 - 100 of 229 matches
Mail list logo