Two cleanups for sockmap_listen selftests: enable a kconfig and add a
new helper.
Geliang Tang (2):
selftests/bpf: Enable CONFIG_VSOCKETS in config
selftests/bpf: Add pair_redir_to_connected helper
tools/testing/selftests/bpf/config| 1 +
.../selftests/bpf/prog_tests
:
vsock_socketpair_connectible() failed
vsock_unix_redir_connectible:FAIL:1496
So this patch enables it in tools/testing/selftests/bpf/config.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/config | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/bpf
socketpair infos to
the new common helper to do the connections.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sockmap_listen.c | 149 --
1 file changed, 30 insertions(+), 119 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
b/tools/testing
socketpairs info to
the new common helper to do the connections.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sockmap_listen.c | 159 --
1 file changed, 35 insertions(+), 124 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
b/tools
:
vsock_socketpair_connectible() failed
vsock_unix_redir_connectible:FAIL:1496
So this patch enables it in tools/testing/selftests/bpf/config.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/config | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/bpf
v2:
- rename c0/c1 to cli0/cli1, p0/p1 to peer0/perr1 as Daniel suggested.
Two cleanups for sockmap_listen selftests: enable a kconfig and add a
new helper.
Geliang Tang (2):
selftests/bpf: Enable CONFIG_VSOCKETS in config
selftests/bpf: Add pairs_redir_to_connected helper
tools/testing
socketpairs info to the new common helper to do the connections.
Signed-off-by: Geliang Tang
---
v3:
- move xclose() out of pairs_redir_to_connected.
v2:
- rename c0/c1 to cli0/cli1, p0/p1 to peer0/perr1 as Daniel suggested.
---
.../selftests/bpf/prog_tests/sockmap_listen.c | 146
From: Geliang Tang
bpf_testmod_exit() should not have a return value, so this patch drops this
useless 'return' in it.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/too
From: Geliang Tang
bpf_testmod_exit() should not have a return value, so this patch drops this
useless 'return' in it.
Acked-by: Jiri Olsa
Signed-off-by: Geliang Tang
---
v2:
- rebase on top of latest bpf-next/master.
---
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | 2
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
Hi Jakub,
On Wed, 2024-04-03 at 15:29 -0700, John Fastabend wrote:
> Jakub Sitnicki wrote:
> > Hi Geliang,
> >
> > On Wed, Apr 03, 2024 at 04:32 PM +08, Geliang Tang wrote:
> > > From: Geliang Tang
> > >
> > > Incorrect arguments are passed
On Thu, 2024-04-04 at 21:47 -0700, John Fastabend wrote:
> Geliang Tang wrote:
> > Hi Jakub,
> >
> > On Wed, 2024-04-03 at 15:29 -0700, John Fastabend wrote:
> > > Jakub Sitnicki wrote:
> > > > Hi Geliang,
> > > >
> > > > On Wed
From: Geliang Tang
Address Martin's comments for v1 (thanks.)
- drop patch 1, "export send_byte helper".
- drop "WRITE_ONCE(arg.stop, 0)".
- rebased.
send_recv_data will be re-used in MPTCP bpf tests, but not included
in this set because it depends on other patches
From: Geliang Tang
Avoid setting total_bytes and stop as global variables, this patch adds
a new struct named send_recv_arg to pass arguments between threads. Put
these two variables together with fd into this struct and pass it to
server thread, so that server thread can access these two
From: Geliang Tang
This patch extracts the code to send and receive data into a new
helper named send_recv_data() in network_helpers.c and export it
in network_helpers.h.
This helper will be used for MPTCP BPF selftests.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf
Hi Martin,
On Mon, 2024-04-08 at 11:45 +0800, Geliang Tang wrote:
> From: Geliang Tang
>
> This patch extracts the code to send and receive data into a new
> helper named send_recv_data() in network_helpers.c and export it
> in network_helpers.h.
>
> This helper will
From: Geliang Tang
v3:
- add two more patches.
- use log_err instead of ASSERT in v3.
- let send_recv_data return int as Martin suggested.
v2:
Address Martin's comments for v1 (thanks.)
- drop patch 1, "export send_byte helper".
- drop "WRITE_ONCE(arg.s
From: Geliang Tang
The helpers ASSERT_OK/GE/OK_PTR should avoid using in public functions.
This patch uses log_err() to replace them in network_helpers.c.
And drop '#include "test_progs.h"' in it, include and
instead.
Signed-off-by: Geliang Tang
---
tools/t
From: Geliang Tang
Avoid setting total_bytes and stop as global variables, this patch adds
a new struct named send_recv_arg to pass arguments between threads. Put
these two variables together with fd into this struct and pass it to
server thread, so that server thread can access these two
From: Geliang Tang
This patch extracts the code to send and receive data into a new
helper named send_recv_data() in network_helpers.c and export it
in network_helpers.h.
This helper will be used for MPTCP BPF selftests.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf
From: Geliang Tang
Some tests, such as the MPTCP bpf tests, require send_recv_data helper
to run in nonblock mode.
This patch adds nonblock support for send_recv_data(). Check if it is
currently in nonblock mode, and if so, ignore EWOULDBLOCK to continue
sending and receiving.
Signed-off-by
On Tue, 2024-04-09 at 18:57 +0800, Geliang Tang wrote:
> From: Geliang Tang
>
> This patch extracts the code to send and receive data into a new
> helper named send_recv_data() in network_helpers.c and export it
> in network_helpers.h.
>
> This helper will be used fo
From: Geliang Tang
v4:
- fix a bug in v3, it should be 'if (err)', not 'if (!err)'.
- move "selftests/bpf: Use log_err in network_helpers" out of this
series.
v3:
- add two more patches.
- use log_err instead of ASSERT in v3.
- let send_recv_data retur
From: Geliang Tang
Avoid setting total_bytes and stop as global variables, this patch adds
a new struct named send_recv_arg to pass arguments between threads. Put
these two variables together with fd into this struct and pass it to
server thread, so that server thread can access these two
From: Geliang Tang
This patch extracts the code to send and receive data into a new
helper named send_recv_data() in network_helpers.c and export it
in network_helpers.h.
This helper will be used for MPTCP BPF selftests.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf
From: Geliang Tang
Some tests, such as the MPTCP bpf tests, require send_recv_data helper
to run in nonblock mode.
This patch adds nonblock support for send_recv_data(). Check if it is
currently in nonblock mode, and if so, ignore EWOULDBLOCK to continue
sending and receiving.
Signed-off-by
From: Geliang Tang
This patchset uses public helpers start_server_* and connect_to_* defined
in network_helpers.c to drop duplicate code.
Geliang Tang (14):
selftests/bpf: Add start_server_addr helper
selftests/bpf: Use start_server_addr in cls_redirect
selftests/bpf: Use connect_to_addr
From: Geliang Tang
In order to pair up with connect_to addr(), this patch adds a new helper
start_server_addr(), which is a wrapper of __start_server(), and accepts an
argument 'addr' of 'struct sockaddr' type instead of a string type argument
like start_server().
Signed-
From: Geliang Tang
Include network_helpers.h in prog_tests/cls_redirect.c, use the newly
added public helper start_server_addr() instead of the local defined
function start_server(). This can avoid duplicate code.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/cls_redirect.c
From: Geliang Tang
This patch uses public helper connect_to_addr() exported in
network_helpers.h instead of the local defined function connect_to_server()
in prog_tests/cls_redirect.c. This can avoid duplicate code.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/cls_redirect.c
From: Geliang Tang
Include network_helpers.h in prog_tests/sk_assign.c, use the newly
added public helper start_server_addr() instead of the local defined
function start_server(). This can avoid duplicate code.
The code set SO_RCVTIMEO timeout as timeo_sec (3s) can be dropped,
since
From: Geliang Tang
This patch uses public helper connect_to_addr() exported in
network_helpers.h instead of the local defined function connect_to_server()
in prog_tests/sk_assign.c. This can avoid duplicate code.
The code set SO_SNDTIMEO timeout as timeo_sec (3s) can be dropped, since
From: Geliang Tang
The helpers ASSERT_OK/GE/OK_PTR should avoid using in public functions.
This patch uses log_err() to replace them in network_helpers.c.
And drop '#include "test_progs.h"' in it, include and
instead.
Signed-off-by: Geliang Tang
---
tools/t
From: Geliang Tang
Include network_helpers.h in test_sock_addr.c, use the newly added
public helper start_server_addr() instead of the local defined
function start_server(). This can avoid duplicate code.
In order to use functions defined in network_helpers.c, Makefile needs
to be updated and
From: Geliang Tang
__start_server() sets SO_REUSPORT through setsockopt() when the parameter
'reuseport' is set. This patch makes it more flexible by accepting a
function pointer named setsockopt.
Then the original start_reuseport_server() can be implemented by passing
in a new
From: Geliang Tang
This patch uses public helper connect_to_addr() exported in
network_helpers.h instead of the local defined function connect_to_server()
in test_sock_addr.c. This can avoid duplicate code.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/test_sock_addr.c | 36
From: Geliang Tang
This patch adds a new helper start_server_setsockopt(), which is a wrapper
of __start_server(), and accepts a function pointer setsockopt as a
parameter.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/network_helpers.c | 6 ++
tools/testing/selftests/bpf
From: Geliang Tang
Include network_helpers.h in prog_tests/sockopt_inherit.c, use public
helpers make_sockaddr() and start_server_setsockopt() instead of the
local defined function start_server(). This can avoid duplicate code.
Signed-off-by: Geliang Tang
---
.../bpf/prog_tests
From: Geliang Tang
This patch uses public helper connect_to_fd() exported in network_helpers.h
instead of the local defined function connect_to_server() in
prog_tests/sockopt_inherit.c. This can avoid duplicate code.
Signed-off-by: Geliang Tang
---
.../bpf/prog_tests/sockopt_inherit.c
From: Geliang Tang
Include network_helpers.h in test_tcp_check_syncookie_user.c, use
public helpers start_server_addr() and start_server_setsockopt() in it
instead of the local defined function start_server(). This can avoid
duplicate code.
In order to use functions defined in network_helpers.c
From: Geliang Tang
This patch uses public helper connect_to_addr() exported in
network_helpers.h instead of the local defined function connect_to_server()
in test_tcp_check_syncookie_user.c. This can avoid duplicate code.
Signed-off-by: Geliang Tang
---
.../bpf/test_tcp_check_syncookie_user.c
On Wed, 2024-04-10 at 15:29 +0800, Geliang Tang wrote:
> From: Geliang Tang
>
> The helpers ASSERT_OK/GE/OK_PTR should avoid using in public
> functions.
> This patch uses log_err() to replace them in network_helpers.c.
>
> And drop '#include "test_progs.h&q
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
self
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 it
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
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 strcu
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
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
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
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
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
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
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. (tha
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/ne
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
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
> > unneces
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 Y
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-
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
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 commen
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 it
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 h
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
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
Superseded, will send a v3 soon.
Thanks,
-Geliang
On Wed, 2024-06-12 at 22:41 +0800, Geliang Tang wrote:
> From: Geliang Tang
>
> v2:
> - update patch 2, extract a new helper start_client.
> - drop patch 3, keep must_fail in network_helper_opts.
>
> Drop ty
From: Geliang Tang
v3:
- rename start_client to client_socket
- Use connect_to_addr in connect_to_fd_opt
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
From: Geliang Tang
The opts.{type, noconnect} 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 it
From: Geliang Tang
This patch moves "post_socket_cb" and "noconnect" into connect_to_addr(),
then connect_to_fd_opts() can be implemented by getsockname() and
connect_to_addr(). This change makes connect_to_* interfaces more unified.
Signed-off-by: Geliang Tang
---
tools/t
From: Geliang Tang
This patch extracts a new helper client_socket() 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 client_socket() and
connect_fd_to_addr(). This helper can be used in connect_to
From: Geliang Tang
In test_bpf_ip_check_defrag_ok(), the new helper client_socket() can be
used to replace connect_to_fd_opts() with "noconnect" opts, and the strcut
member "noconnect" of network_helper_opts can be dropped now, always
connect to server in connect_to_fd_op
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
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
Sorry, v3 breaks the CI.
Changes Requested.
-Geliang
On Mon, 2024-06-17 at 16:33 +0800, Geliang Tang wrote:
> From: Geliang Tang
>
> v3:
> - rename start_client to client_socket
> - Use connect_to_addr in connect_to_fd_opt
>
> v2:
> - update patch 2, extract a
From: Geliang Tang
v4:
- fix errors reported by CI.
v3:
- rename start_client to client_socket
- Use connect_to_addr in connect_to_fd_opt
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
From: Geliang Tang
The opts.{type, noconnect} 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 it
From: Geliang Tang
This patch moves "post_socket_cb" and "noconnect" into connect_to_addr(),
then connect_to_fd_opts() can be implemented by getsockname() and
connect_to_addr(). This change makes connect_to_* interfaces more unified.
Signed-off-by: Geliang Tang
---
tools/t
From: Geliang Tang
This patch extracts a new helper client_socket() 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 client_socket() and
connect_fd_to_addr(). This helper can be used in connect_to
From: Geliang Tang
In test_bpf_ip_check_defrag_ok(), the new helper client_socket() can be
used to replace connect_to_fd_opts() with "noconnect" opts, and the strcut
member "noconnect" of network_helper_opts can be dropped now, always
connect to server in connect_to_fd_op
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
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
v5:
- update patch 1, add getsockopt(SO_PROTOCOL) in connect_to_fd() to
fix errors reported by CI.
v4:
- fix errors reported by CI.
v3:
- rename start_client to client_socket
- Use connect_to_addr in connect_to_fd_opt
v2:
- update patch 2, extract a new helper
From: Geliang Tang
The opts.{type, noconnect} 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 it
From: Geliang Tang
This patch moves "post_socket_cb" and "noconnect" into connect_to_addr(),
then connect_to_fd_opts() can be implemented by getsockname() and
connect_to_addr(). This change makes connect_to_* interfaces more unified.
Signed-off-by: Geliang Tang
---
tools/t
From: Geliang Tang
This patch extracts a new helper client_socket() 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 client_socket() and
connect_fd_to_addr(). This helper can be used in connect_to
From: Geliang Tang
In test_bpf_ip_check_defrag_ok(), the new helper client_socket() can be
used to replace connect_to_fd_opts() with "noconnect" opts, and the strcut
member "noconnect" of network_helper_opts can be dropped now, always
connect to server in connect_to_fd_op
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
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
v6:
- update ASSERT strings in patch 4 as Eduard suggested. (thanks)
v5:
- update patch 1, add getsockopt(SO_PROTOCOL) in connect_to_fd() to
fix errors reported by CI.
v4:
- fix errors reported by CI.
v3:
- rename start_client to client_socket
- Use connect_to_addr in
From: Geliang Tang
The opts.{type, noconnect} 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 it
From: Geliang Tang
This patch moves "post_socket_cb" and "noconnect" into connect_to_addr(),
then connect_to_fd_opts() can be implemented by getsockname() and
connect_to_addr(). This change makes connect_to_* interfaces more unified.
Acked-by: Eduard Zingerman
Signed-
From: Geliang Tang
This patch extracts a new helper client_socket() 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 client_socket() and
connect_fd_to_addr(). This helper can be used in connect_to
From: Geliang Tang
In test_bpf_ip_check_defrag_ok(), the new helper client_socket() can be
used to replace connect_to_fd_opts() with "noconnect" opts, and the strcut
member "noconnect" of network_helper_opts can be dropped now, always
connect to server in connect_to_fd_opts(
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.
Acked-by: Eduard Zingerman
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/prog_tests
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.
Acked-by: Eduard Zingerman
Signed-off-by: Geliang Tang
---
.../bpf/test_tcp_check_syncookie_user.c | 29
From: Geliang Tang
This patch set uses network helpers in sockmap_ktls and sk_lookup, and drop
three local helpers tcp_server(), inetaddr_len() and make_socket() in them.
Geliang Tang (6):
selftests/bpf: Use start_server in sockmap_ktls
selftests/bpf: Use connect_to_fd in sockmap_ktls
From: Geliang Tang
Include network_helpers.h in prog_tests/sockmap_ktls.c, use public network
helper start_server() instead of the local defined function tcp_server().
This can avoid duplicate code.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sockmap_ktls.c| 18
From: Geliang Tang
Use public network helper connect_to_fd() instead of open-coding it in
prog_tests/sockmap_ktls.c. This can avoid duplicate code.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sockmap_ktls.c| 14 ++
1 file changed, 2 insertions(+), 12
From: Geliang Tang
This patch uses public helper start_server_addr() in make_server() in
prog_tests/sk_lookup.c to avoid duplicate code.
Add a helper setsockopts() to set SOL_CUSTOM sockopt looply, set
it to setsockopt pointer of struct network_helper_opts, and pass it to
start_server_addr
From: Geliang Tang
This patch adds a new parameter "len" for make_socket() to get the length
of the address by make_sockaddr(), then local helper inetaddr_len() can be
dropped.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sk_lookup.c | 30 +
From: Geliang Tang
This patch uses public helper connect_to_fd() exported in network_helpers.h
instead of using make_socket() and connect() in prog_tests/sk_lookup.c.
This can simplify the code.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sk_lookup.c | 33
1 - 100 of 474 matches
Mail list logo