Re: [PATCH] selftests/proc: fix unused result warning during test compilation

2024-06-28 Thread Abhinav Jain
On Fri, 28 Jun 2024 13:30:14 -0700, Andrew Morton wrote: > Well, it's all inside `if (0)', so just remove it. Removed and shared v2 version of the patch here: https://lore.kernel.org/all/20240629050449.990451-1-jain.abhinav...@gmail.com/ Please review. Thanks.

[PATCH v2] selftests/proc: fix unused result warning during test compilation

2024-06-28 Thread Abhinav Jain
Check the return value from write function to get rid of the warning during test compilation, shared below. Tested by compiling after the change, the warning disappears. proc-empty-vm.c:385:17: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]

[PATCH bpf-next v6 9/9] selftests/bpf: Drop make_socket in sk_lookup

2024-06-28 Thread Geliang Tang
From: Geliang Tang Use local helper make_client() instead of using make_socket() and connect(). Then make_socket() and inetaddr_len() can be dropped now. Signed-off-by: Geliang Tang --- .../selftests/bpf/prog_tests/sk_lookup.c | 45 +-- 1 file changed, 2 insertions(+), 43

[PATCH bpf-next v6 8/9] selftests/bpf: Use connect_to_addr in sk_lookup

2024-06-28 Thread Geliang Tang
From: Geliang Tang Use public network helpers make_sockaddr() and connect_to_addr() instead of using the local defined function make_socket() and connect(). This make_socket() can be dropped latter. Signed-off-by: Geliang Tang --- .../selftests/bpf/prog_tests/sk_lookup.c | 20 +++

[PATCH bpf-next v6 7/9] selftests/bpf: Use connect_to_fd in sk_lookup

2024-06-28 Thread Geliang Tang
From: Geliang Tang This patch uses public helper connect_to_fd() exported in network_helpers.h instead of using make_socket() and connect() in prog_tests/sk_lookup.c. This can simplify the code. Signed-off-by: Geliang Tang --- .../testing/selftests/bpf/prog_tests/sk_lookup.c | 16 ++---

[PATCH bpf-next v6 6/9] selftests/bpf: Use start_server_str in sk_lookup

2024-06-28 Thread Geliang Tang
From: Geliang Tang This patch uses public helper start_server_addr() instead of local defined function make_server() in prog_tests/sk_lookup.c to avoid duplicate code. Add a helper setsockopts() to set SOL_CUSTOM sockopt looply, set it to setsockopt pointer of struct network_helper_opts, and pas

[PATCH bpf-next v6 5/9] selftests/bpf: Close fd in error path in drop_on_reuseport

2024-06-28 Thread Geliang Tang
From: Geliang Tang Server 1 fd should be closed in the error path when update_lookup_map() fails. This patch fixes it by goto "close_srv1" instead of "detach" lable in that case. Acked-by: Eduard Zingerman Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/sk_lookup.c | 2

[PATCH bpf-next v6 4/9] selftests/bpf: Use make_sockaddr in sockmap_ktls

2024-06-28 Thread Geliang Tang
From: Geliang Tang This patch uses public helper make_sockaddr() exported in network_helpers.h instead of open-coding in sockmap_ktls.c. This can avoid duplicate code. Acked-by: Eduard Zingerman Signed-off-by: Geliang Tang --- .../selftests/bpf/prog_tests/sockmap_ktls.c | 16 ++--

[PATCH bpf-next v6 3/9] selftests/bpf: Use connect_to_fd in sockmap_ktls

2024-06-28 Thread Geliang Tang
From: Geliang Tang Use public network helper connect_to_fd() instead of open-coding it in prog_tests/sockmap_ktls.c. This can avoid duplicate code. Acked-by: Eduard Zingerman Signed-off-by: Geliang Tang --- .../selftests/bpf/prog_tests/sockmap_ktls.c| 14 ++ 1 file changed

[PATCH bpf-next v6 2/9] selftests/bpf: Use start_server_str in sockmap_ktls

2024-06-28 Thread Geliang Tang
From: Geliang Tang Include network_helpers.h in prog_tests/sockmap_ktls.c, use public network helper start_server_str() instead of local defined function tcp_server(). This can avoid duplicate code. Technically, this is not a one-for-one replacement, as start_server_str() also does bind(). But t

[PATCH bpf-next v6 0/9] use network helpers, part 8

2024-06-28 Thread Geliang Tang
From: Geliang Tang v6: - update patch 6 as Daniel suggested. (thanks) v5: - keep make_server and make_client as Eduard suggested. v4: - a new patch to use make_sockaddr in sockmap_ktls. - a new patch to close fd in error path in drop_on_reuseport. - drop make_server() in patch 7. - drop m

[PATCH bpf-next v6 1/9] selftests/bpf: Add backlog for network_helper_opts

2024-06-28 Thread Geliang Tang
From: Geliang Tang Some callers expect __start_server() helper to pass their own "backlog" value to listen() instead of the default of 1. So this patch adds struct member "backlog" for network_helper_opts to allow callers to set "backlog" value via start_server_str() helper. Signed-off-by: Gelia

Re: [PATCH net-next v3 0/7] selftests: net: Switch pmtu.sh to use the internal ovs script.

2024-06-28 Thread Jakub Kicinski
On Fri, 28 Jun 2024 14:04:09 -0400 Aaron Conole wrote: > > I also added the OvS tests themselves, and those are not passing, yet: > > https://netdev.bots.linux.dev/contest.html?test=openvswitch-sh > > Could you take a look and LMK if these are likely env issues or > > something bad in the test itse

Re: [PATCH bpf-next v5 6/9] selftests/bpf: Use start_server_str in sk_lookup

2024-06-28 Thread Daniel Borkmann
On 6/25/24 7:42 AM, Geliang Tang wrote: [...] +static int make_server(int sotype, const char *ip, int port, + struct bpf_program *reuseport_prog) +{ + struct cb_opts cb_opts = { + .family = is_ipv6(ip) ? AF_INET6 : AF_INET, + .sotype = sotype

Re: [PATCH] selftests/bpf:fix a resource leak

2024-06-28 Thread Daniel Borkmann
On 6/27/24 8:01 AM, Zhu Jun wrote: The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- tools/testing/selftests/bpf/test_sockmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/self

Re: [PATCH 0/3] tools/nolibc: implement strerror()

2024-06-28 Thread Shuah Khan
On 5/2/24 10:10, Thomas Weißschuh wrote: Hi Shuah, On 2024-04-26 13:08:55+, Thomas Weißschuh wrote: Adds a simple implementation of strerror() and makes use of it in kselftests. Shuah, could you Ack patch 3? Friendly ping for an Ack of patch 3 of this series. After that I'd like to subm

Re: [PATCH 3/3] selftests: kselftest: also use strerror() on nolibc

2024-06-28 Thread Shuah Khan
On 4/26/24 05:08, Thomas Weißschuh wrote: nolibc gained an implementation of strerror() recently. Use it and drop the ifdeffery. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest.h | 8 1 file changed, 8 deletions(-) diff --git a/tools/testing/selftests/kselftes

[PATCH v7 1/4] mm/memory-failure: refactor log format in soft offline code

2024-06-28 Thread Jiaqi Yan
Logs from soft_offline_page and soft_offline_in_use_page have different formats than majority of the memory failure code: "Memory failure: 0x${pfn}: ${lower_case_message}" Convert them to the following format: "Soft offline: 0x${pfn}: ${lower_case_message}" No functional change in this comm

[PATCH v7 4/4] docs: mm: add enable_soft_offline sysctl

2024-06-28 Thread Jiaqi Yan
Add the documentation for soft offline behaviors / costs, and what the new enable_soft_offline sysctl is for. Acked-by: Oscar Salvador Acked-by: Miaohe Lin Signed-off-by: Jiaqi Yan --- Documentation/admin-guide/sysctl/vm.rst | 32 + 1 file changed, 32 insertions(+) dif

[PATCH v7 3/4] selftest/mm: test enable_soft_offline behaviors

2024-06-28 Thread Jiaqi Yan
Add regression and new tests when hugepage has correctable memory errors, and how userspace wants to deal with it: * if enable_soft_offline=1, mapped hugepage is soft offlined * if enable_soft_offline=0, mapped hugepage is intact Free hugepages case is not explicitly covered by the tests. Hugepag

[PATCH v7 2/4] mm/memory-failure: userspace controls soft-offlining pages

2024-06-28 Thread Jiaqi Yan
Correctable memory errors are very common on servers with large amount of memory, and are corrected by ECC. Soft offline is kernel's additional recovery handling for memory pages having (excessive) corrected memory errors. Impacted page is migrated to a healthy page if inuse; the original page is d

[PATCH v7 0/4] Userspace controls soft-offline pages

2024-06-28 Thread Jiaqi Yan
Correctable memory errors are very common on servers with large amount of memory, and are corrected by ECC, but with two pain points to users: 1. Correction usually happens on the fly and adds latency overhead 2. Not-fully-proved theory states excessive correctable memory errors can develop into

Re: [PATCH 3/3] selftests: kselftest: also use strerror() on nolibc

2024-06-28 Thread Shuah Khan
On 5/27/24 10:11, Thomas Weißschuh wrote: Hi Shuah, Could you Ack the patch below to kselftest.h? Thanks, Thomas On 2024-04-26 13:08:58+, Thomas Weißschuh wrote: nolibc gained an implementation of strerror() recently. Use it and drop the ifdeffery. Signed-off-by: Thomas Weißschuh ---

Re: [PATCH] selftests/proc: fix unused result warning during test compilation

2024-06-28 Thread Andrew Morton
On Fri, 28 Jun 2024 07:03:38 + Abhinav Jain wrote: > On Tue, 25 Jun 2024 11:05:26 -0700, Andrew Morton wrote: > > Thanks. There's a patch queued which simply deletes this code. > > > > https://lkml.kernel.org/r/20240603124220.33778-1-amer.shanaw...@gmail.com > > Thank you for sharing the q

Re: [PATCH v3 0/7] selftests/x86: fix build errors and warnings found via clang

2024-06-28 Thread John Hubbard
On 5/31/24 12:38 PM, John Hubbard wrote: Hi, Dave Hansen, Muhammad Usama Anjum, here is the combined series that we discussed yesterday [1]. Hi Dave, Shuah, Are either of you planning to take this series? I ask because I have a very slightly overlapping series that enhances the LLVM/clang che

Re: [PATCH net-next v3 0/7] selftests: net: Switch pmtu.sh to use the internal ovs script.

2024-06-28 Thread Aaron Conole
Jakub Kicinski writes: > On Tue, 25 Jun 2024 13:22:38 -0400 Aaron Conole wrote: >> Currently, if a user wants to run pmtu.sh and cover all the provided test >> cases, they need to install the Open vSwitch userspace utilities. This >> dependency is difficult for users as well as CI environments,

Re: [PATCH net-next v6 00/10] net: openvswitch: Add sample multicasting.

2024-06-28 Thread Adrián Moreno
On Fri, Jun 28, 2024 at 01:05:36PM GMT, Adrian Moreno wrote: > ** Background ** > Currently, OVS supports several packet sampling mechanisms (sFlow, > per-bridge IPFIX, per-flow IPFIX). These end up being translated into a > userspace action that needs to be handled by ovs-vswitchd's handler > thre

Re: [PATCH v6 3/4] selftest/mm: test enable_soft_offline behaviors

2024-06-28 Thread Jiaqi Yan
On Thu, Jun 27, 2024 at 8:29 PM Miaohe Lin wrote: > > On 2024/6/26 13:08, Jiaqi Yan wrote: > > Add regression and new tests when hugepage has correctable memory > > errors, and how userspace wants to deal with it: > > * if enable_soft_offline=1, mapped hugepage is soft offlined > > * if enable_sof

Re: [PATCH v6 2/4] mm/memory-failure: userspace controls soft-offlining pages

2024-06-28 Thread Jiaqi Yan
On Thu, Jun 27, 2024 at 8:27 PM David Rientjes wrote: > > On Wed, 26 Jun 2024, Jiaqi Yan wrote: > > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > > index 6f5ac334efba..1559e773537f 100644 > > --- a/mm/memory-failure.c > > +++ b/mm/memory-failure.c > > @@ -68,6 +68,8 @@ static int sysc

Re: [PATCH net-next v3 0/7] selftests: net: Switch pmtu.sh to use the internal ovs script.

2024-06-28 Thread Jakub Kicinski
On Tue, 25 Jun 2024 13:22:38 -0400 Aaron Conole wrote: > Currently, if a user wants to run pmtu.sh and cover all the provided test > cases, they need to install the Open vSwitch userspace utilities. This > dependency is difficult for users as well as CI environments, because the > userspace build

Re: [PATCH v2 2/4] capabilities: Add securebit to restrict userns caps

2024-06-28 Thread Jarkko Sakkinen
On Fri, 2024-06-28 at 17:43 +0300, Jarkko Sakkinen wrote: > On Sun, 2024-06-09 at 03:43 -0700, Jonathan Calmels wrote: > > This patch adds a new capability security bit designed to constrain > > a > > > nit: if you think of it "This patch adds" could be just "add", right? > :-) > > Also name the

Re: [PATCH v2 2/4] capabilities: Add securebit to restrict userns caps

2024-06-28 Thread Jarkko Sakkinen
On Sun, 2024-06-09 at 03:43 -0700, Jonathan Calmels wrote: > This patch adds a new capability security bit designed to constrain a nit: if you think of it "This patch adds" could be just "add", right? :-) Also name the exact thing/symbol/whatever here. This is not a HBO series. > task’s userns

Re: [PATCH v1] selftests/harness: Fix tests timeout and race condition

2024-06-28 Thread Mark Brown
On Fri, Jun 21, 2024 at 08:06:05PM +0200, Mickaël Salaün wrote: > We cannot use CLONE_VFORK because we also need to wait for the timeout > signal. > > Restore tests timeout by using the original fork() call in __run_test() > but also in __TEST_F_IMPL(). Also fix a race condition when waiting for

[PATCH net-next v6 10/10] selftests: openvswitch: add psample test

2024-06-28 Thread Adrian Moreno
Add a test to verify sampling packets via psample works. In order to do that, create a subcommand in ovs-dpctl.py to listen to on the psample multicast group and print samples. Signed-off-by: Adrian Moreno --- .../selftests/net/openvswitch/openvswitch.sh | 115 +- .../selftests

[PATCH net-next v6 09/10] selftests: openvswitch: parse trunc action

2024-06-28 Thread Adrian Moreno
The trunc action was supported decode-able but not parse-able. Add support for parsing the action string. Reviewed-by: Aaron Conole Signed-off-by: Adrian Moreno --- .../testing/selftests/net/openvswitch/ovs-dpctl.py | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/testi

[PATCH net-next v6 08/10] selftests: openvswitch: add userspace parsing

2024-06-28 Thread Adrian Moreno
The userspace action lacks parsing support plus it contains a bug in the name of one of its attributes. This patch makes userspace action work. Reviewed-by: Aaron Conole Signed-off-by: Adrian Moreno --- .../selftests/net/openvswitch/ovs-dpctl.py| 24 +-- 1 file changed, 22

[PATCH net-next v6 07/10] selftests: openvswitch: add psample action

2024-06-28 Thread Adrian Moreno
Add sample and psample action support to ovs-dpctl.py. Refactor common attribute parsing logic into an external function. Signed-off-by: Adrian Moreno --- .../selftests/net/openvswitch/ovs-dpctl.py| 162 +- 1 file changed, 161 insertions(+), 1 deletion(-) diff --git a/tools

[PATCH net-next v6 00/10] net: openvswitch: Add sample multicasting.

2024-06-28 Thread Adrian Moreno
** Background ** Currently, OVS supports several packet sampling mechanisms (sFlow, per-bridge IPFIX, per-flow IPFIX). These end up being translated into a userspace action that needs to be handled by ovs-vswitchd's handler threads only to be forwarded to some third party application that will some

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

2024-06-28 Thread Donald Hunter
Mina Almasry writes: > + > +The user must bind a dmabuf to any number of RX queues on a given NIC using > +the netlink API:: > + > + /* Bind dmabuf to NIC RX queue 15 */ > + struct netdev_queue *queues; > + queues = malloc(sizeof(*queues) * 1); > + > + queues[0]._present.type = 1;

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

2024-06-28 Thread Donald Hunter
Mina Almasry writes: > + - > +name: bind-dmabuf > +attributes: > + - > +name: ifindex > +doc: netdev ifindex to bind the dma-buf to. Minor nit: The series uses a mix of dmabuf and dma-buf but the doc additions (devmem.rst) consistently uses dmabuf. I think it would

Re: [PATCH net-next 00/12] selftest: Clean-up and stabilize mirroring tests

2024-06-28 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by David S. Miller : On Thu, 27 Jun 2024 16:48:37 +0200 you wrote: > The mirroring selftests work by sending ICMP traffic between two hosts. > Along the way, this traffic is mirrored to a gretap netdevice, and counter > taps are then in

[PATCH v6 4/4] KVM: riscv: selftests: Add Svade and Svadu Extension to get-reg-list test

2024-06-28 Thread Yong-Xuan Wang
Update the get-reg-list test to test the Svade and Svadu Extensions are available for guest OS. Signed-off-by: Yong-Xuan Wang Reviewed-by: Andrew Jones --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 8 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/kvm/ri

Testing Quality Call notes - 2024-06-27

2024-06-28 Thread Laura Nao
Hello, KernelCI is hosting a bi-weekly call on Thursday to discuss improvements to existing upstream tests, the development of new tests to increase kernel testing coverage, and the enablement of these tests in KernelCI. In recent months, we at Collabora have focused on various kernel areas, as

[PATCH v3 7/7] iommufd/selftest: Add coverage for iommufd pasid attach/detach

2024-06-28 Thread Yi Liu
This tests iommufd pasid attach/replace/detach. Signed-off-by: Yi Liu --- tools/testing/selftests/iommu/iommufd.c | 207 ++ .../selftests/iommu/iommufd_fail_nth.c| 28 ++- tools/testing/selftests/iommu/iommufd_utils.h | 78 +++ 3 files changed, 309 insertions(

[PATCH v3 6/7] iommufd/selftest: Add test ops to test pasid attach/detach

2024-06-28 Thread Yi Liu
This adds 4 test ops for pasid attach/replace/detach testing. There are ops to attach/detach pasid, and also op to check the attached domain of a pasid. Signed-off-by: Yi Liu --- drivers/iommu/iommufd/iommufd_test.h | 30 ++ drivers/iommu/iommufd/selftest.c | 135 +++

[PATCH v3 5/7] iommufd/selftest: Add a helper to get test device

2024-06-28 Thread Yi Liu
There is need to get the selftest device (sobj->type == TYPE_IDEV) in multiple places, so have a helper to for it. Signed-off-by: Yi Liu --- drivers/iommu/iommufd/selftest.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/iommu/iommu

[PATCH v3 3/7] iommufd: Support attach/replace hwpt per pasid

2024-06-28 Thread Yi Liu
This introduces three APIs for device drivers to manage pasid attach/ replace/detach. int iommufd_device_pasid_attach(struct iommufd_device *idev, u32 pasid, u32 *pt_id); int iommufd_device_pasid_replace(struct iommufd_device *idev,

[PATCH v3 4/7] iommufd/selftest: Add set_dev_pasid and remove_dev_pasid in mock iommu

2024-06-28 Thread Yi Liu
The two callbacks are needed to make pasid_attach/detach path complete for mock device. A nop is enough for set_dev_pasid, a domain type check in the remove_dev_pasid is also helpful. Signed-off-by: Yi Liu --- drivers/iommu/iommufd/selftest.c | 39 1 file changed

[PATCH v3 2/7] iommufd: Pass pasid through the device attach/replace path

2024-06-28 Thread Yi Liu
Most of the core logic before conducting the actual device attach/ replace operation can be shared with pasid attach/replace. So pass pasid through the device attach/replace helpers to prepare adding pasid attach/replace. Signed-off-by: Kevin Tian Signed-off-by: Yi Liu --- drivers/iommu/iommufd

[PATCH v3 0/7] iommufd support pasid attach/replace

2024-06-28 Thread Yi Liu
PASID (Process Address Space ID) is a PCIe extension to tag the DMA transactions out of a physical device, and most modern IOMMU hardware have supported PASID granular address translation. So a PASID-capable device can be attached to multiple hwpts (a.k.a. domains), each attachment is tagged with a

[PATCH v3 1/7] iommu: Introduce a replace API for device pasid

2024-06-28 Thread Yi Liu
Provide a high-level API to allow replacements of one domain with another for specific pasid of a device. This is similar to iommu_group_replace_domain() and it is expected to be used only by IOMMUFD. Co-developed-by: Lu Baolu Signed-off-by: Lu Baolu Signed-off-by: Yi Liu --- drivers/iommu/iom

Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-06-28 Thread Maciej Wieczor-Retman
On 2024-06-27 at 09:30:24 -0700, Reinette Chatre wrote: >Hi Maciej > >On 6/27/24 2:50 AM, Maciej Wieczor-Retman wrote: >> >> Yeah, I've been thinking about what is the best way to display these for a >> while. Maybe you're right that messages at the top will be lost. What about >> this >> set of

Re: [PATCH] selftests/proc: fix unused result warning during test compilation

2024-06-28 Thread Abhinav Jain
On Tue, 25 Jun 2024 11:05:26 -0700, Andrew Morton wrote: > Thanks. There's a patch queued which simply deletes this code. > > https://lkml.kernel.org/r/20240603124220.33778-1-amer.shanaw...@gmail.com Thank you for sharing the queued patch Andrew. There has been no update/revert on it, may I know