Re: Converting kselftest test modules to kunit

2024-07-29 Thread David Gow
On Sat, 27 Jul 2024 at 03:35, Shuah Khan wrote: > > On 7/15/24 04:09, Muhammad Usama Anjum wrote: > > Hi Kees and All, > > > > There are several tests in kselftest subsystem which load modules to tests > > the internals of the kernel. Most of these test modules are just loaded by > > the kselftest

Re: [RFC PATCH v1 0/4] Add support for the Bus Lock Threshold

2024-07-29 Thread Manali Shukla
On 7/9/2024 11:21 PM, Manali Shukla wrote: > Malicious guests can cause bus locks to degrade the performance of a > system. Non-WB (write-back) and misaligned locked RMW > (read-modify-write) instructions are referred to as "bus locks" and > require system wide synchronization among all processors

Re: [PATCH v5 2/5] cgroup/pids: Make event counters hierarchical

2024-07-29 Thread Xiu Jianfeng
On 2024/7/25 17:38, Michal Koutný wrote: > Hello Jianfeng. > > On Tue, Jul 16, 2024 at 11:27:39AM GMT, xiujianfeng > wrote: >> On 2024/7/3 14:59, xiujianfeng wrote: > ... >>> for (; parent_pids(p); p = parent_pids(p)) { >>> if (p == pids_over_limit) { >>>

Re: [PATCH v2 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-29 Thread kernel test robot
Hi Ivan, kernel test robot noticed the following build warnings: [auto build test WARNING on tiwai-sound/for-next] [also build test WARNING on tiwai-sound/for-linus linus/master v6.11-rc1 next-20240729] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting

Re: [PATCH v6 1/2] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-29 Thread Johannes Weiner
On Mon, Jul 29, 2024 at 10:37:42AM -0400, David Finkel wrote: > Other mechanisms for querying the peak memory usage of either a process > or v1 memory cgroup allow for resetting the high watermark. Restore > parity with those mechanisms, but with a less racy API. > > For example: > - Any write to

[PATCH net-next v17 14/14] netdev: add dmabuf introspection

2024-07-29 Thread Mina Almasry
Add dmabuf information to page_pool stats: $ ./cli.py --spec ../netlink/specs/netdev.yaml --dump page-pool-get ... {'dmabuf': 10, 'id': 456, 'ifindex': 3, 'inflight': 1023, 'inflight-mem': 4190208}, {'dmabuf': 10, 'id': 455, 'ifindex': 3, 'inflight': 1023, 'inflight-mem': 4190208

[PATCH net-next v17 13/14] selftests: add ncdevmem, netcat for devmem TCP

2024-07-29 Thread Mina Almasry
ncdevmem is a devmem TCP netcat. It works similarly to netcat, but it sends and receives data using the devmem TCP APIs. It uses udmabuf as the dmabuf provider. It is compatible with a regular netcat running on a peer, or a ncdevmem running on a peer. In addition to normal netcat support, ncdevmem

[PATCH net-next v17 12/14] net: add devmem TCP documentation

2024-07-29 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry Reviewed-by: Bagas Sanjaya Reviewed-by: Donald Hunter --- v16: - Add documentation on unbinding the NIC from dmabuf (Donald). - Add note that any dmabuf should work (Donald). v9: https://lore.kernel

[PATCH net-next v17 11/14] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-07-29 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry Reviewe

[PATCH net-next v17 10/14] tcp: RX path for devmem TCP

2024-07-29 Thread Mina Almasry
In tcp_recvmsg_locked(), detect if the skb being received by the user is a devmem skb. In this case - if the user provided the MSG_SOCK_DEVMEM flag - pass it to tcp_recvmsg_devmem() for custom handling. tcp_recvmsg_devmem() copies any data in the skb header to the linear buffer, and returns a cmsg

[PATCH net-next v17 09/14] net: add support for skbs with unreadable frags

2024-07-29 Thread Mina Almasry
For device memory TCP, we expect the skb headers to be available in host memory for access, and we expect the skb frags to be in device memory and unaccessible to the host. We expect there to be no mixing and matching of device memory frags (unaccessible) with host memory frags (accessible) in the

[PATCH net-next v17 08/14] net: support non paged skb frags

2024-07-29 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry Reviewed-by: Eric Dumazet --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return section

[PATCH net-next v17 07/14] memory-provider: dmabuf devmem memory provider

2024-07-29 Thread Mina Almasry
Implement a memory provider that allocates dmabuf devmem in the form of net_iov. The provider receives a reference to the struct netdev_dmabuf_binding via the pool->mp_priv pointer. The driver needs to set this pointer for the provider in the net_iov. The provider obtains a reference on the netde

[PATCH net-next v17 06/14] page_pool: devmem support

2024-07-29 Thread Mina Almasry
Convert netmem to be a union of struct page and struct netmem. Overload the LSB of struct netmem* to indicate that it's a net_iov, otherwise it's a page. Currently these entries in struct page are rented by the page_pool and used exclusively by the net stack: struct { unsigned long pp_mag

[PATCH net-next v17 05/14] page_pool: move dmaddr helpers to .c file

2024-07-29 Thread Mina Almasry
These helpers are used for setup and init of buffers, and their implementation need not be static inline in the header file. Moving the implementation to the .c file allows us to hide netmem implementation details in internal header files rather than the public file. Signed-off-by: Mina Almasry

[PATCH net-next v17 04/14] netdev: netdevice devmem allocator

2024-07-29 Thread Mina Almasry
Implement netdev devmem allocator. The allocator takes a given struct netdev_dmabuf_binding as input and allocates net_iov from that binding. The allocation simply delegates to the binding's genpool for the allocation logic and wraps the returned memory region in a net_iov struct. Signed-off-by:

[PATCH net-next v17 03/14] netdev: support binding dma-buf to netdevice

2024-07-29 Thread Mina Almasry
Add a netdev_dmabuf_binding struct which represents the dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to rx queues on the netdevice. On the binding, the dma_buf_attach & dma_buf_map_attachment will occur. The entries in the sg_table from mapping will be inserted into a genpool

[PATCH net-next v17 02/14] net: netdev netlink api to bind dma-buf to a net device

2024-07-29 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry Reviewed-by: Donald Hunter Reviewed-by: Jakub Kicinski --- v16: - Use subset-of: queue queue-id instead of

[PATCH net-next v17 01/14] netdev: add netdev_rx_queue_restart()

2024-07-29 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry Reviewed-by: Pavel Begunkov Reviewed-by: Jakub Kicinski --- v17: - Use ASSERT_RTNL() (Jakub). v13: - Add reviewed-by from Pavel (thanks!) - Fixed comment (Pavel) v11: - Fix not

[PATCH net-next v17 00/14] Device Memory TCP

2024-07-29 Thread Mina Almasry
v17: https://patchwork.kernel.org/project/netdevbpf/list/?series=869900&state=* v16 also got a very thorough review and some testing (thanks again!). Thes version addresses all the concerns reported on v15, in terms of feedback and issues reported. Major changes: - Use ASSERT_RTNL. - Moved a

[PATCH net-next 7/7] selftests/net: Add trace events matching to tcp_ao

2024-07-29 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> Setup trace points, add a new ftrace instance in order to not interfere with the rest of the system, filtering by net namespace cookies. Raise a new background thread that parses trace_pipe, matches them with the list of expected events. Wiring up trace

[PATCH net-next 5/7] selftests/tcp_ao: Fix printing format for uint64_t

2024-07-29 Thread Dmitry Safonov via B4 Relay
From: Mohammad Nassiri It's not safe to use '%zu' specifier for printing uint64_t on 32-bit systems. For uint64_t, we should use the 'PRIu64' macro from the inttypes.h library. This ensures that the uint64_t is printed correctly from the selftests regardless of the system architecture. Signed-of

[PATCH net-next 3/7] selftests/net: Be consistent in kconfig checks

2024-07-29 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> Most of the functions in tcp-ao lib/ return negative errno or -1 in case of a failure. That creates inconsistencies in lib/kconfig, which saves what was the error code. As well as the uninitialized kconfig value is -1, which also may be the result of a c

[PATCH net-next 6/7] selftests/net: Synchronize client/server before counters checks

2024-07-29 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> On tests that are expecting failure the timeout value is TEST_RETRANSMIT_SEC == 1 second. Which is big enough for most of devices under tests. But on a particularly slow machine/VM, 1 second might be not enough for another thread to be scheduled and atte

[PATCH net-next 4/7] selftests/net: Don't forget to close nsfd after switch_save_ns()

2024-07-29 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> The switch_save_ns() helper suppose to help switching to another namespace for some action and to return back to original namespace. The fd should be closed. Signed-off-by: Dmitry Safonov <0x7f454...@gmail.com> --- tools/testing/selftests/net/tcp_ao/l

[PATCH net-next 0/7] net/selftests: TCP-AO selftests updates

2024-07-29 Thread Dmitry Safonov via B4 Relay
First 4 patches are more-or-less cleanups/preparations. Patch 5 was sent to me/contributed off-list by Mohammad, who wants 32-bit kernels to run TCP-AO. Patch 6 is a workaround/fix for slow VMs. Albeit, I can't reproduce the issue, but I hope it will fix netdev flakes for connect-deny-* tests. A

[PATCH net-next 2/7] selftests/net: Provide test_snprintf() helper

2024-07-29 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> Re-invented std::stringstream :-) No need for buffer array - malloc() it. It's going to be helpful of path concat printings. Signed-off-by: Dmitry Safonov <0x7f454...@gmail.com> --- tools/testing/selftests/net/tcp_ao/lib/aolib.h | 56 +

[PATCH net-next 1/7] selftests/net: Clean-up double assignment

2024-07-29 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> Yeah, copy'n'paste typo. Reported-by: Nassiri, Mohammad Closes: https://lore.kernel.org/all/dm6pr04mb4202bc58a9fd5bdd24a16e8ec5...@dm6pr04mb4202.namprd04.prod.outlook.com/ Signed-off-by: Dmitry Safonov <0x7f454...@gmail.com> --- tools/testing/selftes

Re: [PATCH net-next 2/2] selftests: net: ksft: support marking tests as disruptive

2024-07-29 Thread Jakub Kicinski
On Mon, 29 Jul 2024 15:10:42 -0700 Stanislav Fomichev wrote: > +parser = argparse.ArgumentParser() > +parser.add_argument('--skip-disruptive', default=False, > action='store_true', help='skip tests that might be disruptive (e.g. restart > the interface)') > +global KSFT_ARGS > +KS

Re: [PATCH net-next 1/2] selftests: net-drv: exercise queue stats when the device is down

2024-07-29 Thread Jakub Kicinski
On Mon, 29 Jul 2024 15:10:41 -0700 Stanislav Fomichev wrote: > Verify that total device stats don't decrease after it has been turned down. > Also make sure the device doesn't crash when we access per-queue stats > when it's down (in case it tries to access some pointers that are NULL). > > KTAP v

kselftest/next build: 7 builds: 2 failed, 5 passed, 1 warning (v6.11-rc1)

2024-07-29 Thread kernelci.org bot
kselftest/next build: 7 builds: 2 failed, 5 passed, 1 warning (v6.11-rc1) Full Build Summary: https://kernelci.org/build/kselftest/branch/next/kernel/v6.11-rc1/ Tree: kselftest Branch: next Git Describe: v6.11-rc1 Git Commit: 8400291e289ee6b2bf9779ff1c83a291501f017b Git URL: https://git.kernel.

Re: [PATCH v8 8/8] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-07-29 Thread Stephen Boyd
Quoting Stephen Boyd (2024-07-18 14:05:07) > Test that clks registered with 'struct clk_parent_data' work as > intended and can find their parents. > > Cc: Christian Marangi > Cc: Brendan Higgins > Reviewed-by: David Gow > Cc: Rae Moar > Signed-off-by: Stephen Boyd > --- Applied to clk-next

Re: [PATCH v8 7/8] clk: Add KUnit tests for clk fixed rate basic type

2024-07-29 Thread Stephen Boyd
Quoting Stephen Boyd (2024-07-18 14:05:06) > Test that the fixed rate basic type clk works as intended. > > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Signed-off-by: Stephen Boyd > --- Applied to clk-next

Re: [PATCH v8 6/8] clk: Add test managed clk provider/consumer APIs

2024-07-29 Thread Stephen Boyd
Quoting Stephen Boyd (2024-07-18 14:05:05) > Unit tests are more ergonomic and simpler to understand if they don't > have to hoist a bunch of code into the test harness init and exit > functions. Add some test managed wrappers for the clk APIs so that clk > unit tests can write more code in the act

Re: [PATCH v8 5/8] platform: Add test managed platform_device/driver APIs

2024-07-29 Thread Stephen Boyd
Quoting Stephen Boyd (2024-07-18 14:05:04) > Introduce KUnit resource wrappers around platform_driver_register(), > platform_device_alloc(), and platform_device_add() so that test authors > can register platform drivers/devices from their tests and have the > drivers/devices automatically be unregi

Re: [PATCH v2 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-29 Thread Ivan Orlov
On 7/29/24 15:02, Takashi Iwai wrote: On Mon, 29 Jul 2024 10:59:04 +0200, Ivan Orlov wrote: --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h (snip) Hi Takashi, Thank you so much for the review. +/* + * This structure describes the userspace-driven timer. Such timers are

Re: [PATCH v8 4/8] of: Add a KUnit test for overlays and test managed APIs

2024-07-29 Thread Stephen Boyd
Quoting Stephen Boyd (2024-07-18 14:05:03) > Test the KUnit test managed overlay APIs. Confirm that platform devices > are created and destroyed properly. This provides us confidence that the > test managed APIs work correctly and can be relied upon to provide tests > with fake platform devices and

Re: [PATCH v8 3/8] dt-bindings: vendor-prefixes: Add "test" vendor for KUnit and friends

2024-07-29 Thread Stephen Boyd
Quoting Stephen Boyd (2024-07-18 14:05:02) > Add the vendor prefix "test" to reserve a vendor prefix for bindings > that are purely for testing device tree code. This allows test code to > write bindings that can be checked by the schema validator. > > Reviewed-by: Rob Herring > Reviewed-by: Davi

Re: [PATCH v8 2/8] of: Add test managed wrappers for of_overlay_apply()/of_node_put()

2024-07-29 Thread Stephen Boyd
Quoting Stephen Boyd (2024-07-18 14:05:01) > Add test managed wrappers for of_overlay_apply() that automatically > removes the overlay when the test is finished. This API is intended for > use by KUnit tests that test code which relies on 'struct device_node's > and of_*() APIs. > > KUnit tests wi

Re: [PATCH v8 1/8] of/platform: Allow overlays to create platform devices from the root node

2024-07-29 Thread Stephen Boyd
Quoting Stephen Boyd (2024-07-18 14:05:00) > We'd like to apply overlays to the root node in KUnit so we can test > platform devices created as children of the root node. > > On some architectures (powerpc), the root node isn't marked with > OF_POPULATED_BUS. If an overlay tries to modify the root

[PATCH net-next 2/2] selftests: net: ksft: support marking tests as disruptive

2024-07-29 Thread Stanislav Fomichev
(not sure we want this, but just throwing it out there..) Add new @ksft_disruptive decorator to mark the tests that might be disruptive to the system. Depending on how well the previous test works in the CI we might want to disable disruptive tests by default and only let the developers run them m

[PATCH net-next 1/2] selftests: net-drv: exercise queue stats when the device is down

2024-07-29 Thread Stanislav Fomichev
Verify that total device stats don't decrease after it has been turned down. Also make sure the device doesn't crash when we access per-queue stats when it's down (in case it tries to access some pointers that are NULL). KTAP version 1 1..5 ok 1 stats.check_pause ok 2 stats.check_fec ok 3 stats.pk

kselftest/fixes build: 7 builds: 2 failed, 5 passed, 1 warning (v6.11-rc1)

2024-07-29 Thread kernelci.org bot
kselftest/fixes build: 7 builds: 2 failed, 5 passed, 1 warning (v6.11-rc1) Full Build Summary: https://kernelci.org/build/kselftest/branch/fixes/kernel/v6.11-rc1/ Tree: kselftest Branch: fixes Git Describe: v6.11-rc1 Git Commit: 8400291e289ee6b2bf9779ff1c83a291501f017b Git URL: https://git.kern

Re: [PATCH][next] tools: selftests: riscv: Fix spelling mistake "regesters" -> "registers"

2024-07-29 Thread Charlie Jenkins
On Mon, Jul 29, 2024 at 10:17:34AM +0100, Colin Ian King wrote: > There are a couple of spelling mistakes in ksft_test_result_fail messages. > Fix them. > > Signed-off-by: Colin Ian King > --- > tools/testing/selftests/riscv/vector/v_initval_nolibc.c | 4 ++-- > 1 file changed, 2 insertions(+),

Re: [PATCH bpf-next v2 0/3] selftests/bpf: convert test_dev_cgroup to test_progs

2024-07-29 Thread Stanislav Fomichev
On 07/29, Alexis Lothoré (eBPF Foundation) wrote: > Hello, > this small series aims to integrate test_dev_cgroup in test_progs so it > could be run automatically in CI. The new version brings a few differences > with the current one: > - test now uses directly syscalls instead of wrapping commandli

[PATCH v6 1/2] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-29 Thread David Finkel
Other mechanisms for querying the peak memory usage of either a process or v1 memory cgroup allow for resetting the high watermark. Restore parity with those mechanisms, but with a less racy API. For example: - Any write to memory.max_usage_in_bytes in a cgroup v1 mount resets the high waterma

[PATCH v6] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-29 Thread David Finkel
This is an updated patchset rebasing onto -torvalds master (post 6.11-rc1), and addressing comments from Michal and Tejun. As requested by Tejun and Johannes, I've removed the explicit check for the string "reset", so it now allows any non-empty string. (Empty strings get filtered before our write

[PATCH v6 2/2] mm, memcg: cg2 memory{.swap,}.peak write tests

2024-07-29 Thread David Finkel
Extend two existing tests to cover extracting memory usage through the newly mutable memory.peak and memory.swap.peak handlers. In particular, make sure to exercise adding and removing watchers with overlapping lifetimes so the less-trivial logic gets tested. Signed-off-by: David Finkel --- too

[PATCH v2] kselftest: dt: Ignore nodes that have ancestors disabled

2024-07-29 Thread Nícolas F . R . A . Prado
Filter out nodes that have one of its ancestors disabled as they aren't expected to probe. This removes the following false-positive failures on the sc7180-trogdor-lazor-limozeen-nots-r5 platform: /soc@0/geniqup@8c/i2c@894000/proximity@28 /soc@0/geniqup@ac/spi@a9/ec@0 /soc@0/remotepro

Re: [PATCH] selftests: ksft: Track skipped tests when finishing the test suite

2024-07-29 Thread Shuah Khan
On 7/29/24 08:52, Laura Nao wrote: Hi Shuah, On 7/23/24 18:17, Shuah Khan wrote: On 7/22/24 09:43, Laura Nao wrote: Consider skipped tests in addition to passed tests when evaluating the overall result of the test suite in the finished() helper. I am finally with you now. Can you please mor

Re: [PATCH 00/12] tools/nolibc: improve LLVM/clang support

2024-07-29 Thread Shuah Khan
On 7/29/24 13:26, Shuah Khan wrote: On 7/28/24 04:09, Thomas Weißschuh wrote: The current support for LLVM and clang in nolibc and its testsuite is very limited. * Various architectures plain do not compile * The user *has* to specify "-Os" otherwise the program crashes * Cross-compilation of t

Re: [PATCH 00/12] tools/nolibc: improve LLVM/clang support

2024-07-29 Thread Shuah Khan
On 7/28/24 04:09, Thomas Weißschuh wrote: The current support for LLVM and clang in nolibc and its testsuite is very limited. * Various architectures plain do not compile * The user *has* to specify "-Os" otherwise the program crashes * Cross-compilation of the tests does not work * Using clang

Re: [PATCH bpf-next v2 2/3] selftests/bpf: convert test_dev_cgroup to test_progs

2024-07-29 Thread Alan Maguire
On 29/07/2024 18:47, Alexis Lothoré wrote: > Hello Alan, thanks for the review > > On 7/29/24 19:29, Alan Maguire wrote: >> On 29/07/2024 09:20, Alexis Lothoré (eBPF Foundation) wrote: >>> test_dev_cgroup is defined as a standalone test program, and so is not >>> executed in CI. >>> >>> Convert it

Re: [PATCH bpf-next v1 6/8] selftests/bpf: Fix compile if backtrace support missing in libc

2024-07-29 Thread Andrii Nakryiko
On Fri, Jul 26, 2024 at 8:48 PM Tony Ambardar wrote: > > On Thu, Jul 25, 2024 at 01:22:37PM -0700, Andrii Nakryiko wrote: > > On Thu, Jul 25, 2024 at 3:39 AM Tony Ambardar > > wrote: > > > > > > From: Tony Ambardar > > > > > > Use backtrace functions only with glibc and otherwise provide stubs

Re: [PATCH bpf-next v2 2/3] selftests/bpf: convert test_dev_cgroup to test_progs

2024-07-29 Thread Alexis Lothoré
Hello Alan, thanks for the review On 7/29/24 19:29, Alan Maguire wrote: > On 29/07/2024 09:20, Alexis Lothoré (eBPF Foundation) wrote: >> test_dev_cgroup is defined as a standalone test program, and so is not >> executed in CI. >> >> Convert it to test_progs framework so it is tested automatically

Re: [PATCH bpf-next v2 3/3] selftests/bpf: add wrong type test to cgroup dev

2024-07-29 Thread Alan Maguire
On 29/07/2024 09:20, Alexis Lothoré (eBPF Foundation) wrote: > Current cgroup_dev test mostly tests that device operation is accepted or > refused base on passed major/minor (and so, any operation performed during > test involves only char device) > > Add a small subtest ensuring that the device t

Re: [PATCH bpf-next v2 1/3] selftests/bpf: do not disable /dev/null device access in cgroup dev test

2024-07-29 Thread Alexis Lothoré
Hello Alan, On 7/29/24 18:59, Alan Maguire wrote: > On 29/07/2024 09:20, Alexis Lothoré (eBPF Foundation) wrote: >> test_dev_cgroup currently loads a small bpf program allowing any access on >> urandom and zero devices, disabling access to any other device. It makes >> migrating this test to test_

Re: [PATCH bpf-next v2 2/3] selftests/bpf: convert test_dev_cgroup to test_progs

2024-07-29 Thread Alan Maguire
On 29/07/2024 09:20, Alexis Lothoré (eBPF Foundation) wrote: > test_dev_cgroup is defined as a standalone test program, and so is not > executed in CI. > > Convert it to test_progs framework so it is tested automatically in CI, and > remove the old test. In order to be able to run it in test_progs

Re: [PATCH bpf-next v2 1/3] selftests/bpf: do not disable /dev/null device access in cgroup dev test

2024-07-29 Thread Alan Maguire
On 29/07/2024 09:20, Alexis Lothoré (eBPF Foundation) wrote: > test_dev_cgroup currently loads a small bpf program allowing any access on > urandom and zero devices, disabling access to any other device. It makes > migrating this test to test_progs impossible, since this one manipulates > extensive

Re: [PATCH] selftests: ksft: Track skipped tests when finishing the test suite

2024-07-29 Thread Laura Nao
Hi Shuah, On 7/23/24 18:17, Shuah Khan wrote: > On 7/22/24 09:43, Laura Nao wrote: >> Consider skipped tests in addition to passed tests when evaluating the >> overall result of the test suite in the finished() helper. >> >> Signed-off-by: Laura Nao >> --- >> tools/testing/selftests/kselftest/k

Re: [PATCH 2/3] bitmap: Rename module

2024-07-29 Thread Randy Dunlap
On 7/29/24 1:07 AM, Muhammad Usama Anjum wrote: > On 7/27/24 10:35 PM, Yury Norov wrote: >> On Fri, Jul 26, 2024 at 04:06:57PM +0500, Muhammad Usama Anjum wrote: >>> Rename module to bitmap_kunit and rename the configuration option >>> compliant with kunit framework. >> >> ... , so those enablin

Re: [PATCH v2 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-29 Thread Takashi Iwai
On Mon, 29 Jul 2024 10:59:04 +0200, Ivan Orlov wrote: > --- a/include/uapi/sound/asound.h > +++ b/include/uapi/sound/asound.h (snip) > +/* > + * This structure describes the userspace-driven timer. Such timers are > purely virtual, > + * and can only be triggered from software (for instance, by us

Re: [PATCH 1/2] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-29 Thread David Finkel
Hi Tejun, On Fri, Jul 26, 2024 at 4:22 PM Tejun Heo wrote: > > Hello, David. > > On Tue, Jul 23, 2024 at 07:31:48PM -0400, David Finkel wrote: > ... > > + A write of the string "reset" to this file resets it to the > > + current memory usage for subsequent reads through the same > > +

Re: [PATCH v5 1/2] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-29 Thread David Finkel
Hi Michal, On Fri, Jul 26, 2024 at 10:16 AM Michal Koutný wrote: > > Hello David. > > On Wed, Jul 24, 2024 at 12:19:41PM GMT, David Finkel wrote: > > Writing a specific string to the memory.peak and memory.swap.peak > > pseudo-files reset the high watermark to the current usage for > > subsequen

Re: [PATCH net 0/5] mptcp: fix signal endpoint readd

2024-07-29 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net.git (main) by David S. Miller : On Sat, 27 Jul 2024 11:03:58 +0200 you wrote: > Issue #501 [1] showed that the Netlink PM currently doesn't correctly > support removal and re-add of signal endpoints. > > Patches 1 and 2 address the issue: the first on

[PATCH bpf-next v2 8/8] selftests/bpf: Fix error compiling tc_redirect.c with musl libc

2024-07-29 Thread Tony Ambardar
Linux 5.1 implemented 64-bit time types and related syscalls to address the Y2038 problem generally across archs. Userspace handling of Y2038 varies with the libc however. While musl libc uses 64-bit time across all 32-bit and 64-bit platforms, GNU glibc uses 64-bit time on 64-bit platforms but def

[PATCH bpf-next v2 7/8] selftests/bpf: Fix using stdout, stderr as struct field names

2024-07-29 Thread Tony Ambardar
Typically stdin, stdout, stderr are treated as reserved identifiers under ISO/ANSI C and libc implementations further define these as macros, both in glibc and musl . However, while glibc defines: ... /* Standard streams. */ extern FILE *stdin; /* Standard input stream. *

[PATCH bpf-next v2 6/8] selftests/bpf: Fix compile if backtrace support missing in libc

2024-07-29 Thread Tony Ambardar
Include GNU header only with glibc and provide weak, stubbed backtrace functions as a fallback in test_progs.c. This allows for non-GNU replacements while avoiding compile errors (e.g. with musl libc) like: test_progs.c:13:10: fatal error: execinfo.h: No such file or directory 13 | #includ

[PATCH bpf-next v2 5/8] selftests/bpf: Fix redefinition errors compiling lwt_reroute.c

2024-07-29 Thread Tony Ambardar
Compiling lwt_reroute.c with GCC 12.3 for mips64el/musl-libc yields errors: In file included from .../include/arpa/inet.h:9, from ./test_progs.h:18, from tools/testing/selftests/bpf/prog_tests/lwt_helpers.h:11, from tools/testing/selftests/bpf/pro

[PATCH bpf-next v2 4/8] selftests/bpf: Fix C++ compile error from missing _Bool type

2024-07-29 Thread Tony Ambardar
While building, bpftool makes a skeleton from test_core_extern.c, which itself includes and uses the 'bool' type. However, the skeleton test_core_extern.skel.h generated *does not* include or use the 'bool' type, instead using the C-only '_Bool' type. Compiling test_cpp.cpp with g++ 12.3 for mips

[PATCH bpf-next v2 3/8] selftests/bpf: Fix error compiling test_lru_map.c

2024-07-29 Thread Tony Ambardar
Although the post-increment in macro 'CPU_SET(next++, &cpuset)' seems safe, the sequencing can raise compile errors, so move the increment outside the macro. This avoids an error seen using gcc 12.3.0 for mips64el/musl-libc: In file included from test_lru_map.c:11: test_lru_map.c: In function

[PATCH bpf-next v2 2/8] selftests/bpf: Fix arg parsing in veristat, test_progs

2024-07-29 Thread Tony Ambardar
Current code parses arguments with strtok_r() using a construct like char *state = NULL; while ((next = strtok_r(state ? NULL : input, ",", &state))) { ... } where logic assumes the 'state' var can distinguish between first and subsequent strtok_r() calls, and adjusts paramete

[PATCH bpf-next v2 1/8] selftests/bpf: Use portable POSIX basename()

2024-07-29 Thread Tony Ambardar
Use the POSIX version of basename() to allow compilation against non-gnu libc (e.g. musl). Include ahead of to enable using functions from the latter while preferring POSIX over GNU basename(). In veristat.c, rely on strdupa() to avoid basename() altering the passed "const char" argument. This i

[PATCH bpf-next v2 0/8] selftests/bpf: Improve libc portability / musl support (part 2)

2024-07-29 Thread Tony Ambardar
Hello all, This is part 2 of a series of fixes for libc-related issues encountered building for musl-based systems. The series has been tested with the kernel-patches/bpf CI and locally using mips64el-gcc/musl-libc and QEMU with an OpenWrt rootfs. The patches cover a few areas of portability issu

[PATCH][next] tools: selftests: riscv: Fix spelling mistake "regesters" -> "registers"

2024-07-29 Thread Colin Ian King
There are a couple of spelling mistakes in ksft_test_result_fail messages. Fix them. Signed-off-by: Colin Ian King --- tools/testing/selftests/riscv/vector/v_initval_nolibc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/riscv/vector/v_initval_no

[PATCH v2 4/4] selftests: ALSA: Cover userspace-driven timers with test

2024-07-29 Thread Ivan Orlov
Add a test for the new functionality of userspace-driven timers and the tool which allows us to count timer ticks in a certain time period. The test: 1. Creates a userspace-driven timer with ioctl to /dev/snd/timer 2. Starts the `global-timer` application to count the ticks of the timer from step

[PATCH v2 3/4] ALSA: timer: Introduce virtual userspace-driven timers

2024-07-29 Thread Ivan Orlov
Implement two ioctl calls in order to support virtual userspace-driven ALSA timers. The first ioctl is SNDRV_TIMER_IOCTL_CREATE, which gets the snd_utimer_info struct as a parameter and returns a file descriptor of a virtual timer. It also updates the `id` field of the snd_utimer_info struct, whic

[PATCH v2 2/4] Docs/sound: Add documentation for userspace-driven ALSA timers

2024-07-29 Thread Ivan Orlov
Add the documentation which describes the new userspace-driven timers API introduced in this patch series. The documentation contains: - Description of userspace-driven ALSA timers, what they are for - Description of the timers API - Example of how the timers can be created and triggered - How the

[PATCH v2 1/4] ALSA: aloop: Allow using global timers

2024-07-29 Thread Ivan Orlov
Allow using global timers as a timer source when card id is equal to -1 in the timer_source parameter. Signed-off-by: Ivan Orlov --- V1 -> V2: - No changes sound/drivers/aloop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index d6dd4b8c750

[PATCH v2 0/4] Introduce userspace-driven ALSA timers

2024-07-29 Thread Ivan Orlov
There are multiple possible timer sources which could be useful for the sound stream synchronization: hrtimers, hardware clocks (e.g. PTP), timer wheels (jiffies). Currently, using one of them to synchronize the audio stream of snd-aloop module would require writing a kernel-space driver which expo

Re: [PATCH bpf-next v1 7/8] selftests/bpf: Fix using stdout, stderr as struct field names

2024-07-29 Thread Tony Ambardar
On Fri, Jul 26, 2024 at 09:22:38PM -0700, Tony Ambardar wrote: > On Thu, Jul 25, 2024 at 01:27:03PM -0700, Andrii Nakryiko wrote: > > On Thu, Jul 25, 2024 at 3:39 AM Tony Ambardar > > wrote: > > > > > > From: Tony Ambardar > > > > > > Typically stdin, stdout, stderr are treated as reserved ident

Re: [PATCH 0/3] bitmap: Convert test_bitmap to kunit test

2024-07-29 Thread Muhammad Usama Anjum
On 7/27/24 12:26 AM, Shuah Khan wrote: > On 7/26/24 05:06, Muhammad Usama Anjum wrote: >> In this series, test_bitmap is being converted to kunit test. Multiple >> patches will make the review process smooth. >> >> - Patch-1: Convert the tests in lib/test_bitmap.c to kunit >> - Patch-2: Rename the

[PATCH bpf-next v2 2/3] selftests/bpf: convert test_dev_cgroup to test_progs

2024-07-29 Thread eBPF Foundation
test_dev_cgroup is defined as a standalone test program, and so is not executed in CI. Convert it to test_progs framework so it is tested automatically in CI, and remove the old test. In order to be able to run it in test_progs, /dev/null must remain usable, so change the new test to test operatio

[PATCH bpf-next v2 3/3] selftests/bpf: add wrong type test to cgroup dev

2024-07-29 Thread eBPF Foundation
Current cgroup_dev test mostly tests that device operation is accepted or refused base on passed major/minor (and so, any operation performed during test involves only char device) Add a small subtest ensuring that the device type passed to bpf program allows it to take decisions as well. Signed-

[PATCH bpf-next v2 1/3] selftests/bpf: do not disable /dev/null device access in cgroup dev test

2024-07-29 Thread eBPF Foundation
test_dev_cgroup currently loads a small bpf program allowing any access on urandom and zero devices, disabling access to any other device. It makes migrating this test to test_progs impossible, since this one manipulates extensively /dev/null. Allow /dev/null manipulation in dev_cgroup program to

[PATCH bpf-next v2 0/3] selftests/bpf: convert test_dev_cgroup to test_progs

2024-07-29 Thread eBPF Foundation
Hello, this small series aims to integrate test_dev_cgroup in test_progs so it could be run automatically in CI. The new version brings a few differences with the current one: - test now uses directly syscalls instead of wrapping commandline tools into system() calls - test_progs manipulates /dev

Re: [PATCH 0/3] bitmap: Convert test_bitmap to kunit test

2024-07-29 Thread Muhammad Usama Anjum
On 7/27/24 11:10 PM, Yury Norov wrote: > On Fri, Jul 26, 2024 at 01:26:48PM -0600, Shuah Khan wrote: >> On 7/26/24 05:06, Muhammad Usama Anjum wrote: >>> In this series, test_bitmap is being converted to kunit test. Multiple >>> patches will make the review process smooth. >>> >>> - Patch-1: Conver

[PATCH] MAINTAINERS: Add selftests to DMA-BUF HEAPS FRAMEWORK entry

2024-07-29 Thread Zenghui Yu
Include dmabuf-heaps selftests in the correct entry so that updates to it can be sent to the right place. Signed-off-by: Zenghui Yu --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 42decde38320..b7f24c9fb0e2 100644 --- a/MAINTAINERS +++ b/MAINTA

Re: [PATCH 2/3] bitmap: Rename module

2024-07-29 Thread Muhammad Usama Anjum
On 7/27/24 10:35 PM, Yury Norov wrote: > On Fri, Jul 26, 2024 at 04:06:57PM +0500, Muhammad Usama Anjum wrote: >> Rename module to bitmap_kunit and rename the configuration option >> compliant with kunit framework. > > ... , so those enabling bitmaps testing in their configs by setting > "CONFIG_T

Re: [PATCH 2/3] bitmap: Rename module

2024-07-29 Thread Muhammad Usama Anjum
On 7/27/24 12:24 AM, Shuah Khan wrote: > On 7/26/24 05:06, Muhammad Usama Anjum wrote: >> Rename module to bitmap_kunit and rename the configuration option >> compliant with kunit framework. >> >> Cc: k...@kernel.org >> Signed-off-by: Muhammad Usama Anjum >> --- >>   MAINTAINERS   

Re: [PATCH 2/3] bitmap: Rename module

2024-07-29 Thread Muhammad Usama Anjum
On 7/26/24 11:45 PM, John Hubbard wrote: > On 7/26/24 4:06 AM, Muhammad Usama Anjum wrote: >> Rename module to bitmap_kunit and rename the configuration option >> compliant with kunit framework. >> >> Cc: k...@kernel.org >> Signed-off-by: Muhammad Usama Anjum >> --- >>   MAINTAINERS   

Re: Converting kselftest test modules to kunit

2024-07-29 Thread Muhammad Usama Anjum
On 7/27/24 12:35 AM, Shuah Khan wrote: > On 7/15/24 04:09, Muhammad Usama Anjum wrote: >> Hi Kees and All, >> >> There are several tests in kselftest subsystem which load modules to tests >> the internals of the kernel. Most of these test modules are just loaded by >> the kselftest, their status is

Re: [PATCH v2] kselftests: dmabuf-heaps: Ensure the driver name is null-terminated

2024-07-29 Thread Zenghui Yu
On 2024/7/29 15:01, Daniel Vetter wrote: On Mon, Jul 29, 2024 at 10:46:04AM +0800, Zenghui Yu wrote: > Even if a vgem device is configured in, we will skip the import_vgem_fd() > test almost every time. > > TAP version 13 > 1..11 > # Testing heap: system > # ==

Re: [PATCH] selftests: user: remove user suite

2024-07-29 Thread Muhammad Usama Anjum
On 7/26/24 10:19 PM, Shuah Khan wrote: > On 7/26/24 02:16, Muhammad Usama Anjum wrote: >> On 7/25/24 7:44 PM, Shuah Khan wrote: >>> On 7/25/24 05:08, Muhammad Usama Anjum wrote: The user test suite has only one test, test_user_copy which loads test_user_copy module for testing. But test_u

Re: [PATCH v2] kselftests: dmabuf-heaps: Ensure the driver name is null-terminated

2024-07-29 Thread Daniel Vetter
On Mon, Jul 29, 2024 at 10:46:04AM +0800, Zenghui Yu wrote: > Even if a vgem device is configured in, we will skip the import_vgem_fd() > test almost every time. > > TAP version 13 > 1..11 > # Testing heap: system > # === > # Testing allocation and imp