[PATCH net v3 4/6] vsock/test: Introduce vsock_connect_fd()

2025-01-28 Thread Michal Luczaj
Distill timeout-guarded vsock_connect_fd(). Adapt callers. Suggested-by: Stefano Garzarella Reviewed-by: Stefano Garzarella Signed-off-by: Michal Luczaj --- tools/testing/vsock/util.c | 45 + tools/testing/vsock/util.h | 1 + 2 files changed, 18 ins

[PATCH net v3 6/6] vsock/test: Add test for connect() retries

2025-01-28 Thread Michal Luczaj
Deliberately fail a connect() attempt; expect error. Then verify that subsequent attempt (using the same socket) can still succeed, rather than fail outright. Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi Signed-off-by: Michal Luczaj --- tools/testing/vsock/vsock_test.c | 47

[PATCH net v3 5/6] vsock/test: Add test for UAF due to socket unbinding

2025-01-28 Thread Michal Luczaj
@@ -1693,6 +1693,59 @@ static void test_stream_msgzcopy_leak_zcskb_server(const struct test_opts *opts) close(fd); } +#define MAX_PORT_RETRIES 24 /* net/vmw_vsock/af_vsock.c */ + +/* Test attempts to trigger a transport release for an unbound socket. This can + * lead to a reference

[PATCH net v3 3/6] vsock/test: Introduce vsock_bind()

2025-01-28 Thread Michal Luczaj
Add a helper for socket()+bind(). Adapt callers. Reviewed-by: Stefano Garzarella Reviewed-by: Luigi Leonardi Signed-off-by: Michal Luczaj --- tools/testing/vsock/util.c | 57 +--- tools/testing/vsock/util.h | 1 + tools/testing/vsock/vsock_test.

Re: [PATCH net-next v2 3/3] test/vsock: add ioctl unsent bytes test

2024-05-08 Thread Stefano Garzarella
On Mon, Apr 08, 2024 at 03:37:49PM GMT, Luigi Leonardi wrote: This test that after a packet is delivered the number of unsent bytes is zero. Signed-off-by: Luigi Leonardi --- tools/testing/vsock/util.c | 6 +-- tools/testing/vsock/util.h | 3 ++ tools/testing/vsock/vsock_test.c

[PATCH net-next v2 3/3] test/vsock: add ioctl unsent bytes test

2024-04-08 Thread Luigi Leonardi
This test that after a packet is delivered the number of unsent bytes is zero. Signed-off-by: Luigi Leonardi --- tools/testing/vsock/util.c | 6 +-- tools/testing/vsock/util.h | 3 ++ tools/testing/vsock/vsock_test.c | 85 3 files changed, 91

Re: [PATCH net-next 3/3] test/vsock: add ioctl unsent bytes test

2024-04-03 Thread Stefano Garzarella
On Tue, Apr 02, 2024 at 05:05:39PM +0200, Luigi Leonardi wrote: This test that after a packet is delivered the number of unsent bytes is zero. Signed-off-by: Luigi Leonardi --- tools/testing/vsock/util.c | 6 +-- tools/testing/vsock/util.h | 3 ++ tools/testing/vsock/vsock_test.c

[PATCH net-next 3/3] test/vsock: add ioctl unsent bytes test

2024-04-02 Thread Luigi Leonardi
This test that after a packet is delivered the number of unsent bytes is zero. Signed-off-by: Luigi Leonardi --- tools/testing/vsock/util.c | 6 +-- tools/testing/vsock/util.h | 3 ++ tools/testing/vsock/vsock_test.c | 83 3 files changed, 89

Re: [PATCH v3 bpf-next 11/11] bpf: Test BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.

2021-04-20 Thread Andrii Nakryiko
On Tue, Apr 20, 2021 at 8:45 AM Kuniyuki Iwashima wrote: > > This patch adds a test for BPF_SK_REUSEPORT_SELECT_OR_MIGRATE and > removes 'static' from settimeo() in network_helpers.c. > > Signed-off-by: Kuniyuki Iwashima > --- Almost everything in prog_tests/migrate_

[PATCH v3 bpf-next 11/11] bpf: Test BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.

2021-04-20 Thread Kuniyuki Iwashima
This patch adds a test for BPF_SK_REUSEPORT_SELECT_OR_MIGRATE and removes 'static' from settimeo() in network_helpers.c. Signed-off-by: Kuniyuki Iwashima --- tools/testing/selftests/bpf/network_helpers.c | 2 +- tools/testing/selftests/bpf/network_helpers.h | 1 + .../bpf/

[PATCH net-next 10/10] selftests: mlxsw: sch_red_ets: Test proper counter cleaning in ETS

2021-04-20 Thread Petr Machata
There was a bug introduced during the rework which cause non-zero backlog being stuck at ETS. Introduce a selftest that would have caught the issue earlier. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/drivers/net/mlxsw/sch_red_ets.sh | 7 +++ 1 file cha

[Patch bpf-next v2 9/9] selftests/bpf: add test cases for redirection between udp and unix

2021-04-19 Thread Cong Wang
From: Cong Wang Add two test cases to ensure redirection between udp and unix work bidirectionally. Cc: John Fastabend Cc: Daniel Borkmann Cc: Jakub Sitnicki Cc: Lorenz Bauer Signed-off-by: Cong Wang --- .../selftests/bpf/prog_tests/sockmap_listen.c | 165 ++ 1 file

[Patch bpf-next v2 8/9] selftests/bpf: add a test case for unix sockmap

2021-04-19 Thread Cong Wang
From: Cong Wang Add a test case to ensure redirection between two AF_UNIX datagram sockets work. Cc: John Fastabend Cc: Daniel Borkmann Cc: Jakub Sitnicki Cc: Lorenz Bauer Signed-off-by: Cong Wang --- .../selftests/bpf/prog_tests/sockmap_listen.c | 92 +++ 1 file changed

[PATCH net-next 13/14] selftests: fib_tests: Add test cases for interaction with mangling

2021-04-18 Thread Pablo Neira Ayuso
From: Ido Schimmel Test that packets are correctly routed when netfilter mangling rules are present. Without previous patch: # ./fib_tests.sh -t ipv4_mangle IPv4 mangling tests TEST: Connection with correct parameters[ OK ] TEST: Connection with

Re: [PATCH net-next 2/2] selftests: fib_nexthops: Test large scale nexthop flushing

2021-04-18 Thread David Ahern
On 4/16/21 8:55 AM, Ido Schimmel wrote: > From: Ido Schimmel > > Test that all the nexthops are flushed when a multi-part nexthop dump is > required for the flushing. > > Without previous patch: > > # ./fib_nexthops.sh > TEST: L

[PATCH bpf-next 07/15] selftests/bpf: Test for btf_load command.

2021-04-16 Thread Alexei Starovoitov
From: Alexei Starovoitov Improve selftest to check that btf_load is working from bpf program. Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/progs/syscall.c | 48 + 1 file changed, 48 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/syscall.c

[PATCH bpf-next 05/15] selftests/bpf: Test for syscall program type

2021-04-16 Thread Alexei Starovoitov
From: Alexei Starovoitov bpf_prog_type_syscall is a program that creates a bpf map, updates it, and loads another bpf program using bpf_sys_bpf() helper. Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/Makefile | 1 + .../selftests/bpf/prog_tests/syscall.c|

[PATCH net-next 2/2] selftests: fib_nexthops: Test large scale nexthop flushing

2021-04-16 Thread Ido Schimmel
From: Ido Schimmel Test that all the nexthops are flushed when a multi-part nexthop dump is required for the flushing. Without previous patch: # ./fib_nexthops.sh TEST: Large scale nexthop flushing [FAIL] With previous patch: # ./fib_nexthops.sh TEST

[PATCH net-next 13/13] selftests: mptcp: add packet mark test case

2021-04-15 Thread Mat Martineau
From: Florian Westphal Extend mptcp_connect tool with SO_MARK support (-M ) and add a test case that checks that the packet mark gets copied to all subflows. This is done by only allowing packets with either skb->mark 1 or 2 via iptables. DROP rule packet counter is checked; if its not z

Re: [PATCHv5 bpf-next 7/7] selftests/bpf: Use ASSERT macros in lsm test

2021-04-15 Thread Andrii Nakryiko
On Wed, Apr 14, 2021 at 12:52 PM Jiri Olsa wrote: > > Replacing CHECK with ASSERT macros. > > Suggested-by: Andrii Nakryiko > Signed-off-by: Jiri Olsa > --- thanks! Acked-by: Andrii Nakryiko > .../selftests/bpf/prog_tests/test_lsm.c | 27 +++ > 1 file changed, 10 inser

[PATCHv8 bpf-next 4/4] selftests/bpf: add xdp_redirect_multi test

2021-04-15 Thread Hangbin Liu
Add a bpf selftest for new helper xdp_redirect_map_multi(). In this test there are 3 forward groups and 1 exclude group. The test will redirect each interface's packets to all the interfaces in the forward group, and exclude the interface in exclude map. Two maps (DEVMAP, DEVMAP_HASH) and tw

[PATCHv8 bpf-next 3/4] sample/bpf: add xdp_redirect_map_multi for redirect_map broadcast test

2021-04-15 Thread Hangbin Liu
This is a sample for xdp redirect broadcast. In the sample we could forward all packets between given interfaces. There is also an option -X that could enable 2nd xdp_prog on egress interface. Acked-by: Toke Høiland-Jørgensen Signed-off-by: Hangbin Liu --- samples/bpf/Makefile

Re: [PATCHv4 bpf-next 2/5] selftests/bpf: Add re-attach test to fentry_test

2021-04-14 Thread Andrii Nakryiko
On Wed, Apr 14, 2021 at 3:57 AM Jiri Olsa wrote: > > On Tue, Apr 13, 2021 at 02:54:10PM -0700, Andrii Nakryiko wrote: > > SNIP > > > > __u32 duration = 0, retval; > > > + struct bpf_link *link; > > > __u64 *result; > > > > > > - fentry_skel = fentry_test__open_and_load(

[PATCHv5 bpf-next 7/7] selftests/bpf: Use ASSERT macros in lsm test

2021-04-14 Thread Jiri Olsa
Replacing CHECK with ASSERT macros. Suggested-by: Andrii Nakryiko Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/test_lsm.c | 27 +++ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_lsm.c b/tools/testi

[PATCHv5 bpf-next 6/7] selftests/bpf: Test that module can't be unloaded with attached trampoline

2021-04-14 Thread Jiri Olsa
Adding test to verify that once we attach module's trampoline, the module can't be unloaded. Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/module_attach.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/tools/testing/sel

[PATCHv5 bpf-next 5/7] selftests/bpf: Add re-attach test to lsm test

2021-04-14 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) lsm programs, plus check that already linked program can't be attached again. Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/test_lsm.c | 48 +++ 1 file changed, 38 insertions(+

[PATCHv5 bpf-next 4/7] selftests/bpf: Add re-attach test to fexit_test

2021-04-14 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fexit programs, plus check that already linked program can't be attached again. Also switching to ASSERT* macros. Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/fexit_test.c

[PATCHv5 bpf-next 3/7] selftests/bpf: Add re-attach test to fentry_test

2021-04-14 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fentry programs, plus check that already linked program can't be attached again. Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/fentry_test.c| 52 +-- 1 file change

[PATCH net 1/3] ixgbe: Fix NULL pointer dereference in ethtool loopback test

2021-04-14 Thread Tony Nguyen
From: Alexander Duyck The ixgbe driver currently generates a NULL pointer dereference when performing the ethtool loopback test. This is due to the fact that there isn't a q_vector associated with the test ring when it is setup as interrupts are not normally added to the test rings. To ad

[PATCHv7 bpf-next 4/4] selftests/bpf: add xdp_redirect_multi test

2021-04-14 Thread Hangbin Liu
Add a bpf selftest for new helper xdp_redirect_map_multi(). In this test there are 3 forward groups and 1 exclude group. The test will redirect each interface's packets to all the interfaces in the forward group, and exclude the interface in exclude map. Two maps (DEVMAP, DEVMAP_HASH) and tw

[PATCHv7 bpf-next 3/4] sample/bpf: add xdp_redirect_map_multi for redirect_map broadcast test

2021-04-14 Thread Hangbin Liu
This is a sample for xdp redirect broadcast. In the sample we could forward all packets between given interfaces. There is also an option -X that could enable 2nd xdp_prog on egress interface. Signed-off-by: Hangbin Liu --- samples/bpf/Makefile | 3 + samples/bpf/xdp_redir

Re: [PATCHv4 bpf-next 3/5] selftests/bpf: Add re-attach test to fexit_test

2021-04-14 Thread Jiri Olsa
On Tue, Apr 13, 2021 at 02:55:32PM -0700, Andrii Nakryiko wrote: > On Mon, Apr 12, 2021 at 9:30 AM Jiri Olsa wrote: > > > > Adding the test to re-attach (detach/attach again) tracing > > fexit programs, plus check that already linked program can't > > be attached

Re: [PATCHv4 bpf-next 2/5] selftests/bpf: Add re-attach test to fentry_test

2021-04-14 Thread Jiri Olsa
On Tue, Apr 13, 2021 at 02:54:10PM -0700, Andrii Nakryiko wrote: SNIP > > __u32 duration = 0, retval; > > + struct bpf_link *link; > > __u64 *result; > > > > - fentry_skel = fentry_test__open_and_load(); > > - if (CHECK(!fentry_skel, "fentry_skel_load", "fentry s

Re: [PATCHv4 bpf-next 4/5] selftests/bpf: Add re-attach test to lsm test

2021-04-14 Thread Jiri Olsa
On Tue, Apr 13, 2021 at 02:57:26PM -0700, Andrii Nakryiko wrote: > On Mon, Apr 12, 2021 at 9:31 AM Jiri Olsa wrote: > > > > Adding the test to re-attach (detach/attach again) lsm programs, > > plus check that already linked program can't be attached again. > &

[PATCHv6 bpf-next 3/4] sample/bpf: add xdp_redirect_map_multi for redirect_map broadcast test

2021-04-13 Thread Hangbin Liu
This is a sample for xdp redirect broadcast. In the sample we could forward all packets between given interfaces. There is also an option -X that could enable 2nd xdp_prog on egress interface. Signed-off-by: Hangbin Liu --- samples/bpf/Makefile | 3 + samples/bpf/xdp_redir

[PATCHv6 bpf-next 4/4] selftests/bpf: add xdp_redirect_multi test

2021-04-13 Thread Hangbin Liu
Add a bpf selftest for new helper xdp_redirect_map_multi(). In this test there are 3 forward groups and 1 exclude group. The test will redirect each interface's packets to all the interfaces in the forward group, and exclude the interface in exclude map. Two maps (DEVMAP, DEVMAP_HASH) and tw

Re: [PATCHv4 bpf-next 4/5] selftests/bpf: Add re-attach test to lsm test

2021-04-13 Thread Andrii Nakryiko
On Mon, Apr 12, 2021 at 9:31 AM Jiri Olsa wrote: > > Adding the test to re-attach (detach/attach again) lsm programs, > plus check that already linked program can't be attached again. > > Signed-off-by: Jiri Olsa > --- > .../selftests/bpf/prog_t

Re: [PATCHv4 bpf-next 3/5] selftests/bpf: Add re-attach test to fexit_test

2021-04-13 Thread Andrii Nakryiko
On Mon, Apr 12, 2021 at 9:30 AM Jiri Olsa wrote: > > Adding the test to re-attach (detach/attach again) tracing > fexit programs, plus check that already linked program can't > be attached again. > > Also switching to ASSERT* macros. > > Signed-off-by: Jiri Ols

Re: [PATCHv4 bpf-next 2/5] selftests/bpf: Add re-attach test to fentry_test

2021-04-13 Thread Andrii Nakryiko
On Mon, Apr 12, 2021 at 9:29 AM Jiri Olsa wrote: > > Adding the test to re-attach (detach/attach again) tracing > fentry programs, plus check that already linked program can't > be attached again. > > Also switching to ASSERT* macros and adding missing ';' in &

[PATCHv2 RFC bpf-next 6/7] selftests/bpf: Add ftrace probe to fentry test

2021-04-13 Thread Jiri Olsa
Adding 2 more tests for fentry probe test, to show/test ftrace probe. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/fentry_test.c | 5 - tools/testing/selftests/bpf/progs/fentry_test.c | 16 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a

[PATCHv2 RFC bpf-next 7/7] selftests/bpf: Add ftrace probe test

2021-04-13 Thread Jiri Olsa
Adding simple ftrace probe test that configures ftrace probe and verifies the 'ip' argument matches the probed functions addresses. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/ftrace_test.c| 48 +++ .../testing/selftests/bpf/progs/ftrace_test.c | 17

[PATCHv5 bpf-next 4/4] selftests/bpf: add xdp_redirect_multi test

2021-04-13 Thread Hangbin Liu
Add a bpf selftest for new helper xdp_redirect_map_multi(). In this test there are 3 forward groups and 1 exclude group. The test will redirect each interface's packets to all the interfaces in the forward group, and exclude the interface in exclude map. Two maps (DEVMAP, DEVMAP_HASH) and tw

[PATCHv5 bpf-next 3/4] sample/bpf: add xdp_redirect_map_multi for redirect_map broadcast test

2021-04-13 Thread Hangbin Liu
This is a sample for xdp redirect broadcast. In the sample we could forward all packets between given interfaces. There is also an option -X that could enable 2nd xdp_prog on egress interface. Signed-off-by: Hangbin Liu --- samples/bpf/Makefile | 3 + samples/bpf/xdp_redir

[PATCHv4 bpf-next 3/5] selftests/bpf: Add re-attach test to fexit_test

2021-04-12 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fexit programs, plus check that already linked program can't be attached again. Also switching to ASSERT* macros. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/fexit_test.c | 51 +-- 1 file change

[PATCHv4 bpf-next 4/5] selftests/bpf: Add re-attach test to lsm test

2021-04-12 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) lsm programs, plus check that already linked program can't be attached again. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/test_lsm.c | 48 +++ 1 file changed, 38 insertions(+), 10 deletions(-) diff --

[PATCHv4 bpf-next 5/5] selftests/bpf: Test that module can't be unloaded with attached trampoline

2021-04-12 Thread Jiri Olsa
Adding test to verify that once we attach module's trampoline, the module can't be unloaded. Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/module_attach.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/tools/testing/sel

[PATCHv4 bpf-next 2/5] selftests/bpf: Add re-attach test to fentry_test

2021-04-12 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fentry programs, plus check that already linked program can't be attached again. Also switching to ASSERT* macros and adding missing ';' in ASSERT_ERR_PTR macro. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_test

[PATCHv3 bpf-next 4/5] selftests/bpf: Add re-attach test to lsm test

2021-04-11 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) lsm programs, plus check that already linked program can't be attached again. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/test_lsm.c | 48 +++ 1 file changed, 38 insertions(+), 10 deletions(-) diff --

[PATCHv3 bpf-next 5/5] selftests/bpf: Test that module can't be unloaded with attached trampoline

2021-04-11 Thread Jiri Olsa
Adding test to verify that once we attach module's trampoline, the module can't be unloaded. Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/module_attach.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/tools/testing/sel

[PATCHv3 bpf-next 2/5] selftests/bpf: Add re-attach test to fentry_test

2021-04-11 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fentry programs, plus check that already linked program can't be attached again. Also switching to ASSERT* macros and adding missing ';' in ASSERT_ERR_PTR macro. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_test

[PATCHv3 bpf-next 3/5] selftests/bpf: Add re-attach test to fexit_test

2021-04-11 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fexit programs, plus check that already linked program can't be attached again. Also switching to ASSERT* macros. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/fexit_test.c | 51 +-- 1 file change

RE: [net PATCH] ixgbe: Fix NULL pointer dereference in ethtool loopback test

2021-04-09 Thread Switzer, David
>-Original Message- >From: Alexander Duyck >Sent: Monday, March 8, 2021 12:42 PM >To: intel-wired-...@lists.osuosl.org >Cc: Brandeburg, Jesse ; Nguyen, Anthony L >; netdev@vger.kernel.org >Subject: [net PATCH] ixgbe: Fix NULL pointer dereference in ethtool lo

[PATCH net-next 7/7] selftests: mlxsw: Add a trap_fwd test to devlink_trap_control

2021-04-08 Thread Petr Machata
Test that trap_fwd'd packets show up under the correct trap. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- .../drivers/net/mlxsw/devlink_trap_control.sh | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/driver

[PATCH net-next 6/7] selftests: forwarding: Add a test for TC trapping behavior

2021-04-08 Thread Petr Machata
Test that trapped packets are forwarded through the SW datapath, whereas trap_fwd'd ones are not (but are forwarded through HW datapath). For completeness' sake, also test that "pass" (i.e. lack of trapping) simply forwards the packets in the HW datapath. Signed-off-by: Petr

Re: [PATCHv2 bpf-next 5/5] selftests/bpf: Test that module can't be unloaded with attached trampoline

2021-04-08 Thread Jiri Olsa
On Wed, Apr 07, 2021 at 04:04:48PM -0700, Andrii Nakryiko wrote: > On Wed, Apr 7, 2021 at 4:22 AM Jiri Olsa wrote: > > > > Adding test to verify that once we attach module's trampoline, > > the module can't be unloaded. > > > > Signed-off-by: Jiri Olsa

Re: [PATCHv2 bpf-next 2/5] selftests/bpf: Add re-attach test to fentry_test

2021-04-08 Thread Jiri Olsa
On Wed, Apr 07, 2021 at 03:47:30PM -0700, Andrii Nakryiko wrote: > On Wed, Apr 7, 2021 at 4:21 AM Jiri Olsa wrote: > > > > Adding the test to re-attach (detach/attach again) tracing > > fentry programs, plus check that already linked program can't > > be attached

Re: [PATCHv2 bpf-next 3/5] selftests/bpf: Add re-attach test to fexit_test

2021-04-08 Thread Jiri Olsa
On Wed, Apr 07, 2021 at 03:51:46PM -0700, Andrii Nakryiko wrote: > On Wed, Apr 7, 2021 at 4:21 AM Jiri Olsa wrote: > > > > Adding the test to re-attach (detach/attach again) tracing > > fexit programs, plus check that already linked program can't > > be attached

Re: [PATCHv2 bpf-next 5/5] selftests/bpf: Test that module can't be unloaded with attached trampoline

2021-04-07 Thread Andrii Nakryiko
On Wed, Apr 7, 2021 at 4:22 AM Jiri Olsa wrote: > > Adding test to verify that once we attach module's trampoline, > the module can't be unloaded. > > Signed-off-by: Jiri Olsa > --- To be fair, to test that you are actually testing what you think you are testing,

Re: [PATCHv2 bpf-next 3/5] selftests/bpf: Add re-attach test to fexit_test

2021-04-07 Thread Andrii Nakryiko
On Wed, Apr 7, 2021 at 4:21 AM Jiri Olsa wrote: > > Adding the test to re-attach (detach/attach again) tracing > fexit programs, plus check that already linked program can't > be attached again. > > Fixing the number of check-ed results, which should be 8. >

Re: [PATCHv2 bpf-next 2/5] selftests/bpf: Add re-attach test to fentry_test

2021-04-07 Thread Andrii Nakryiko
On Wed, Apr 7, 2021 at 4:21 AM Jiri Olsa wrote: > > Adding the test to re-attach (detach/attach again) tracing > fentry programs, plus check that already linked program can't > be attached again. > > Fixing the number of check-ed results, which should be 8. >

Re: [PATCH net-next 0/8] mptcp: Cleanup, a new test case, and header trimming

2021-04-07 Thread patchwork-bot+netdevbpf
Pv4 and IPv6 addresses. > > Patch 7 adds a test case for the MPTCP netlink interface, passing a > specific ifindex to the kernel. > > [...] Here is the summary with links: - [net-next,1/8] mptcp: move flags and ifindex out of mptcp_addr_info https://git.kernel.org/netdev/net-n

[PATCH net-next 2/2] tc-testing: add simple action test to verify batch change cleanup

2021-04-07 Thread Vlad Buslov
Verify cleanup of failed actions batch change where second action in batch fails after successful init of first action. Signed-off-by: Vlad Buslov --- .../tc-testing/tc-tests/actions/simple.json | 29 +++ 1 file changed, 29 insertions(+) diff --git a/tools/testing/selftests/tc

[PATCH net-next 1/2] tc-testing: add simple action test to verify batch add cleanup

2021-04-07 Thread Vlad Buslov
Verify cleanup of failed actions batch add where second action in batch fails after successful init of first action. Signed-off-by: Vlad Buslov --- .../tc-testing/tc-tests/actions/simple.json | 30 +++ 1 file changed, 30 insertions(+) diff --git a/tools/testing/selftests/tc-te

[PATCH net-next 0/8] mptcp: Cleanup, a new test case, and header trimming

2021-04-06 Thread Mat Martineau
Some more patches to include from the MPTCP tree: Patches 1-6 refactor an address-related data structure and reduce some duplicate code that handles IPv4 and IPv6 addresses. Patch 7 adds a test case for the MPTCP netlink interface, passing a specific ifindex to the kernel. Patch 8 drops extra

[PATCHv2 bpf-next 5/5] selftests/bpf: Test that module can't be unloaded with attached trampoline

2021-04-06 Thread Jiri Olsa
Adding test to verify that once we attach module's trampoline, the module can't be unloaded. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/module_attach.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/tools/testing/selftests/bpf/prog_tests/modul

[PATCHv2 bpf-next 4/5] selftests/bpf: Add re-attach test to lsm test

2021-04-06 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) lsm programs, plus check that already linked program can't be attached again. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/test_lsm.c | 48 +++ 1 file changed, 38 insertions(+), 10 deletions(-) diff --

[PATCHv2 bpf-next 3/5] selftests/bpf: Add re-attach test to fexit_test

2021-04-06 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fexit programs, plus check that already linked program can't be attached again. Fixing the number of check-ed results, which should be 8. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/fexit_test.c

[PATCHv2 bpf-next 2/5] selftests/bpf: Add re-attach test to fentry_test

2021-04-06 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fentry programs, plus check that already linked program can't be attached again. Fixing the number of check-ed results, which should be 8. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/fentry_test.c

[PATCHv4 bpf-next 4/4] selftests/bpf: add xdp_redirect_multi test

2021-04-02 Thread Hangbin Liu
Add a bpf selftest for new helper xdp_redirect_map_multi(). In this test there are 3 forward groups and 1 exclude group. The test will redirect each interface's packets to all the interfaces in the forward group, and exclude the interface in exclude map. Two maps (DEVMAP, DEVMAP_HASH) and tw

[PATCHv4 bpf-next 3/4] sample/bpf: add xdp_redirect_map_multi for redirect_map broadcast test

2021-04-02 Thread Hangbin Liu
This is a sample for xdp redirect broadcast. In the sample we could forward all packets between given interfaces. There is also an option -X that could enable 2nd xdp_prog on egress interface. Signed-off-by: Hangbin Liu --- samples/bpf/Makefile | 3 + samples/bpf/xdp_redir

[PATCH RFC 3/4] tc-testing: add simple action test to verify batch add cleanup

2021-03-31 Thread Vlad Buslov
Verify cleanup of failed actions batch add where second action in batch fails after successful init of first action. Signed-off-by: Vlad Buslov --- .../tc-testing/tc-tests/actions/simple.json | 30 +++ 1 file changed, 30 insertions(+) diff --git a/tools/testing/selftests/tc-te

[PATCH RFC 4/4] tc-testing: add simple action test to verify batch change cleanup

2021-03-31 Thread Vlad Buslov
Verify cleanup of failed actions batch change where second action in batch fails after successful init of first action. Signed-off-by: Vlad Buslov --- .../tc-testing/tc-tests/actions/simple.json | 29 +++ 1 file changed, 29 insertions(+) diff --git a/tools/testing/selftests/tc

[Patch bpf-next v8 16/16] selftests/bpf: add a test case for loading BPF_SK_SKB_VERDICT

2021-03-30 Thread Cong Wang
From: Cong Wang This adds a test case to ensure BPF_SK_SKB_VERDICT and BPF_SK_STREAM_VERDICT will never be attached at the same time. Cc: John Fastabend Cc: Daniel Borkmann Cc: Jakub Sitnicki Cc: Lorenz Bauer Signed-off-by: Cong Wang --- .../selftests/bpf/prog_tests/sockmap_basic.c | 40

[Patch bpf-next v8 15/16] selftests/bpf: add a test case for udp sockmap

2021-03-30 Thread Cong Wang
From: Cong Wang Add a test case to ensure redirection between two UDP sockets work. Cc: John Fastabend Cc: Daniel Borkmann Cc: Jakub Sitnicki Cc: Lorenz Bauer Signed-off-by: Cong Wang --- .../selftests/bpf/prog_tests/sockmap_listen.c | 136 ++ .../selftests/bpf/progs

Re: [PATCH net-next] tc-testing: add simple action change test

2021-03-30 Thread patchwork-bot+netdevbpf
reference counting to ensure that the case when netlink message has > NLM_F_REPLACE flag set but action with specified index doesn't exist is > handled correctly. > > Signed-off-by: Vlad Buslov > > [...] Here is the summary with links: - [net-next] tc-testin

Re: [RFC PATCH bpf-next 2/4] selftests/bpf: Add re-attach test to fentry_test

2021-03-30 Thread Jiri Olsa
On Tue, Mar 30, 2021 at 01:23:15AM +, Song Liu wrote: > > > > On Mar 28, 2021, at 4:26 AM, Jiri Olsa wrote: > > > > Adding the test to re-attach (detach/attach again) tracing > > fentry programs, plus check that already linked program can't > > be a

Re: ❌ FAIL: Test report for kernel 5.10.0-rc6 (mainline.kernel.org)

2021-03-30 Thread Eric Dumazet
On 12/10/20 9:35 AM, Vlad Buslov wrote: > On Thu 10 Dec 2020 at 00:22, Jakub Kicinski wrote: >> On Wed, 9 Dec 2020 22:54:40 +0200 Vlad Buslov wrote: Yes, I think the patch I sent should fix this, ETH_P_ARP should not be dropped ;) I am testing this before offical patch submi

[PATCH net-next] tc-testing: add simple action change test

2021-03-30 Thread Vlad Buslov
Use act_simple to verify that action created with 'tc actions change' command exists after command returns. The goal is to verify internal action API reference counting to ensure that the case when netlink message has NLM_F_REPLACE flag set but action with specified index doesn't exist is handled c

Re: [RFC PATCH bpf-next 4/4] selftests/bpf: Test that module can't be unloaded with attached trampoline

2021-03-29 Thread Song Liu
> On Mar 28, 2021, at 4:26 AM, Jiri Olsa wrote: > > Adding test to verify that once we attach module's trampoline, > the module can't be unloaded. > > Signed-off-by: Jiri Olsa Acked-by: Song Liu [...]

[PATCH net-next 3/3] selftests: ethtool: add a netdevsim FEC test

2021-03-29 Thread Jakub Kicinski
Test FEC settings, iterate over configs. Signed-off-by: Jakub Kicinski --- .../drivers/net/netdevsim/ethtool-common.sh | 5 +- .../drivers/net/netdevsim/ethtool-fec.sh | 110 ++ 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100755 tools/testing

Re: [RFC PATCH bpf-next 2/4] selftests/bpf: Add re-attach test to fentry_test

2021-03-29 Thread Song Liu
> On Mar 28, 2021, at 4:26 AM, Jiri Olsa wrote: > > Adding the test to re-attach (detach/attach again) tracing > fentry programs, plus check that already linked program can't > be attached again. > > Fixing the number of check-ed results, which should be 8. >

[PATCH v5 bpf-next 14/17] selftests: xsk: implement bpf_link test

2021-03-29 Thread Maciej Fijalkowski
Introduce a test that is supposed to verify the persistence of BPF resources based on underlying bpf_link usage. Test will: 1) create and bind two sockets on queue ids 0 and 1 2) run a traffic on queue ids 0 3) remove xsk sockets from queue 0 on both veth interfaces 4) run a traffic on queues ids

[PATCH v5 bpf-next 11/17] selftests: xsk: refactor teardown/bidi test cases and testapp_validate

2021-03-29 Thread Maciej Fijalkowski
Currently, there is a testapp_sockets() that acts like a wrapper around testapp_validate() and it is called for bidi and teardown test types. Other test types call testapp_validate() directly. Split testapp_sockets() onto two separate functions so a bunch of bidi specific logic can be moved there

[PATCH v5 bpf-next 01/17] selftests: xsk: don't call worker_pkt_dump() for stats test

2021-03-29 Thread Maciej Fijalkowski
For TEST_TYPE_STATS, worker_pkt_validate() that places frames onto pkt_buf is not called. Therefore, when dump mode is set, don't call worker_pkt_dump() for mentioned test type, so that it won't crash on pkt_buf() access. Signed-off-by: Maciej Fijalkowski --- tools/testing/sel

[PATCH net-next 4/6] selftests: mlxsw: Test matchall failure with protocol match

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel The driver can only offload matchall rules that do not match on a protocol. Test that matchall rules that match on a protocol are vetoed. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- .../drivers/net/mlxsw/tc_restrictions.sh| 17 + 1 file

[PATCH net-next 6/6] selftests: mlxsw: Test vetoing of double sampling

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Test that two sampling rules cannot be configured on the same port with the same trigger. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko --- .../selftests/drivers/net/mlxsw/tc_sample.sh | 30 +++ 1 file changed, 30 insertions(+) diff --git a/tools

Re: [PATCH net 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases

2021-03-29 Thread Toke Høiland-Jørgensen
Ido Schimmel writes: > From: Ido Schimmel > > Test that all possible combinations of inner and outer ECN bits result > in the correct inner ECN marking according to RFC 6040 4.2. > > Signed-off-by: Ido Schimmel > Reviewed-by: Petr Machata Acked-by: Toke Høiland-Jørgensen

[PATCH net mlxsw v2 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Test that all possible combinations of inner and outer ECN bits result in the correct inner ECN marking according to RFC 6040 4.2. Signed-off-by: Ido Schimmel --- .../selftests/net/forwarding/vxlan_bridge_1d.sh | 13 - 1 file changed, 12 insertions(+), 1

[PATCH net 2/2] selftests: forwarding: vxlan_bridge_1d: Add more ECN decap test cases

2021-03-29 Thread Ido Schimmel
From: Ido Schimmel Test that all possible combinations of inner and outer ECN bits result in the correct inner ECN marking according to RFC 6040 4.2. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- .../selftests/net/forwarding/vxlan_bridge_1d.sh | 13 - 1 file

[Patch bpf-next v7 13/13] selftests/bpf: add a test case for udp sockmap

2021-03-28 Thread Cong Wang
From: Cong Wang Add a test case to ensure redirection between two UDP sockets work. Cc: John Fastabend Cc: Daniel Borkmann Cc: Jakub Sitnicki Cc: Lorenz Bauer Signed-off-by: Cong Wang --- .../selftests/bpf/prog_tests/sockmap_listen.c | 136 ++ .../selftests/bpf/progs

[RFC PATCH bpf-next 2/4] selftests/bpf: Add re-attach test to fentry_test

2021-03-28 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fentry programs, plus check that already linked program can't be attached again. Fixing the number of check-ed results, which should be 8. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/fentry_test.c

[RFC PATCH bpf-next 4/4] selftests/bpf: Test that module can't be unloaded with attached trampoline

2021-03-28 Thread Jiri Olsa
Adding test to verify that once we attach module's trampoline, the module can't be unloaded. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/module_attach.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/tools/testing/selftests/bpf/prog_tests/modul

[RFC PATCH bpf-next 3/4] selftests/bpf: Add re-attach test to fexit_test

2021-03-28 Thread Jiri Olsa
Adding the test to re-attach (detach/attach again) tracing fexit programs, plus check that already linked program can't be attached again. Fixing the number of check-ed results, which should be 8. Signed-off-by: Jiri Olsa --- .../selftests/bpf/prog_tests/fexit_test.c

[PATCH v4 bpf-next 11/17] selftests: xsk: refactor teardown/bidi test cases and testapp_validate

2021-03-26 Thread Maciej Fijalkowski
Currently, there is a testapp_sockets() that acts like a wrapper around testapp_validate() and it is called for bidi and teardown test types. Other test types call testapp_validate() directly. Split testapp_sockets() onto two separate functions so a bunch of bidi specific logic can be moved there

[PATCH v4 bpf-next 14/17] selftests: xsk: implement bpf_link test

2021-03-26 Thread Maciej Fijalkowski
Introduce a test that is supposed to verify the persistence of BPF resources based on underlying bpf_link usage. Test will: 1) create and bind two sockets on queue ids 0 and 1 2) run a traffic on queue ids 0 3) remove xsk sockets from queue 0 on both veth interfaces 4) run a traffic on queues ids

[PATCH v4 bpf-next 01/17] selftests: xsk: don't call worker_pkt_dump() for stats test

2021-03-26 Thread Maciej Fijalkowski
For TEST_TYPE_STATS, worker_pkt_validate() that places frames onto pkt_buf is not called. Therefore, when dump mode is set, don't call worker_pkt_dump() for mentioned test type, so that it won't crash on pkt_buf() access. Signed-off-by: Maciej Fijalkowski --- tools/testing/sel

Re: [PATCH bpf v2 2/2] bpf/selftests: test that kernel rejects a TCP CC with an invalid license

2021-03-26 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: >> Ah, thanks! I always get confused about CHECK() as well! Maybe it should >> be renamed to ASSERT()? But that would require flipping all the if() >> statements around them as well :/ > > Exactly, it's the opposite of assert (ASSERT_NOT %-), that > CHECK(!found) is "asse

Re: [PATCH bpf v2 2/2] bpf/selftests: test that kernel rejects a TCP CC with an invalid license

2021-03-26 Thread Andrii Nakryiko
-- Andrii On Fri, Mar 26, 2021 at 2:43 AM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > On Thu, Mar 25, 2021 at 2:11 PM Toke Høiland-Jørgensen > > wrote: > >> > >> This adds a selftest to check that the verifier rejects a TCP CC struct_ops > >> with a non-GPL license. > >> >

[PATCH bpf v3 2/2] bpf/selftests: test that kernel rejects a TCP CC with an invalid license

2021-03-26 Thread Toke Høiland-Jørgensen
This adds a selftest to check that the verifier rejects a TCP CC struct_ops with a non-GPL license. v3: - Rename prog to bpf_tcp_nogpl - Use ASSERT macros instead of CHECK - Skip unneeded initialisation, unconditionally close skeleton v2: - Use a minimal struct_ops BPF program instead of rewriting

Re: [PATCH bpf v2 2/2] bpf/selftests: test that kernel rejects a TCP CC with an invalid license

2021-03-26 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Thu, Mar 25, 2021 at 2:11 PM Toke Høiland-Jørgensen > wrote: >> >> This adds a selftest to check that the verifier rejects a TCP CC struct_ops >> with a non-GPL license. >> >> v2: >> - Use a minimal struct_ops BPF program instead of rewriting bpf_dctcp's >> licens

  1   2   3   4   5   6   7   8   9   10   >