Re: [PATCH bpf-next 16/18] selftests/bpf: add checks for bpf_wq_set_callback()

2024-04-17 Thread Song Liu
On Tue, Apr 16, 2024 at 7:11 AM Benjamin Tissoires wrote: [...] > +SEC("?tc") > +__log_level(2) > +__failure > +/* check that the first argument of bpf_wq_set_callback() > + * is a correct bpf_wq pointer. > + */ > +__msg("mark_precise: frame0: regs=r1 stack= before") This line and some other "ma

Re: [PATCH net] selftests: kselftest_harness: fix Clang warning about zero-length format

2024-04-17 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Tue, 16 Apr 2024 08:10:48 -0700 you wrote: > Apparently it's more legal to pass the format as NULL, than > it is to use an empty string. Clang complains about empty > formats: > > ./../kselftest_harness.h:1207:30: warn

Re: [PATCH] selftests: adopt BPF's approach to quieter builds

2024-04-17 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Thu, 11 Apr 2024 12:05:34 -0700 you wrote: > selftest build is fairly noisy, it's easy to miss warnings. > It's standard practice to add alternative messages in > the Makefile. I was grepping for existing solutions

Re: [PATCH net-next] selftests: openvswitch: Fix escape chars in regexp.

2024-04-17 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Tue, 16 Apr 2024 11:09:13 +0200 you wrote: > Character sequences starting with `\` are interpreted by python as > escaped Unicode characters. However, they have other meaning in > regular expressions (e.g: "\d"). >

Re: [PATCH v2 bpf-next 4/6] selftests/bpf: Add IPv4 and IPv6 sockaddr test cases

2024-04-17 Thread Martin KaFai Lau
On 4/17/24 10:08 AM, Jordan Rife wrote: Can the test_sock_addr.{c,sh} be retired after this patch? I know it's not used in the BPF CI tests, but is it still used in any other contexts? If anyone depends on the test_sock_addr binary, it will have to start using "./test_progs -t sock_addr". T

Re: [PATCH bpf-next v4 09/14] selftests/bpf: Use log_err in network_helpers

2024-04-17 Thread Martin KaFai Lau
On 4/16/24 3:13 AM, 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, then uses ASSERT_OK_PTR() to check the return values of all open_netns(). Signed-off-by: Geliang Ta

Re: [PATCH bpf-next v4 06/14] selftests/bpf: Use connect_to_addr in sk_assign

2024-04-17 Thread Martin KaFai Lau
On 4/16/24 3:13 AM, Geliang Tang wrote: 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 that sets SO_SNDTIMEO timeout as

Re: [PATCH bpf-next v4 02/14] selftests/bpf: Add start_server_addr* helpers

2024-04-17 Thread Martin KaFai Lau
On 4/16/24 3:13 AM, Geliang Tang wrote: From: Geliang Tang In order to pair up with connect_to_addr(), this patch adds a new helper start_server_addr(), and another one start_server_addr_opts(), which is a wrapper of __start_server(), only added a network_helper_opts arg at the end. They all a

[PATCH net-next v3 8/8] selftests: drv-net: add a TCP ping test case (and useful helpers)

2024-04-17 Thread Jakub Kicinski
More complex tests often have to spawn a background process, like a server which will respond to requests or tcpdump. Add support for creating such processes using the with keyword: with bkg("my-daemon", ..): # my-daemon is alive in this block My initial thought was to add this support to

[PATCH net-next v3 7/8] selftests: net: support matching cases by name prefix

2024-04-17 Thread Jakub Kicinski
While writing tests with a lot more cases I got tired of having to jump back and forth to add the name of the test to the ksft_run() list. Most unittest frameworks do some name matching, e.g. assume that functions with names starting with test_ are test cases. Support similar flow in ksft_run(). L

[PATCH net-next v3 6/8] selftests: drv-net: add a trivial ping test

2024-04-17 Thread Jakub Kicinski
Add a very simple test for testing with a remote system. Both IPv4 and IPv6 connectivity is optional so tests will XFail is env doesn't define an address for the given family. Using netdevsim: $ ./run_kselftest.sh -t drivers/net:ping.py TAP version 13 1..1 # timeout set to 45 # selftests: dr

[PATCH net-next v3 5/8] selftests: drv-net: construct environment for running tests which require an endpoint

2024-04-17 Thread Jakub Kicinski
Nothing surprising here, hopefully. Wrap the variables from the environment into a class or spawn a netdevsim based env and pass it to the tests. Signed-off-by: Jakub Kicinski --- .../testing/selftests/drivers/net/README.rst | 33 +++ .../selftests/drivers/net/lib/py/env.py | 98 +

[PATCH net-next v3 4/8] selftests: drv-net: factor out parsing of the env

2024-04-17 Thread Jakub Kicinski
The tests with a remote end will use a different class, for clarity, but will also need to parse the env. So factor parsing the env out to a function. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 43 +++ 1 file changed, 26 insertions(+), 17 de

[PATCH net-next v3 3/8] selftests: drv-net: define endpoint structures

2024-04-17 Thread Jakub Kicinski
Define the remote endpoint "model". To execute most meaningful device driver tests we need to be able to communicate with a remote system, and have it send traffic to the device under test. Various test environments will have different requirements. 0) "Local" netdevsim-based testing can simply u

[PATCH net-next v3 2/8] selftests: net: set the exit code correctly in Python tests

2024-04-17 Thread Jakub Kicinski
Test cases need to exit with non-zero status if they failed, we currently don't do that: # KTAP version 1 # 1..3 # # At /root/ksft-net-drv/drivers/net/./ping.py line 18: # # Check failed 1 != 2 # not ok 1 ping.test_v4 # ok 2 ping.test_v6 # ok 3 ping.test_tcp # # Totals: pass:2 fail

[PATCH net-next v3 0/8] selftests: drv-net: support testing with a remote system

2024-04-17 Thread Jakub Kicinski
Hi! Implement support for tests which require access to a remote system / endpoint which can generate traffic. This series concludes the "groundwork" for upstream driver tests. I wanted to support the three models which came up in discussions: - SW testing with netdevsim - "local" testing with

[PATCH net-next v3 1/8] selftests: net: fix counting totals when some checks fail

2024-04-17 Thread Jakub Kicinski
Totals currently only pay attention to exceptions, if check fails (say ksft_eq()) the test case will be counted as pass: # At /ksft/drivers/net/./ping.py line 18: # Check failed 1 != 2 not ok 1 ping.test_v4 ok 2 ping.test_v6 ok 3 ping.test_tcp # Totals: pass:3 fail:0 xfail:0 xpass:0 sk

Re: [PATCH v2 02/17] dt-bindings: riscv: Add xtheadvector ISA extension description

2024-04-17 Thread Charlie Jenkins
On Tue, Apr 16, 2024 at 10:10:39PM +0100, Conor Dooley wrote: > On Tue, Apr 16, 2024 at 01:43:06PM -0700, Charlie Jenkins wrote: > > On Tue, Apr 16, 2024 at 04:16:30PM +0100, Conor Dooley wrote: > > > On Mon, Apr 15, 2024 at 09:11:59PM -0700, Charlie Jenkins wrote: > > > > The xtheadvector ISA exte

Re: [RFC PATCH v5 09/29] KVM: selftests: TDX: Add report_fatal_error test

2024-04-17 Thread Yan Zhao
On Tue, Apr 16, 2024 at 11:50:19AM -0700, Sean Christopherson wrote: > On Mon, Apr 15, 2024, Yan Zhao wrote: > > On Mon, Apr 15, 2024 at 08:05:49AM +, Ackerley Tng wrote: > > > >> The Intel GHCI Spec says in R12, bit 63 is set if the GPA is valid. As > > > >> a > > > > But above "__LINE__" is

Re: [PATCH net 0/4] selftests/net/tcp_ao: A bunch of fixes for TCP-AO selftests

2024-04-17 Thread Dmitry Safonov
On Wed, 17 Apr 2024 at 22:28, Jakub Kicinski wrote: > > On Wed, 17 Apr 2024 13:46:36 -0700 Jakub Kicinski wrote: > > > I can spend some time on them after I verify that my fix for -stable > > > is actually fixing an issue I think it fixes. > > > Seems like your automation + my selftests are giving

Re: [PATCH 02/19] riscv: cpufeature: Fix thead vector hwcap removal

2024-04-17 Thread Charlie Jenkins
On Wed, Apr 17, 2024 at 09:02:05AM -0700, Evan Green wrote: > On Tue, Apr 16, 2024 at 9:25 PM Charlie Jenkins wrote: > > > > On Tue, Apr 16, 2024 at 08:36:33AM +0100, Conor Dooley wrote: > > > On Mon, Apr 15, 2024 at 08:34:05PM -0700, Charlie Jenkins wrote: > > > > On Sat, Apr 13, 2024 at 12:40:26

Re: [PATCH v2 13/17] riscv: vector: Support xtheadvector save/restore

2024-04-17 Thread Charlie Jenkins
On Wed, Apr 17, 2024 at 03:50:24PM +0100, Conor Dooley wrote: > On Mon, Apr 15, 2024 at 09:12:10PM -0700, Charlie Jenkins wrote: > > > diff --git a/arch/riscv/kernel/vector.c b/arch/riscv/kernel/vector.c > > index 6727d1d3b8f2..f42eaa8178e9 100644 > > --- a/arch/riscv/kernel/vector.c > > +++ b/arc

Re: [PATCH net 0/4] selftests/net/tcp_ao: A bunch of fixes for TCP-AO selftests

2024-04-17 Thread Jakub Kicinski
On Wed, 17 Apr 2024 13:46:36 -0700 Jakub Kicinski wrote: > > I can spend some time on them after I verify that my fix for -stable > > is actually fixing an issue I think it fixes. > > Seems like your automation + my selftests are giving some fruits, hehe. > > Oh, very interesting, I don't recall

Re: [PATCH net 0/4] selftests/net/tcp_ao: A bunch of fixes for TCP-AO selftests

2024-04-17 Thread Jakub Kicinski
On Wed, 17 Apr 2024 19:47:18 +0100 Dmitry Safonov wrote: > 1. [ 240.001391][ T833] Possible interrupt unsafe locking scenario: > [ 240.001391][ T833] > [ 240.001635][ T833]CPU0CPU1 > [ 240.001797][ T833] > [ 240.001958][ T833]

Re: [PATCH v4 02/27] ntsync: Introduce NTSYNC_IOC_WAIT_ALL.

2024-04-17 Thread Elizabeth Figura
On Wednesday, 17 April 2024 06:37:03 CDT Peter Zijlstra wrote: > On Mon, Apr 15, 2024 at 08:08:12PM -0500, Elizabeth Figura wrote: > > + if (atomic_read(&sem->all_hint) > 0) { > > + spin_lock(&dev->wait_all_lock); > > + spin_lock_nest_lock(&sem->lock, &dev->wait_all_lock); > >

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-17 Thread Elizabeth Figura
On Wednesday, 17 April 2024 05:01:32 CDT Peter Zijlstra wrote: > > > > === > > NT synchronization primitive driver > > === > > > > This page documents the user-space API for the ntsync driver. > > > > ntsync is a support driver for

[PATCH] selftests: filesystems: fix warn_unused_result build warnings

2024-04-17 Thread Amer Al Shanawany
Fix the following warnings by adding return check and error messages. statmount_test.c: In function ‘cleanup_namespace’: statmount_test.c:128:9: warning: ignoring return value of ‘fchdir’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 128 | fchdir(orig_root); |

Re: [PATCH net 0/4] selftests/net/tcp_ao: A bunch of fixes for TCP-AO selftests

2024-04-17 Thread Dmitry Safonov
On Tue, 16 Apr 2024 at 15:28, Jakub Kicinski wrote: > > On Sat, 13 Apr 2024 02:42:51 +0100 Dmitry Safonov via B4 Relay wrote: > > Started as addressing the flakiness issues in rst_ipv*, that affect > > netdev dashboard. > > Thank you! :) Jakub, you are very welcome :) I'll keep an eye on the dash

Re: [PATCH v2 bpf-next 4/6] selftests/bpf: Add IPv4 and IPv6 sockaddr test cases

2024-04-17 Thread Jordan Rife
> I would like to take this chance to simplify the setup. > > Does it need a veth pair? The %s2 interface is not used. > > Can it be done in lo alone? I will look into this for the next spin of the patch series. > Also, all this setup (and test) has to be done in a new netns. Anything > blocking

Re: [PATCH v4 02/14] security: Introduce the digest_cache LSM

2024-04-17 Thread Roberto Sassu
On 4/16/2024 4:33 PM, Jarkko Sakkinen wrote: On Tue Apr 16, 2024 at 10:09 AM EEST, Roberto Sassu wrote: On Mon, 2024-04-15 at 22:31 +0300, Jarkko Sakkinen wrote: On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: From: Roberto Sassu Introduce the digest_cache LSM, to collect digests f

Re: [PATCH v2 bpf-next 2/6] selftests/bpf: Implement socket kfuncs for bpf_testmod

2024-04-17 Thread Jordan Rife
Martin, Thank you for the detailed feedback. > Can a separate global lock/mutex (not the lock_sock) be acquired first before > using the sock pointer in the kfuncs? Sure. I will add the mutex around the socket operations. As for the single global sock pointer, I wanted to keep it simple in this

[PATCH] selftests: filesystems: add missing stddef header

2024-04-17 Thread Amer Al Shanawany
fix compiler warning and errors when compiling statmount test. Signed-off-by: Amer Al Shanawany --- tools/testing/selftests/filesystems/statmount/statmount_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/filesystems/statmount/statmount_test.c b/tools/testing/s

[PATCH] selftests: Fix asan linkage to work with clang

2024-04-17 Thread Ryan Roberts
Both fchmodat2 and openat2 statically link against libasan (for explanation of why, look at the fixes commit). This is done using `-static-libasan`. However, it turns out that clang uses a different option, `-static-libsan`. This caused clang to fail to compile the tests. Fix this by using cc-opti

Re: [PATCH 02/19] riscv: cpufeature: Fix thead vector hwcap removal

2024-04-17 Thread Evan Green
On Tue, Apr 16, 2024 at 9:25 PM Charlie Jenkins wrote: > > On Tue, Apr 16, 2024 at 08:36:33AM +0100, Conor Dooley wrote: > > On Mon, Apr 15, 2024 at 08:34:05PM -0700, Charlie Jenkins wrote: > > > On Sat, Apr 13, 2024 at 12:40:26AM +0100, Conor Dooley wrote: > > > > On Fri, Apr 12, 2024 at 02:31:42

[PATCH] selftests: Make ksft_exit functions return void instead of int

2024-04-17 Thread Nathan Chancellor
Commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn") marked functions that call exit() as __noreturn but it did not change the return type of these functions from 'void' to 'int' like it should have (since a noreturn function by definition cann

tools/testing/selftests/clone3/clone3_set_tid.c appears to always pass?

2024-04-17 Thread Nathan Chancellor
Hi Christian, I am looking at tools/testing/selftests/clone3/clone3_set_tid.c as part of a patch to clean up the uses of 'return ksft_exit_...();' throughout the selftests (as they call exit() so they do not return) and I noticed that it seems to always pass even when there may have been an error?

Re: [PATCH net-next] selftests: openvswitch: Fix escape chars in regexp.

2024-04-17 Thread Aaron Conole
Adrian Moreno writes: > Character sequences starting with `\` are interpreted by python as > escaped Unicode characters. However, they have other meaning in > regular expressions (e.g: "\d"). > > It seems Python >= 3.12 starts emitting a SyntaxWarning when these > escaped sequences are not recogn

Re: [PATCH v2 13/17] riscv: vector: Support xtheadvector save/restore

2024-04-17 Thread Conor Dooley
On Mon, Apr 15, 2024 at 09:12:10PM -0700, Charlie Jenkins wrote: > diff --git a/arch/riscv/kernel/vector.c b/arch/riscv/kernel/vector.c > index 6727d1d3b8f2..f42eaa8178e9 100644 > --- a/arch/riscv/kernel/vector.c > +++ b/arch/riscv/kernel/vector.c > @@ -33,10 +33,24 @@ int riscv_v_setup_vsize(void

Re: [PATCH net-next v7 3/3] selftests/net: add flush id selftests

2024-04-17 Thread Richard Gobert
Willem de Bruijn wrote: > Richard Gobert wrote: >> Added flush id selftests to test different cases where DF flag is set or >> unset and id value changes in the following packets. All cases where the >> packets should coalesce or should not coalesce are tested. >> >> Signed-off-by: Richard Gobert

Re: [PATCH net-next v7 1/3] net: gro: add {inner_}network_offset to napi_gro_cb

2024-04-17 Thread Richard Gobert
Willem de Bruijn wrote: > Richard Gobert wrote: >> This patch adds network_offset and inner_network_offset to napi_gro_cb, and >> makes sure both are set correctly. In the common path there's only one >> write (skb_gro_reset_offset). >> >> Signed-off-by: Richard Gobert >> --- >> drivers/net/genev

Re: [PATCH v2 06/17] riscv: Extend cpufeature.c to detect vendor extensions

2024-04-17 Thread Conor Dooley
On Mon, Apr 15, 2024 at 09:12:03PM -0700, Charlie Jenkins wrote: > @@ -351,6 +343,14 @@ static void __init riscv_parse_isa_string(unsigned long > *this_hwcap, struct risc > bool ext_long = false, ext_err = false; > > switch (*ext) { > + case 'x': > +

Re: [PATCH v2 00/17] riscv: Support vendor extensions and xtheadvector

2024-04-17 Thread Conor Dooley
On Mon, Apr 15, 2024 at 09:11:57PM -0700, Charlie Jenkins wrote: > This patch series ended up much larger than expected, please bear with > me! The goal here is to support vendor extensions, starting at probing > the device tree and ending with reporting to userspace. btw, patches 7 to 13 (inclusi

Re: [PATCH 07/10] riscv: add ISA extension parsing for Zcmop

2024-04-17 Thread Conor Dooley
On Tue, Apr 16, 2024 at 05:23:51PM +0200, Clément Léger wrote: > > > On 16/04/2024 16:54, Conor Dooley wrote: > > On Mon, Apr 15, 2024 at 11:10:24AM +0200, Clément Léger wrote: > >> > >> > >> On 11/04/2024 13:53, Conor Dooley wrote: > >>> On Thu, Apr 11, 2024 at 11:08:21AM +0200, Clément Léger wr

Re: [PATCH v4 02/27] ntsync: Introduce NTSYNC_IOC_WAIT_ALL.

2024-04-17 Thread Peter Zijlstra
On Mon, Apr 15, 2024 at 08:08:12PM -0500, Elizabeth Figura wrote: > + if (atomic_read(&sem->all_hint) > 0) { > + spin_lock(&dev->wait_all_lock); > + spin_lock_nest_lock(&sem->lock, &dev->wait_all_lock); > > + prev_count = sem->u.sem.count; > + r

Re: [PATCH v4 00/30] NT synchronization primitive driver

2024-04-17 Thread Peter Zijlstra
On Wed, Apr 17, 2024 at 01:05:47AM -0500, Elizabeth Figura wrote: > Here's a (slightly ad-hoc) simplification of the patch into text form inlined > into this message; hopefully it's readable enough. Thanks! Still needed: s/\`\`/"/g s/\.\.\ //g But then it's readable > > ==

[PATCH] selftests: mm: Fix undeclared function error

2024-04-17 Thread Muhammad Usama Anjum
Fix the error reported by clang: In file included from mdwe_test.c:17: ./../kselftest_harness.h:1169:2: error: call to undeclared function 'asprintf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1169 | asprintf(&test_name, "%s%s%s.%s",

[PATCH] selftests/intel_pstate: Add validity check for cpu min/max frequency

2024-04-17 Thread Yujie Liu
If libcpupower is not properly installed somehow, the cpupower tool cannot work, and cpu min_freq and max_freq are not correctly assigned, but the code can still keep going and gives an "ok" result at last, which seems not to be the expected behavior of this test. tools/testing/selftests/intel

kselftest/next kselftest-livepatch: 1 runs, 1 regressions (v6.9-rc4-19-g00ab560eb0e3)

2024-04-17 Thread kernelci.org bot
kselftest/next kselftest-livepatch: 1 runs, 1 regressions (v6.9-rc4-19-g00ab560eb0e3) Regressions Summary --- platform| arch | lab | compiler | defconfig | regressions +--+---+--+---

kselftest/next kselftest-lkdtm: 2 runs, 2 regressions (v6.9-rc4-19-g00ab560eb0e3)

2024-04-17 Thread kernelci.org bot
kselftest/next kselftest-lkdtm: 2 runs, 2 regressions (v6.9-rc4-19-g00ab560eb0e3) Regressions Summary --- platform| arch | lab | compiler | defconfig | regressions +--+---+--+---