Hi Martin, Matt,
On Wed, 2024-08-14 at 15:37 -0700, Martin KaFai Lau wrote:
> On 8/14/24 3:04 AM, Matthieu Baerts wrote:
> > Hi Martin,
> >
> > Thank you for your reply!
> >
> > On 14/08/2024 03:12, Martin KaFai Lau wrote:
> > > On 8/5/24 2:52 AM, Matthieu Baerts (NGI0) wrote:
> > > > +static in
On Wed, 2024-08-07 at 09:59 +0300, Ido Schimmel wrote:
> On Wed, Aug 07, 2024 at 12:08:15PM +0800, Geliang Tang wrote:
> > On Tue, 2024-08-06 at 10:40 +0300, Ido Schimmel wrote:
> > > On Tue, Aug 06, 2024 at 12:20:38PM +0800, Geliang Tang wrote:
> > > > From: Geliang
On Tue, 2024-08-06 at 09:34 +0200, Nicolas Dichtel wrote:
> Le 06/08/2024 à 06:20, Geliang Tang a écrit :
> > From: Geliang Tang
> >
> > So many "Address not found" messages occur at the end of forwarding
> > tests
> > when using "ip address de
Hi Ido,
Thanks for the review.
On Tue, 2024-08-06 at 10:40 +0300, Ido Schimmel wrote:
> On Tue, Aug 06, 2024 at 12:20:38PM +0800, Geliang Tang wrote:
> > From: Geliang Tang
> >
> > So many "Address not found" messages occur at the end of forwarding
> >
From: Geliang Tang
So many "Address not found" messages occur at the end of forwarding tests
when using "ip address del" command for an invalid address:
TEST: FDB limits interacting with FDB type local[ OK ]
Error: ipv4: Address not found.
... ...
T
Hi Matt,
On Sat, 2024-07-06 at 02:25 +0200, Matthieu Baerts wrote:
> Hi Martin,
>
> Thank you for your reply!
>
> On 06/07/2024 01:10, Martin KaFai Lau wrote:
> > On 7/4/24 3:48 AM, Matthieu Baerts wrote:
> > > > diff --git a/tools/testing/selftests/bpf/Makefile
> > > > b/tools/testing/
> > > >
On Mon, 2024-07-22 at 22:54 -0700, Tony Ambardar wrote:
> Add a "bpf_util.h" include to avoid the following error seen
> compiling for
> mips64el with musl libc:
>
> bench.c: In function 'find_benchmark':
> bench.c:590:25: error: implicit declaration of function
> 'ARRAY_SIZE' [-Werror=implici
> + if (!getsockname(fd, (struct sockaddr *) &addr, &addrlen))
nit: Generally, a space is not required when casting:
(struct sockaddr *)&addr
not
(struct sockaddr *) &addr.
See here:
$ grep -r "struct sockaddr \*) \&"
tools/testing/selftests/bpf/prog_tests | wc -l
1
$ grep -r "struct sockaddr \*)\&"
tools/testing/selftests/bpf/prog_tests | wc -l
33
Except this, LGTM.
Acked-by: Geliang Tang
> return ntohs(addr.sin6_port);
>
> return 0;
On Tue, 2024-07-23 at 19:43 -0700, Alexei Starovoitov wrote:
> On Tue, Jul 23, 2024 at 7:07 PM Geliang Tang
> wrote:
> >
> > Hi Alexei,
> >
> > On Tue, 2024-07-23 at 17:04 -0700, Alexei Starovoitov wrote:
> > > I strongly suggest you invest just as much
env.worker_pids = calloc(sizeof(__pid_t),
> env.workers);
> + env.worker_pids = calloc(sizeof(pid_t),
> env.workers);
Yes, "pid_t" is much better. "worker_pids" dose define as "pid_t" in
test_progs.h:
struct test_env {
... ...
ommunity has such a
rule. I will try to reduce the number of iterations of my patches and
the number of my emails sent to our community.
I am very willing to review other people's patches, but I am only
familiar with "BPF [SELFTESTS]" module. If possible, I would like to
add myself (Ge
From: Geliang Tang
Now both SOCK_SEQPACKET and SOCK_NONBLOCK can be passed as "type" parameter
into start_server_str(), use this helper in socket_loopback_reuseport() in
sockmap_helpers.h to simplify the code.
Signed-off-by: Geliang Tang
---
.../bpf/prog_tests/sockmap_helpers.h
From: Geliang Tang
The types "sotype | SOCK_NONBLOCK" are passed to socket_loopback_reuseport
by some tests in sockmap_listen.c, so they must be handled in helper
start_server_addr() too.
This patch uses SOCK_TYPE_MASK to clear useless bits of "type" before check
whether it
From: Geliang Tang
No only SOCK_STREAM type supports listen for connections on a socket,
SOCK_SEQPACKET used in sockmap_listen.c supports it too. This patch
adds a new helper listen_support() to check whether a given "type"
supports listen for connections on a socket or not.
Sig
From: Geliang Tang
This patch adds a new helper loopback_addr_str() to get the loopback
address string according to the given different protocol family.
Also use this new helper in start_servers() in migrate_reuseport.c.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf
From: Geliang Tang
This patch adds AF_VSOCK support for make_sockaddr(), uses atoi()
to convert the given addr_str string to an integer id and sets it to
"svm_cid". Set "svm_port" as VMADDR_PORT_ANY if the value of port is
zero.
Signed-off-by: Geliang Tang
---
tools/t
From: Geliang Tang
AF_VSOCK is supported in make_sockaddr() now, use it to implement
init_addr_loopback() in sockmap_helpers.h. Then three local functions
init_addr_loopback4(), init_addr_loopback6() and init_addr_loopback_vsock()
can be dropped.
Signed-off-by: Geliang Tang
---
.../bpf
From: Geliang Tang
This patch uses start_server_str() to start a AF_ALG server in test
crypto_sanity, since no listen is needed in this test, nolisten flag
of network_helper_opts is set.
Signed-off-by: Geliang Tang
---
.../testing/selftests/bpf/prog_tests/crypto_sanity.c | 12
1
From: Geliang Tang
This patch adds AF_ALG support for make_sockaddr(), uses sscanf()
to parse the given addr_str string to "salg_type" and "salg_name"
of struct sockaddr_alg.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/network_helpers.c | 15 +++
From: Geliang Tang
This patch adds a struct member "nolisten" for network_helper_opts,
which is used to control whether to invoke listen() or not in
start_server_addr().
Also print out a warning if backlog is set for a type not support
listen for connections.
Signed-off-by: Ge
From: Geliang Tang
The first user of send_to_addr_str() is send_udp_packets() in xdp_bonding.
Use sprintf() to generate "addr_str" string from ifindex, sll_halen and
sll_addr, and pass it to send_to_addr_str(). Since IPPROTO_ICMP is used,
set it as opts.proto and pass opts to the
From: Geliang Tang
Similar to network helper connect_to_addr_str(), this patch adds a new
helper send_to_addr_str(). It uses make_sockaddr() to make a
sockaddr_storage type address from the "family", "addr_str" and "port"
parameters and passes it to send_to_addr()
From: Geliang Tang
Similar to network helpers connect_to_addr() and connect_to_fd_opts(), this
patch adds two helpers send_to_addr() send_to_fd_opts() to use sendto()
to send data. They accepts three more parameters "const void *data",
"size_t datalen" and "int fl
From: Geliang Tang
AF_PACKET can be passed to start_server_str() now. Use it to simplify
the code in lwt_redirect.
In this test, use sprintf() to save the "ifindex" value into addr_str
string, then pass it to the helper.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/
From: Geliang Tang
This patch adds AF_PACKET support for make_sockaddr(), uses sscanf()
to parse the given addr_str string into sll_ifindex, sll_halen and
sll_addr of sockaddr_ll. Other fields of struct sockaddr_ll are not
used in BPF selftests right now.
Signed-off-by: Geliang Tang
---
tools
From: Geliang Tang
This set is part 11 of series "use network helpers" all BPF selftests
wide.
Finally something new in this set.
The helper make_sockaddr is extended to support sockets of AF_PACKET,
AF_ALG and AF_VSOCK families. Then these types of sockets can be used
to start_
From: Geliang Tang
This patch uses network helper start_server_str() in skc_to_unix_sock
test in skc_to_unix_sock.c to simplify the code.
This is the first time to use start_server_str() for a AF_UNIX socket.
The first "@" of "sun_path" needs to be skipped by make_sockad
From: Geliang Tang
The helper start_server_addr() is a wrapper of __start_server(), the
only difference between them is __start_server() accepts a sockaddr type
address parameter, but start_server_addr() accepts a sockaddr_storage one.
This patch drops __start_server(), and updates the callers
From: Geliang Tang
This patch uses the new helper connect_to_addr_str() in sk_lookup.c to
create the client socket and connect to the server, instead of using local
defined function make_client(). This local function can be dropped then.
Signed-off-by: Geliang Tang
---
.../selftests/bpf
From: Geliang Tang
No need to use a dedicated helper inetaddr_len() to get the length of
the IPv4 or IPv6 address, it can be got by make_sockaddr(), this patch
drops it.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sk_lookup.c | 21 ---
1 file changed, 9
From: Geliang Tang
This patch uses the public network helers client_socket() + make_sockaddr()
in sk_lookup.c to create the client socket, set the timeout sockopts, and
make the connecting address. The local defined function make_socket()
can be dropped then.
Signed-off-by: Geliang Tang
From: Geliang Tang
This set is part 10 of series "use network helpers" all BPF selftests
wide.
Patches 1-3 drop local functions make_client(), make_socket() and
inetaddr_len() in sk_lookup.c. Patch 4 drops a useless function
__start_server() in network_helpers.c.
Geliang Tang (4):
From: Geliang Tang
Use local helper make_client() in drop_on_lookup(), drop_on_reuseport()
and run_multi_prog_lookup() instead of using make_socket() + connect().
Then make_socket() and inetaddr_len() can be dropped.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sk_lookup.c
From: Geliang Tang
This patch uses the new helper connect_to_addr_str() in make_client()
instead of using local defined function make_socket() + connect(). This
local function can be dropped latter.
A new parameter "expect_errno" is added for make_client() too to allow
different &qu
From: Geliang Tang
Similar to connect_to_addr() helper for connecting to a server with the
given sockaddr_storage type address, this patch adds a new helper named
connect_to_addr_str() for connecting to a server with the given string
type address "addr_str", together with its "fa
From: Geliang Tang
The struct member "must_fail" of network_helper_opts() is only used in
cgroup_v1v2 tests, it makes sense to drop it from network_helper_opts.
Return value (fd) of connect_to_fd_opts() and the expect errno (EPERM)
can be checked in cgroup_v1v2.c directly, no need to
From: Geliang Tang
The "type" parameter of connect_to_fd_opts() is redundant of "server_fd".
Since the "type" can be obtained inside by invoking getsockopt(SO_TYPE),
without passing it in as a parameter.
This patch drops the "type" parameter of conn
From: Geliang Tang
v3:
- patch 2:
- clear errno before connect_to_fd_opts.
- print err logs in run_test.
- set err to -1 when fd >= 0.
- patch 3:
- drop "int err".
v2:
- update patch 2 as Martin suggested.
This is the 9th part of series "use network helpers&
Hi John,
On Mon, 2024-07-01 at 18:29 +0800, Geliang Tang wrote:
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > On Mon, 2024-07-01 at 17:00 +0800, D. Wythe wrote:
> > > > > > > > > > >
From: Geliang Tang
ENOTSUPP is defined in bpf/str_error.h now, so no need to redefine it
in so many places in bpf selftests.
This patch includes in testing_helpers.h, which is
almost included by each tests. And drop all duplicate definitions.
Signed-off-by: Geliang Tang
---
tools/testing
From: Geliang Tang
Run bloom_filter_map selftests (./test_progs -t bloom_filter_map) on a
Loongarch platform, an error message "JIT doesn't support bpf-to-bpf calls"
is got in user space, together with an unexpected errno EINVAL (22), not
ENOTSUPP (524):
libbpf: prog 'inn
From: Geliang Tang
Errno 95 (ENOTSUP or EOPNOTSUPP) can be recognized by libbpf_strerror_r(),
but 524 (ENOTSUPP) can't:
prog 'basic_alloc3': BPF program load failed: Operation not supported
prog 'basic_alloc3': failed to load: -95
failed to lo
From: Geliang Tang
v2:
- patch 1, only commit log updated
- update patch 2
- add an unsigned variable
- use "switch-case"
- only "Operation not supported", no (-524) in string
- patch 3, a now one
This patchset contains three fixes for handling errno ENOTSUPP
From: Geliang Tang
Use local helper make_client() in drop_on_lookup(), drop_on_reuseport()
and run_multi_prog_lookup() instead of using make_socket() + connect().
Then make_socket() and inetaddr_len() can be dropped.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sk_lookup.c
From: Geliang Tang
This patch uses the new helper connect_to_addr_str() in make_client()
instead of using local defined function make_socket() + connect(). This
local function can be dropped latter.
A new parameter "expect_errno" is added for make_client() too to allow
different &qu
From: Geliang Tang
Similar to connect_to_addr() helper for connecting to a server with the
given sockaddr_storage type address, this patch adds a new helper named
connect_to_addr_str() for connecting to a server with the given string
type address "addr_str", together with its "fa
From: Geliang Tang
The struct member "must_fail" of network_helper_opts() is only used in
cgroup_v1v2 tests, it makes sense to drop it from network_helper_opts.
Return value (fd) of connect_to_fd_opts() and the expect errno (EPERM)
can be checked in cgroup_v1v2.c directly, no need to
From: Geliang Tang
The "type" parameter of connect_to_fd_opts() is redundant of "server_fd".
Since the "type" can be obtained inside by invoking getsockopt(SO_TYPE),
without passing it in as a parameter.
This patch drops the "type" parameter of conn
From: Geliang Tang
v2:
- update patch 2 as Martin suggested.
This is the 9th part of series "use network helpers" all BPF selftests
wide.
Patches 1-2 update network helpers interfaces suggested by Martin.
Patch 3 adds a new helper connect_to_addr_str() as Martin suggested
instead
From: Geliang Tang
Use local helper make_client() in drop_on_lookup(), drop_on_reuseport()
and run_multi_prog_lookup() instead of using make_socket() + connect().
Then make_socket() and inetaddr_len() can be dropped.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sk_lookup.c
From: Geliang Tang
This patch uses the new helper connect_to_addr_str() in make_client()
instead of using local defined function make_socket() + connect(). This
local function can be dropped latter.
A new parameter "expect_errno" is added for make_client() too to allow
different &qu
From: Geliang Tang
Similar to connect_to_addr() helper for connecting to a server with the
given sockaddr_storage type address, this patch adds a new helper named
connect_to_addr_str() for connecting to a server with the given string
type address "addr_str", together with its "fa
From: Geliang Tang
The struct member "must_fail" of network_helper_opts() is only used in
cgroup_v1v2 tests, it makes sense to drop it from network_helper_opts.
Return value (fd) of connect_to_fd_opts() and the expect errno (EPERM)
can be checked in cgroup_v1v2.c directly, no need to
From: Geliang Tang
The "type" parameter of connect_to_fd_opts() is redundant of "server_fd".
Since the "type" can be obtained inside by invoking getsockopt(SO_TYPE),
without passing it in as a parameter.
This patch drops the "type" parameter of conn
From: Geliang Tang
This is the 9th part of series "use network helpers" all BPF selftests
wide.
Patches 1-2 update network helpers interfaces suggested by Martin.
Patch 3 adds a new helper connect_to_addr_str() as Martin suggested
instead of adding connect_fd_to_addr_str().
Patch 4
From: Geliang Tang
If bpf_object__load() fails in test_xdp_adjust_frags_tail_grow(), "obj"
opened before this should be closed. So use "goto out" to close it instead
of using "return" here.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/prog_tests/xd
From: Geliang Tang
Run bpf_tcp_ca selftests (./test_progs -t bpf_tcp_ca) on a Loongarch
platform, some "Segmentation fault" errors occur:
'''
test_dctcp:PASS:bpf_dctcp__open_and_load 0 nsec
test_dctcp:FAIL:bpf_map__attach_struct_ops unexpected error: -524
#29/1
From: Geliang Tang
v2:
- only check the first "link" (link_nl) in test_mixed_links().
- Drop patch 2 in v1.
Resend patch 1 out of "skip ENOTSUPP BPF selftests" set as Eduard
suggested. Together with another fix for xdp_adjust_tail.
Geliang Tang (2):
selftests/bpf: Null
On Wed, 2024-07-10 at 12:25 +0100, Alan Maguire wrote:
> On 09/07/2024 11:45, Geliang Tang wrote:
> > From: Geliang Tang
> >
> > Run bpf_tcp_ca selftests (./test_progs -t bpf_tcp_ca) on a
> > Loongarch
> > platform, some
Hi Eduard,
On Mon, 2024-07-08 at 12:42 -0700, Eduard Zingerman wrote:
> On Fri, 2024-07-05 at 10:38 +0800, Geliang Tang wrote:
>
> [...]
>
> I think that this patch is an improvement independent of the patch-
> set.
> Please submit it separately.
>
> >
From: Geliang Tang
If bpf_object__load() fails in test_xdp_adjust_frags_tail_grow(), "obj"
opened before this should be closed. So use "goto out" to close it instead
of using "return" here.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/prog_tests/xd
From: Geliang Tang
Run dummy_st_ops selftests (./test_progs -t dummy_st_ops) on a Loongarch
platform, some "unexpected arg" errors occur:
'''
#78/1dummy_st_ops/dummy_st_ops_attach:OK
test_dummy_init_ret_value:FAIL:test_ret unexpected test_ret: \
From: Geliang Tang
Run bpf_tcp_ca selftests (./test_progs -t bpf_tcp_ca) on a Loongarch
platform, some "Segmentation fault" errors occur:
'''
test_dctcp:PASS:bpf_dctcp__open_and_load 0 nsec
test_dctcp:FAIL:bpf_map__attach_struct_ops unexpected error: -524
#29/1
From: Geliang Tang
Resend patch 1 out of "skip ENOTSUPP BPF selftests" set as Eduard
suggested. Together with two other cleanups.
Geliang Tang (3):
selftests/bpf: Null checks for links in bpf_tcp_ca
selftests/bpf: Check ASSERT_OK(err) in dummy_st_ops
selftests/bpf: Close ob
From: Geliang Tang
Use local helper make_client() in drop_on_lookup(), drop_on_reuseport()
and run_multi_prog_lookup() instead of using make_socket() + connect().
Then make_socket() and inetaddr_len() can be dropped now.
make_client() returns normal "fd" instead of "-1" when
From: Geliang Tang
This patch uses the new helper connect_fd_to_addr_str() in make_client()
instead of using local defined function make_socket() + connect(). This
local function can be dropped latter.
A new parameter "expect_errno" is added for make_client() too to allow
From: Geliang Tang
This patch uses public helper connect_fd_to_fd() exported in
network_helpers.h instead of using getsockname() + connect() in
run_lookup_prog() in prog_tests/sk_lookup.c. This can simplify
the code.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/prog_tests
From: Geliang Tang
Similar to connect_fd_to_fd() helper to connect from a client fd to a
server fd, this patch adds a new helper connect_fd_to_addr_str() to connect
from a client fd to a server address. It accepts the server address string
"addr_str", together with the server family
From: Geliang Tang
This patch uses public helper start_server_addr() in udp_recv_send()
in prog_tests/sk_lookup.c to simplify the code.
And use ASSERT_OK_FD() to check fd returned by start_server_addr().
Acked-by: Eduard Zingerman
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf
From: Geliang Tang
This patch uses public helper start_server_str() to simplify make_server()
in prog_tests/sk_lookup.c.
Add a callback setsockopts() to do all sockopts, set it to post_socket_cb
pointer of struct network_helper_opts. And add a new struct cb_opts to save
the data needed to pass
From: Geliang Tang
In the error path when update_lookup_map() fails in drop_on_reuseport in
prog_tests/sk_lookup.c, "server1", the fd of server 1, should be closed.
This patch fixes this by using "goto close_srv1" lable instead of "detach"
to close "serve
From: Geliang Tang
Some callers expect __start_server() helper to pass their own "backlog"
value to listen() instead of the default of 1. So this patch adds struct
member "backlog" for network_helper_opts to allow callers to set "backlog"
value via start_serv
From: Geliang Tang
Add a new dedicated ASSERT macro ASSERT_OK_FD to test whether a socket
FD is valid or not. It can be used to replace macros ASSERT_GT(fd, 0, ""),
ASSERT_NEQ(fd, -1, "") or statements (fd < 0), (fd != -1).
Suggested-by: Martin KaFai Lau
Signed-off-by: G
From: Geliang Tang
v11:
- new patches 2, 4, 6.
- drop expect_errno from network_helper_opts as Eduard and Martin
suggested.
- drop sockmap_ktls patches from this set.
- add a new helper connect_fd_to_addr_str.
v10:
- a new patch 10 is added.
- patches 1-6, 8-9 unchanged, only commit
On Mon, 2024-07-08 at 10:29 +0800, Geliang Tang wrote:
> > > > From: Geliang Tang
> > > >
> > > > Include network_helpers.h in prog_tests/sockmap_ktls.c, use
> > > > public
> > > > network
> > > > helper start_server_str()
On Sat, 2024-07-06 at 22:45 +0800, Geliang Tang wrote:
> From: Geliang Tang
>
> v9:
> - new patches 5-7, new struct member expect_errno for
> network_helper_opts.
> - patches 1-4, 8-9 unchanged.
> - update patches 10-11 to make sure all tests pass.
Superseded, v10 is se
From: Geliang Tang
Use local helper make_client() in run_multi_prog_lookup() instead of using
make_socket() + connect(). Then make_socket() and inetaddr_len() can be
dropped now.
make_client() returns normal "fd" instead of "-1" when connect() fails
but "expect_errn
From: Geliang Tang
Add a new parameter expect_errno for make_client(), and use public network
helpers make_sockaddr() + connect_to_addr() in it instead of using local
defined function make_socket() + connect(). This local function can be
dropped latter.
A new parameter "expect_errno"
From: Geliang Tang
This patch uses public helper connect_fd_to_fd() exported in
network_helpers.h instead of using getsockname() + connect() in
run_lookup_prog() in prog_tests/sk_lookup.c. This can simplify
the code.
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/prog_tests
From: Geliang Tang
This patch uses public helper start_server_addr() instead of local
defined function 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
From: Geliang Tang
The errno EPERM is skipped in connect_fd_to_addr() by cgroup_v1v2 tests.
More generally, it makes sense to add a struct member "expect_errno" for
network_helper_opts to identify the expect errno to be skipped.
Correspondingly, connect_fd_to_addr() helper needs to
From: Geliang Tang
In the error path when update_lookup_map() fails in drop_on_reuseport in
prog_tests/sk_lookup.c, "server1", the fd of server 1, should be closed.
This patch fixes this by using "goto close_srv1" lable instead of "detach"
to close "serve
From: Geliang Tang
EINPROGRESS is skipped in run_lookup_test() in cgroup_skb_sk_lookup
tests, but it is still showed in the log:
./test_progs -t cgroup_skb_sk_lookup -v
run_cgroup_bpf_test:PASS:skel_open_load 0 nsec
run_cgroup_bpf_test:PASS:cgroup_join 0 nsec
From: Geliang Tang
To make connect_fd_to_fd() more flexible, use a struct network_helper_opts
parameter "opts" instead of timeout_ms. With this change, other opts like
"must_fail" can be used in connect_fd_to_fd() too.
Signed-off-by: Geliang Tang
---
tools/t
From: Geliang Tang
This patch uses public helper make_sockaddr() exported in network_helpers.h
instead of open-coding in sockmap_ktls.c. This can avoid duplicate code.
Acked-by: Eduard Zingerman
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sockmap_ktls.c | 16
From: Geliang Tang
Use public network helper connect_to_fd_opts() instead of open-coding it
in prog_tests/sockmap_ktls.c. This can avoid duplicate code.
Acked-by: Eduard Zingerman
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sockmap_ktls.c| 14 ++
1 file
From: Geliang Tang
Include network_helpers.h in prog_tests/sockmap_ktls.c, use public network
helper start_server_str() instead of local defined function tcp_server().
This can avoid duplicate code.
Technically, this is not a one-for-one replacement, as start_server_str()
also does bind(). But
From: Geliang Tang
Some callers expect __start_server() helper to pass their own "backlog"
value to listen() instead of the default of 1. So this patch adds struct
member "backlog" for network_helper_opts to allow callers to set "backlog"
value via start_serv
From: Geliang Tang
v10:
- a new patch 10 is added.
- patches 1-6, 8-9 unchanged, only commit logs updated.
- "err = -errno" is used in patches 7, 11, 12 to get the real error
number before checking value of "err".
v9:
- new patches 5-7, new struct mem
From: Geliang Tang
Use local helper make_client() in run_multi_prog_lookup() instead of using
make_socket() + connect(). Then make_socket() and inetaddr_len() can be
dropped now.
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sk_lookup.c | 46 ++-
1 file
From: Geliang Tang
Add a new parameter expect_errno for make_client(), and use public network
helpers make_sockaddr() + connect_to_addr() in it instead of using local
defined function make_socket() + connect(). This local function can be
dropped latter.
Signed-off-by: Geliang Tang
From: Geliang Tang
This patch uses public helper start_server_addr() instead of local
defined function 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
From: Geliang Tang
Server 1 fd should be closed in the error path when update_lookup_map()
fails. This patch fixes it by goto "close_srv1" instead of "detach"
lable in that case.
Acked-by: Eduard Zingerman
Signed-off-by: Geliang Tang
---
tools/testing/selftests/bpf/prog_t
From: Geliang Tang
EINPROGRESS is skipped in run_lookup_test() in cgroup_skb_sk_lookup
tests, but it is still showed in the log:
./test_progs -t cgroup_skb_sk_lookup -v
run_cgroup_bpf_test:PASS:skel_open_load 0 nsec
run_cgroup_bpf_test:PASS:cgroup_join 0 nsec
From: Geliang Tang
The errno EPERM is skipped in connect_fd_to_addr() by cgroup_v1v2 tests.
More generally, it makes sense to add a "expect_errno" struct member for
network_helper_opts to identify the expect errno to be skipped.
Signed-off-by: Geliang Tang
---
tools/testing/sel
From: Geliang Tang
To make connect_fd_to_fd() more flexible, use a struct network_helper_opts
parameter "opts" instead of timeout_ms. With this change, other opts like
"must_fail" can be used in connect_fd_to_fd() too.
Signed-off-by: Geliang Tang
---
tools/t
From: Geliang Tang
This patch uses public helper make_sockaddr() exported in network_helpers.h
instead of open-coding in sockmap_ktls.c. This can avoid duplicate code.
Acked-by: Eduard Zingerman
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sockmap_ktls.c | 16
From: Geliang Tang
Use public network helper connect_to_fd_opts() instead of open-coding it
in prog_tests/sockmap_ktls.c. This can avoid duplicate code.
Acked-by: Eduard Zingerman
Signed-off-by: Geliang Tang
---
.../selftests/bpf/prog_tests/sockmap_ktls.c| 14 ++
1 file
From: Geliang Tang
Include network_helpers.h in prog_tests/sockmap_ktls.c, use public network
helper start_server_str() instead of local defined function tcp_server().
This can avoid duplicate code.
Technically, this is not a one-for-one replacement, as start_server_str()
also does bind(). But
From: Geliang Tang
Some callers expect __start_server() helper to pass their own "backlog"
value to listen() instead of the default of 1. So this patch adds struct
member "backlog" for network_helper_opts to allow callers to set "backlog"
value via start_serv
1 - 100 of 471 matches
Mail list logo