[PATCH 00/13] selftests/resctrl: resctrl_val() related cleanups & improvements

2024-03-08 Thread Ilpo Järvinen
Hi all, This series does a number of cleanups into resctrl_val() and generalizes it by removing test name specific handling from the function. One of the changes improves MBA/MBM measurement by narrowing down the period the resctrl FS derived memory bandwidth numbers are measured over. My feel is

[PATCH 01/13] selftests/resctrl: Convert get_mem_bw_imc() fd close to for loop

2024-03-08 Thread Ilpo Järvinen
The open() side handles fds in a for loop but close() is based on two fixed indexes READ and WRITE. Match the close() side with the open() side by using for loop for consistency. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl_val.c | 7 +++ 1 file changed, 3 insert

[PATCH 02/13] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-03-08 Thread Ilpo Järvinen
For MBM/MBA tests, measure_vals() calls get_mem_bw_imc() that performs the measurement over a duration of sleep(1) call. The memory bandwidth numbers from IMC are derived over this duration. The resctrl FS derived memory bandwidth, however, is calculated inside measure_vals() and only takes delta b

[PATCH 03/13] selftests/resctrl: Consolidate get_domain_id() into resctrl_val()

2024-03-08 Thread Ilpo Järvinen
Both initialize_mem_bw_resctrl() and initialize_llc_occu_resctrl() that are called from resctrl_val() need to determine domain ID to construct resctrl fs related paths. Both functions do it by taking CPU ID which neither needs for any other purpose than determining the domain ID. Consolidate deter

[PATCH 04/13] selftests/resctrl: Use correct type for pids

2024-03-08 Thread Ilpo Järvinen
A few functions receive PIDs through int arguments. PIDs variables should be of type pid_t, not int. Convert pid arguments from int to pid_t. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/cache.c | 6 +++--- tools/testing/selftests/resctrl/resctrl.h | 4 ++-- tools/

[PATCH 05/13] selftests/resctrl: Cleanup bm_pid and ppid usage & limit scope

2024-03-08 Thread Ilpo Järvinen
'bm_pid' and 'ppid' are global variables. As they are used by different processes and in signal handler, they cannot be entirely converted into local variables. The scope of those variables can still be reduced into resctrl_val.c only. As PARENT_EXIT() macro is using 'ppid', make it a function in

[PATCH 06/13] selftests/resctrl: Rename measure_vals() to measure_mem_bw_vals() & document

2024-03-08 Thread Ilpo Järvinen
measure_val() is awfully generic name so rename it to measure_mem_bw() to describe better what it does and document the function parameters. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl_val.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --g

[PATCH 07/13] selftests/resctrl: Add ->measure() callback to resctrl_val_param

2024-03-08 Thread Ilpo Järvinen
The measurement done in resctrl_val() varies depending on test type. The decision for how to measure is decided based on the string compare to test name which is quite inflexible. Add ->measure() callback into the struct resctrl_val_param to allow each test to provide necessary code as a function

[PATCH 08/13] selftests/resctrl: Add ->init() callback into resctrl_val_param

2024-03-08 Thread Ilpo Järvinen
The struct resctrl_val_param is there to customize behavior inside resctrl_val() which is currently not used to full extent and there are number of strcmp()s for test name in resctrl_val done by resctrl_val(). Create ->init() hook into the struct resctrl_val_param to cleanly do per test initializa

[PATCH 09/13] selftests/resctrl: Simplify bandwidth report type handling

2024-03-08 Thread Ilpo Järvinen
bw_report is only needed for selecting the correct value from the values IMC measured. It is a member in the resctrl_val_param struct and is always set to "reads". The value is then checked in resctrl_val() using validate_bw_report_request() that besides validating the input, assumes it can mutate

[PATCH 10/13] selftests/resctrl: Make some strings passed to resctrlfs functions const

2024-03-08 Thread Ilpo Järvinen
Control group, monitor group and resctrl_val are not mutated and should not be mutated within resctrlfs.c functions. Mark this by using const char * for the arguments. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl.h | 7 --- tools/testing/selftests/resctrl/resct

[PATCH 11/13] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-03-08 Thread Ilpo Järvinen
The struct resctrl_val_param has control and monitor groups as char arrays but they are not supposed to be mutated within resctrl_val(). Convert the ctrlgrp and mongrp char array within resctrl_val_param to plain const char pointers and adjust the strlen() based checks to check NULL instead. Sign

[PATCH 12/13] selftests/resctrl: Remove mongrp from MBA test

2024-03-08 Thread Ilpo Järvinen
Nothing during MBA test uses mongrp even if it has been defined ever since the introduction of the MBA test in the commit 01fee6b4d1f9 ("selftests/resctrl: Add MBA test"). Remove the mongrp from MBA test. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/mba_test.c | 1 - 1 file

[PATCH 13/13] selftests/resctrl: Remove test name comparing from write_bm_pid_to_resctrl()

2024-03-08 Thread Ilpo Järvinen
write_bm_pid_to_resctrl() uses resctrl_val to check test name which is not a good interface generic resctrl FS functions should provide. Only MBM and CMT tests define mongrp so the test name check in write_bm_pid_to_resctrl() can be changed to depend simply on mongrp being non-NULL. With last use

Re: [PATCH 2/4] selftests/resctrl: SNC support for CMT

2024-03-08 Thread Ilpo Järvinen
On Wed, 6 Mar 2024, Maciej Wieczor-Retman wrote: > Cache Monitoring Technology (CMT) works by measuring how much data in L3 > cache is occupied by a given process identified by its Resource > Monitoring ID (RMID). > > On systems with Sub-Numa Clusters (SNC) enabled, a process can occupy > not onl

Re: [PATCH 2/4] selftests/resctrl: SNC support for CMT

2024-03-08 Thread Ilpo Järvinen
On Fri, 8 Mar 2024, Ilpo Järvinen wrote: > On Wed, 6 Mar 2024, Maciej Wieczor-Retman wrote: > > > Cache Monitoring Technology (CMT) works by measuring how much data in L3 > > cache is occupied by a given process identified by its Resource > > Monitoring ID (RMID). > > > > On systems with Sub-Num

Re: [PATCH 3/4] selftests/resctrl: SNC support for MBM

2024-03-08 Thread Ilpo Järvinen
On Wed, 6 Mar 2024, Maciej Wieczor-Retman wrote: > Memory Bandwidth Monitoring (MBM) measures how much data flows between > cache levels. Only the flow for a process specified with a Resource > Monitoring ID (RMID) is measured. > > Sub-Numa Clustering (SNC) causes MBM selftest to fail because the

[RFC PATCH v2 0/2] Add a test to verify device probing on ACPI platforms

2024-03-08 Thread Laura Nao
Hello, This v2 addresses some issues observed when running the ACPI probe kselftest proposed in v1[1] across various devices and improves the overall reliability of the test. The acpi-extract-ids script has been improved to: - Parse both .c and .h files - Add an option to print only IDs matched b

[RFC PATCH v2 1/2] acpi: Add script to extract ACPI device ids in the kernel

2024-03-08 Thread Laura Nao
Add a script to extract all the supported acpi device ids from kernel sources. The script looks for IDs defined in acpi_device_id structs within both .c and .h files and prints them. If the -d option is used, the script only shows the IDs that are matched by a driver, identified through either an

[RFC PATCH v2 2/2] kselftest: Add test to detect unprobed devices on ACPI platforms

2024-03-08 Thread Laura Nao
Add new kselftest that tests whether devices declared in the ACPI namespace and supported by the kernel are correctly bound to a driver. The test traverses the ACPI sysfs tree to get a list of all the devices defined in the ACPI namespace and verifies whether the physical devices linked to each AC

Re: [PATCH 4/4] selftests/resctrl: Adjust SNC support messages

2024-03-08 Thread James Morse
Hi guys, On 07/03/2024 23:16, Tony Luck wrote: > On Thu, Mar 07, 2024 at 02:39:08PM -0800, Reinette Chatre wrote: >> Thank you for the example. I find that significantly easier to >> understand than a single number in a generic "nodes_per_l3_cache". >> Especially with potential confusion surroundi

Re: [PATCH 4/4] selftests/resctrl: Adjust SNC support messages

2024-03-08 Thread Tony Luck
On Fri, Mar 08, 2024 at 06:06:45PM +, James Morse wrote: > Hi guys, > > On 07/03/2024 23:16, Tony Luck wrote: > > On Thu, Mar 07, 2024 at 02:39:08PM -0800, Reinette Chatre wrote: > >> Thank you for the example. I find that significantly easier to > >> understand than a single number in a gener

Re: [RFC PATCH net-next v6 02/15] net: page_pool: create hooks for custom page providers

2024-03-08 Thread Mina Almasry
On Thu, Mar 7, 2024 at 8:57 PM David Wei wrote: > > On 2024-03-04 18:01, Mina Almasry wrote: > > From: Jakub Kicinski > > > > The page providers which try to reuse the same pages will > > need to hold onto the ref, even if page gets released from > > the pool - as in releasing the page from the p

Re: [PATCH v4 0/7] of: populate of_root node if bootloader doesn't

2024-03-08 Thread Rob Herring
On Fri, Feb 16, 2024 at 05:05:49PM -0800, Stephen Boyd wrote: > Arch maintainers, please ack/review patches. > > This is a resend of a series from Frank last year[1]. I worked in Rob's > review comments to unconditionally call unflatten_device_tree() and > fixup/audit calls to of_have_populated_dt

[PATCH net-next 00/15] selftests: mptcp: various improvements

2024-03-08 Thread Matthieu Baerts (NGI0)
--- 8 files changed, 312 insertions(+), 286 deletions(-) --- base-commit: 19cfdc0d57696c92523da8eb26c0f3e092400bee change-id: 20240308-upstream-net-next-20240308-selftests-mptcp-unification-6df178cc8f6a Best regards, -- Matthieu Baerts (NGI0)

[PATCH net-next 01/15] selftests: mptcp: print all error messages to stdout

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Some error messages are printed to stderr while the others are printed to 'stdout'. As part of the unification, this patch drop "1>&2" to let all errors messages are printed to 'stdout'. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu

[PATCH net-next 02/15] selftests: mptcp: connect: add dedicated port counter

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch adds a new dedicated counter 'port' instead of TEST_COUNT to increase port numbers in mptcp_connect.sh. This can avoid outputting discontinuous test counters. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) -

[PATCH net-next 03/15] selftests: mptcp: connect: fix misaligned output

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang The first [ OK ] in the output of mptcp_connect.sh misaligns with the others: New MPTCP socket can be blocked via sysctl [ OK ] INFO: validating network environment with pings INFO: Using loss of 0.85% delay 16 ms reorder 95% 70% with delay 4ms on ns1 MPTCP -> ns1

[PATCH net-next 04/15] selftests: mptcp: sockopt: print every test result

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Only total test results are printed out in mptcp_sockopt.sh: PASS: all packets had packet mark set PASS: SOL_MPTCP getsockopt has expected information PASS: TCP_INQ cmsg/ioctl -t tcp PASS: TCP_INQ cmsg/ioctl -6 -t tcp PASS: TCP_INQ cmsg/ioctl -r tcp PASS: TCP_INQ cmsg/ioctl -6

[PATCH net-next 05/15] selftests: mptcp: export TEST_COUNTER variable

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Variable TEST_COUNT are used in mptcp_connect.sh and mptcp_join.sh as test counters, which are initialized to 0, while variable test_cnt are used in diag.sh and simult_flows.sh, which are initialized to 1. To maintain consistency, this patch renames them all as MPTCP_LIB_TEST_C

[PATCH net-next 06/15] selftests: mptcp: add print_title in mptcp_lib

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch adds a new variable MPTCP_LIB_TEST_FORMAT as the test title printing format. Also add a helper mptcp_lib_print_title() to use this format to print the test title with test counters. They are used in mptcp_join.sh first. Each MPTCP selftest is having subtests, and it

[PATCH net-next 07/15] selftests: mptcp: print test results with counters

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch adds a new helper mptcp_lib_print_title(), a wrapper of mptcp_lib_inc_test_counter() and mptcp_lib_pr_title_counter(), to print out test counter in each test result and increase the counter. Use this helper to print out test counters for every tests in diag.sh, mptcp

[PATCH net-next 08/15] selftests: mptcp: use += operator to append strings

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch uses addition assignment operator (+=) to append strings instead of duplicating the variable name in mptcp_connect.sh and mptcp_join.sh. This can make the statements shorter. Note: in mptcp_connect.sh, add a local variable extra in do_transfer to save the various e

[PATCH net-next 09/15] selftests: mptcp: print test results with colors

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang To unify the output formats of all test scripts, this patch adds four more helpers: mptcp_lib_pr_ok() mptcp_lib_pr_skip() mptcp_lib_pr_fail() mptcp_lib_pr_info() to print out [ OK ], [SKIP], [FAIL] and 'INFO: ' with colors. Use them in all scri

[PATCH net-next 10/15] selftests: mptcp: call test_fail without argument

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch modifies test_fail() to call mptcp_lib_pr_fail() only if there are arguments (if [ ${#} -gt 0 ]) in userspace_pm.sh, add arguments "unexpected type: ${type}" when calling test_fail() from test_remove(). Then mptcp_lib_pr_fail() can be used in check_expected_one() ins

[PATCH net-next 11/15] selftests: mptcp: extract mptcp_lib_check_expected

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Extract the main part of check_expected() in userspace_pm.sh to a new function mptcp_lib_check_expected() in mptcp_lib.sh. It will be used in both mptcp_john.sh and userspace_pm.sh. check_expected_one() is moved into mptcp_lib.sh too as mptcp_lib_check_expected_one(). Signed-o

[PATCH net-next 12/15] selftests: mptcp: print_test out of verify_listener_events

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang verify_listener_events() helper will be exported into mptcp_lib.sh as a public function, but print_test() is invoked in it, which is a private function in userspace_pm.sh only. So this patch moves print_test() out of verify_listener_events(). Signed-off-by: Geliang Tang Revie

[PATCH net-next 13/15] selftests: mptcp: add mptcp_lib_verify_listener_events

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang To avoid duplicated code in different MPTCP selftests, we can add and use helpers defined in mptcp_lib.sh. The helper verify_listener_events() is defined both in mptcp_join.sh and userspace_pm.sh, export it into mptcp_lib.sh and rename it with mptcp_lib_ prefix. Use this new h

[PATCH net-next 14/15] selftests: mptcp: declare event macros in mptcp_lib

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang MPTCP event macros (SUB_ESTABLISHED, LISTENER_CREATED, LISTENER_CLOSED), and the protocol family macros (AF_INET, AF_INET6) are defined in both mptcp_join.sh and userspace_pm.sh. In order not to duplicate code, this patch declares them all in mptcp_lib.sh with MPTCP_LIB_ prefix

[PATCH net-next 15/15] selftests: mptcp: use KSFT_SKIP/KSFT_PASS/KSFT_FAIL

2024-03-08 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch uses the public var KSFT_SKIP in mptcp_lib.sh instead of ksft_skip, and drop 'ksft_skip=4' in mptcp_join.sh. Use KSFT_PASS and KSFT_FAIL macros instead of 0 and 1 after 'exit ' and 'ret=' in all scripts: exit 0 -> exit ${KSFT_PASS} exit 1 -> exit ${

Re: [RFC PATCH net-next v6 01/15] queue_api: define queue api

2024-03-08 Thread David Wei
On 2024-03-04 18:01, Mina Almasry wrote: > This API enables the net stack to reset the queues used for devmem. > > Signed-off-by: Mina Almasry > > --- > include/linux/netdevice.h | 24 > 1 file changed, 24 insertions(+) > > diff --git a/include/linux/netdevice.h b/incl

Re: [RFC PATCH net-next v6 01/15] queue_api: define queue api

2024-03-08 Thread Mina Almasry
On Fri, Mar 8, 2024 at 3:48 PM David Wei wrote: > > On 2024-03-04 18:01, Mina Almasry wrote: > > This API enables the net stack to reset the queues used for devmem. > > > > Signed-off-by: Mina Almasry > > > > --- > > include/linux/netdevice.h | 24 > > 1 file changed, 24

Re: [PATCH] selftests: x86: skip the tests if prerequisites aren't fulfilled

2024-03-08 Thread Chang S. Bae
On 3/7/2024 10:37 AM, Muhammad Usama Anjum wrote: diff --git a/tools/testing/selftests/x86/amx.c b/tools/testing/selftests/x86/amx.c index d884fd69dd510..5d1ca0bbaaae7 100644 --- a/tools/testing/selftests/x86/amx.c +++ b/tools/testing/selftests/x86/amx.c @@ -103,9 +103,10 @@ static void clearha