[PATCH net-next v11 12/23] ovpn: implement TCP transport

2024-10-29 Thread Antonio Quartulli
With this change ovpn is allowed to communicate to peers also via TCP. Parsing of incoming messages is implemented through the strparser API. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig | 1 + drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 4 + drivers/net/

Re: [PATCH v2 2/3] rust: macros: add macro to easily run KUnit tests

2024-10-29 Thread Boqun Feng
Hi David, On Tue, Oct 29, 2024 at 05:24:18PM +0800, David Gow wrote: > From: José Expósito > > Add a new procedural macro (`#[kunit_tests(kunit_test_suit_name)]`) to > run KUnit tests using a user-space like syntax. > > The macro, that should be used on modules, transforms every `#[test]` > in

[PATCH] kselftest/arm64: Use ksft_perror() to log MTE failures

2024-10-29 Thread Mark Brown
The logging in the allocation helpers variously uses ksft_print_msg() with very intermittent logging of errno and perror() (which won't produce KTAP conformant output) when logging the result of API calls that set errno. Standardise on using the ksft_perror() helper in these cases so that more info

Re: [PATCH] kselftest/arm64: Use ksft_perror() to log MTE failures

2024-10-29 Thread Lorenzo Stoakes
On Tue, Oct 29, 2024 at 12:34:21PM +, Mark Brown wrote: > The logging in the allocation helpers variously uses ksft_print_msg() with > very intermittent logging of errno and perror() (which won't produce KTAP > conformant output) when logging the result of API calls that set errno. > Standardis

RE: [PATCH v5 02/13] iommufd/selftest: Add IOMMU_VDEVICE_ALLOC test coverage

2024-10-29 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, October 26, 2024 7:51 AM > > Add a vdevice_alloc op to the viommu mock_viommu_ops for the coverage > of > IOMMU_VIOMMU_TYPE_SELFTEST allocations. Then, add a vdevice_alloc > TEST_F > to cover the IOMMU_VDEVICE_ALLOC ioctl. > > Signed-off-by: Nicolin Chen

[PATCH net-next v11 14/23] ovpn: implement peer lookup logic

2024-10-29 Thread Antonio Quartulli
In a multi-peer scenario there are a number of situations when a specific peer needs to be looked up. We may want to lookup a peer by: 1. its ID 2. its VPN destination IP 3. its transport IP/port couple For each of the above, there is a specific routing table referencing all peers for fast look u

[PATCH net-next v11 01/23] netlink: add NLA_POLICY_MAX_LEN macro

2024-10-29 Thread Antonio Quartulli
Similarly to NLA_POLICY_MIN_LEN, NLA_POLICY_MAX_LEN defines a policy with a maximum length value. The netlink generator for YAML specs has been extended accordingly. Signed-off-by: Antonio Quartulli Reviewed-by: Donald Hunter --- include/net/netlink.h | 1 + tools/net/ynl/ynl-gen-c.py | 4

[PATCH net-next v11 23/23] testing/selftests: add test tool and scripts for ovpn module

2024-10-29 Thread Antonio Quartulli
The ovpn-cli tool can be compiled and used as selftest for the ovpn kernel module. [NOTE: it depends on libmedtls for decoding base64-encoded keys] ovpn-cli implements the netlink and RTNL APIs and can thus be integrated in any script for more automated testing. Along with the tool, 4 scripts ar

RE: [PATCH v5 11/13] Documentation: userspace-api: iommufd: Update vDEVICE

2024-10-29 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, October 26, 2024 7:51 AM > > With the introduction of the new object and its infrastructure, update the > doc and the vIOMMU graph to reflect that. > > Reviewed-by: Jason Gunthorpe > Signed-off-by: Nicolin Chen Reviewed-by: Kevin Tian

Re: [PATCH v2 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-29 Thread Sebastian Andrzej Siewior
On 2024-10-28 15:01:55 [+0100], Frederic Weisbecker wrote: > > diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h > > index 457151f9f263d..9637af78087f3 100644 > > --- a/include/linux/interrupt.h > > +++ b/include/linux/interrupt.h > > @@ -616,6 +616,50 @@ extern void __raise_softir

RE: [PATCH v5 12/13] iommu/arm-smmu-v3: Add arm_vsmmu_cache_invalidate

2024-10-29 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, October 26, 2024 7:51 AM > > Implement the vIOMMU's cache_invalidate op for user space to invalidate > the > IOTLB entries, Device ATS and CD entries that are still cached by hardware. > > Add struct iommu_viommu_arm_smmuv3_invalidate defining invalidation

RE: [PATCH v5 09/13] iommufd/selftest: Add IOMMU_TEST_OP_DEV_CHECK_CACHE test command

2024-10-29 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, October 26, 2024 7:51 AM > > Similar to IOMMU_TEST_OP_MD_CHECK_IOTLB verifying a mock_domain's > iotlb, > IOMMU_TEST_OP_DEV_CHECK_CACHE will be used to verify a mock_dev's > cache. > > Signed-off-by: Nicolin Chen Reviewed-by: Kevin Tian

RE: [PATCH v5 00/13] iommufd: Add vIOMMU infrastructure (Part-2: vDEVICE)

2024-10-29 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Monday, October 28, 2024 10:17 PM > > > > to > > > a Context Table. This virt_id helps IOMMU drivers to link the vID to a pID > > > of the device against the physical IOMMU instance. This is essential for a > > > vIOMMU-based invalidation, where the request contain

RE: [PATCH v5 03/13] iommu/viommu: Add cache_invalidate to iommufd_viommu_ops

2024-10-29 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, October 26, 2024 7:51 AM > > This per-vIOMMU cache_invalidate op is like the cache_invalidate_user op > in struct iommu_domain_ops, but wider, supporting device cache (e.g. PCI > ATC invaldiations). > > Reviewed-by: Jason Gunthorpe > Signed-off-by: Nicolin

[PATCH net-next v11 13/23] ovpn: implement multi-peer support

2024-10-29 Thread Antonio Quartulli
With this change an ovpn instance will be able to stay connected to multiple remote endpoints. This functionality is strictly required when running ovpn on an OpenVPN server. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 55 +- drivers/net/ovpn/ovpnstruct.h |

[PATCH net-next v11 17/23] ovpn: add support for peer floating

2024-10-29 Thread Antonio Quartulli
A peer connected via UDP may change its IP address without reconnecting (float). Add support for detecting and updating the new peer IP/port in case of floating. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/bind.c | 10 ++-- drivers/net/ovpn/io.c | 9 drivers/net/ovpn/peer.c

[PATCH net-next v11 04/23] ovpn: add basic interface creation/destruction/management routines

2024-10-29 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 115 -- drivers/net/ovpn/main.h | 7 +++ drivers/net/ovpn/ovpnstruct.h | 8 +++ drivers/net/ovpn/packet.h | 40 ++

[PATCH net-next v11 06/23] ovpn: introduce the ovpn_peer object

2024-10-29 Thread Antonio Quartulli
An ovpn_peer object holds the whole status of a remote peer (regardless whether it is a server or a client). This includes status for crypto, tx/rx buffers, napi, etc. Only support for one peer is introduced (P2P mode). Multi peer support is introduced with a later patch. Along with the ovpn_pee

[PATCH net-next v11 08/23] ovpn: implement basic TX path (UDP)

2024-10-29 Thread Antonio Quartulli
Packets sent over the ovpn interface are processed and transmitted to the connected peer, if any. Implementation is UDP only. TCP will be added by a later patch. Note: no crypto/encapsulation exists yet. packets are just captured and sent. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/

[PATCH net-next v11 05/23] ovpn: keep carrier always on

2024-10-29 Thread Antonio Quartulli
An ovpn interface will keep carrier always on and let the user decide when an interface should be considered disconnected. This way, even if an ovpn interface is not connected to any peer, it can still retain all IPs and routes and thus prevent any data leak. Signed-off-by: Antonio Quartulli Rev

[PATCH net-next v11 03/23] ovpn: add basic netlink support

2024-10-29 Thread Antonio Quartulli
This commit introduces basic netlink support with family registration/unregistration functionalities and stub pre/post-doit. More importantly it introduces the YAML uAPI description along with its auto-generated files: - include/uapi/linux/ovpn.h - drivers/net/ovpn/netlink-gen.c - drivers/net/ovpn

[PATCH v5 2/2] selftests/resctrl: Adjust SNC support messages

2024-10-29 Thread Maciej Wieczor-Retman
Resctrl selftest prints a message on test failure that Sub-Numa Clustering (SNC) could be enabled and points the user to check their BIOS settings. No actual check is performed before printing that message so it is not very accurate in pinpointing a problem. Figuring out if SNC is enabled is only

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

2024-10-29 Thread Maciej Wieczor-Retman
Sub-NUMA Cluster divides CPUs sharing an L3 cache into separate NUMA nodes. Systems may support splitting into either two, three or four nodes. When SNC mode is enabled the effective amount of L3 cache available for allocation is divided by the number of nodes per L3. Detect which SNC mode is act

[PATCH net-next v11 09/23] ovpn: implement basic RX path (UDP)

2024-10-29 Thread Antonio Quartulli
Packets received over the socket are forwarded to the user device. Implementation is UDP only. TCP will be added by a later patch. Note: no decryption/decapsulation exists yet, packets are forwarded as they arrive without much processing. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/i

[PATCH net-next v11 11/23] ovpn: store tunnel and transport statistics

2024-10-29 Thread Antonio Quartulli
Byte/packet counters for in-tunnel and transport streams are now initialized and updated as needed. To be exported via netlink. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/crypto_aead.c | 2 ++ drivers/net/ovpn/io.c | 11 ++ dri

[PATCH net-next v11 22/23] ovpn: add basic ethtool support

2024-10-29 Thread Antonio Quartulli
Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++ 1 file chan

[PATCH net-next v11 18/23] ovpn: implement peer add/get/dump/delete via netlink

2024-10-29 Thread Antonio Quartulli
This change introduces the netlink command needed to add, delete and retrieve/dump known peers. Userspace is expected to use these commands to handle known peer lifecycles. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/netlink.c | 578 - driver

[PATCH net-next v11 19/23] ovpn: implement key add/get/del/swap via netlink

2024-10-29 Thread Antonio Quartulli
This change introduces the netlink commands needed to add, get, delete and swap keys for a specific peer. Userspace is expected to use these commands to create, inspect (non sensible data only), destroy and rotate session keys for a specific peer. Signed-off-by: Antonio Quartulli --- drivers/ne

[PATCH net-next v11 21/23] ovpn: notify userspace when a peer is deleted

2024-10-29 Thread Antonio Quartulli
Whenever a peer is deleted, send a notification to userspace so that it can react accordingly. This is most important when a peer is deleted due to ping timeout, because it all happens in kernelspace and thus userspace has no direct way to learn about it. Signed-off-by: Antonio Quartulli --- dr

[PATCH net-next v11 16/23] ovpn: add support for updating local UDP endpoint

2024-10-29 Thread Antonio Quartulli
In case of UDP links, the local endpoint used to communicate with a given peer may change without a connection restart. Add support for learning the new address in case of change. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/peer.c | 45 + dr

[PATCH net-next v11 15/23] ovpn: implement keepalive mechanism

2024-10-29 Thread Antonio Quartulli
OpenVPN supports configuring a periodic keepalive packet. message to allow the remote endpoint detect link failures. This change implements the keepalive sending and timer expiring logic. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 77 + drivers/net/ovp

[PATCH net-next v11 00/23] Introducing OpenVPN Data Channel Offload

2024-10-29 Thread Antonio Quartulli
Notable changes from v10: * extended commit message of 23/23 with brief description of the output * Link to v10: https://lore.kernel.org/r/20241025-b4-ovpn-v10-0-b87530777...@openvpn.net Please note that some patches were already reviewed by Andre Lunn, Donald Hunter and Shuah Khan. They have ret

[PATCH net-next v11 02/23] net: introduce OpenVPN Data Channel Offload (ovpn)

2024-10-29 Thread Antonio Quartulli
OpenVPN is a userspace software existing since around 2005 that allows users to create secure tunnels. So far OpenVPN has implemented all operations in userspace, which implies several back and forth between kernel and user land in order to process packets (encapsulate/decapsulate, encrypt/decrypt

[PATCH net-next v11 10/23] ovpn: implement packet processing

2024-10-29 Thread Antonio Quartulli
This change implements encryption/decryption and encapsulation/decapsulation of OpenVPN packets. Support for generic crypto state is added along with a wrapper for the AEAD crypto kernel API. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 3 + drivers/net/ovpn/crypto.c

[PATCH v5 0/2] selftests/resctrl: SNC kernel support discovery

2024-10-29 Thread Maciej Wieczor-Retman
Changes v5: - Tests are skipped if snc_unreliable was set. - Moved resctrlfs.c changes from patch 2/2 to 1/2. - Removed CAT changes since it's not impacted by SNC in the selftest. - Updated various comments. - Fixed a bunch of minor issues pointed out in the review. Changes v4: - Printing SNC warn

Re: [PATCH V2 4/4] selftests/mm: skip virtual_address_range tests on riscv

2024-10-29 Thread Chunyan Zhang
Hi Andrew, On Fri, 25 Oct 2024 at 02:00, Palmer Dabbelt wrote: > > On Tue, 08 Oct 2024 02:41:41 PDT (-0700), zhangchun...@iscas.ac.cn wrote: > > RISC-V doesn't currently have the behavior of restricting the virtual > > address space which virtual_address_range tests check, this will > > cause the

[PATCH net-next v11 07/23] ovpn: introduce the ovpn_socket object

2024-10-29 Thread Antonio Quartulli
This specific structure is used in the ovpn kernel module to wrap and carry around a standard kernel socket. ovpn takes ownership of passed sockets and therefore an ovpn specific objects is attached to them for status tracking purposes. Initially only UDP support is introduced. TCP will come in a

Re: [PATCH v2 1/3] rust: kunit: add KUnit case and suite macros

2024-10-29 Thread Alice Ryhl
On Tue, Oct 29, 2024 at 10:24 AM David Gow wrote: > > From: José Expósito > > Add a couple of Rust const functions and macros to allow to develop > KUnit tests without relying on generated C code: > > - The `kunit_unsafe_test_suite!` Rust macro is similar to the >`kunit_test_suite` C macro.

[PATCH net-next v11 20/23] ovpn: kill key and notify userspace in case of IV exhaustion

2024-10-29 Thread Antonio Quartulli
IV wrap-around is cryptographically dangerous for a number of ciphers, therefore kill the key and inform userspace (via netlink) should the IV space go exhausted. Userspace has two ways of deciding when the key has to be renewed before exhausting the IV space: 1) time based approach: after X se

Re: [PATCH 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress

2024-10-29 Thread Mark Brown
On Tue, Oct 29, 2024 at 03:43:37PM +, Mark Rutland wrote: > On those emulated platforms (FVP?), does this change trigger the faukure > more often? Yes. > I gave this a quick test, and with this change, running fp-stress on a > defconfig kernel running on 1 CPU triggers the "Bad SVCR: 0" spla

Re: [PATCH v5 09/13] iommufd/selftest: Add refcount to mock_iommu_device

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 09:02:58AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 12:34:38PM -0300, Jason Gunthorpe wrote: > > On Fri, Oct 25, 2024 at 04:49:49PM -0700, Nicolin Chen wrote: > > > For an iommu_dev that can unplug (so far only this selftest does so), the > > > viommu->iommu_dev

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 09:07:38AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 12:27:46PM -0300, Jason Gunthorpe wrote: > > On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote: > > > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > > > In iommufd_hwpt_paging_allo

Re: [PATCH v5 05/13] iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 04:09:41PM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:50:34PM -0700, Nicolin Chen wrote: > > @@ -497,17 +497,35 @@ int iommufd_hwpt_invalidate(struct iommufd_ucmd *ucmd) > > goto out; > > } > > > > - hwpt = iommufd_get_hwpt_nested(ucmd, cm

[PATCH net-next v1 1/7] net: page_pool: rename page_pool_alloc_netmem to *_netmems

2024-10-29 Thread Mina Almasry
page_pool_alloc_netmem (without an s) was the mirror of page_pool_alloc_pages (with an s), which was confusing. Rename to page_pool_alloc_netmems so it's the mirror of page_pool_alloc_pages. Signed-off-by: Mina Almasry --- include/net/page_pool/types.h | 2 +- net/core/page_pool.c | 8

Re: [PATCH for-next 4/7] selftests/net: Add missing gitignore file

2024-10-29 Thread Jakub Kicinski
On Fri, 25 Oct 2024 09:40:07 +0800 Li Zhijian wrote: > diff --git a/tools/testing/selftests/net/netfilter/.gitignore > b/tools/testing/selftests/net/netfilter/.gitignore > index 0a64d6d0e29a..eef8d5784e94 100644 > --- a/tools/testing/selftests/net/netfilter/.gitignore > +++ b/tools/testing/selftes

Re: [PATCH for-next 7/7] selftests/net: Fix ./ns-XXXXXX not cleanup

2024-10-29 Thread Jakub Kicinski
On Tue, 29 Oct 2024 16:43:06 -0700 Jakub Kicinski wrote: > Similarly to patch 6 I meant patch 4, not patch 6

Re: [PATCH for-next 7/7] selftests/net: Fix ./ns-XXXXXX not cleanup

2024-10-29 Thread Jakub Kicinski
On Fri, 25 Oct 2024 09:40:10 +0800 Li Zhijian wrote: > ``` > readonly STATS="$(mktemp -p /tmp ns-XX)" > readonly BASE=`basename $STATS` > ``` > It could be a mistake to write to $BASE rather than $STATS, where $STATS > is used to save the NSTAT_HISTORY and it will be cleaned up before exit. Ag

Re: [PATCH] scripts: Remove export_report.pl

2024-10-29 Thread Sami Tolvanen
Hi Matt, On Tue, Oct 29, 2024 at 2:12 PM Matthew Maurer wrote: > > This script has been broken for 5 years with no user complaints. > > It first had its .mod.c parser broken in commit a3d0cb04f7df ("modpost: > use __section in the output to *.mod.c"). Later, it had its object file > enumeration b

[PATCH v2 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress

2024-10-29 Thread Mark Brown
Currently we only deliver signals to the processes being tested about once a second, meaning that the signal code paths are subject to relatively little stress. Increase this frequency substantially to 25ms intervals, along with some minor refactoring to make this more readily tuneable and maintain

[PATCH] scripts: Remove export_report.pl

2024-10-29 Thread Matthew Maurer
ymbol reports the number of modules using it\n"); - -print "\nNOTE: Got $modversion_warnings CONFIG_MODVERSIONS warnings\n\n" -if $modversion_warnings; - -print "~"x80 , "\n"; -for my $thismod (sort keys %MODULE) { - my $list = $MODULE{$thismod}; - my %depends; - $thismod =~ s/\.mod\.c/.ko/; - print "\t\t\t$thismod\n"; - foreach my $symbol (@{$list}) { - my ($module, $value, undef, $gpl) = @{$SYMBOL{$symbol}}; - push (@{$depends{"$module"}}, "$symbol $value"); - } - print_depends_on(\%depends); -} --- base-commit: 6fb2fa9805c501d9ade047fc511961f3273cdcb5 change-id: 20241029-remove-export-report-pl-7365c6ca3bee Best regards, -- Matthew Maurer

RE: [PATCH v5 04/13] iommufd/hw_pagetable: Enforce invalidation op on vIOMMU-based hwpt_nested

2024-10-29 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Wednesday, October 30, 2024 12:05 AM > > On Tue, Oct 29, 2024 at 08:22:43AM +, Tian, Kevin wrote: > > > From: Nicolin Chen > > > Sent: Saturday, October 26, 2024 7:51 AM > > > > > > @@ -302,7 +302,9 @@ iommufd_viommu_alloc_hwpt_nested(struct > > > iommufd_viom

[PATCH net-next v1 6/7] net: fix SO_DEVMEM_DONTNEED looping too long

2024-10-29 Thread Mina Almasry
Check we're going to free a reasonable number of frags in token_count before starting the loop, to prevent looping too long. Also minor code cleanups: - Flip checks to reduce indentation. - Use sizeof(*tokens) everywhere for consistentcy. Cc: Yi Lai Signed-off-by: Mina Almasry --- net/core/s

[PATCH net-next v1 7/7] ncdevmem: add test for too many token_count

2024-10-29 Thread Mina Almasry
Add test for fixed issue: user passing a token with a very large token_count. Expect an error in this case. Signed-off-by: Mina Almasry --- tools/testing/selftests/net/ncdevmem.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/testing/selftests/net/ncdevmem.c b/tools/test

[PATCH net-next v1 2/7] net: page_pool: create page_pool_alloc_netmem

2024-10-29 Thread Mina Almasry
Create page_pool_alloc_netmem to be the mirror of page_pool_alloc. This enables drivers that want currently use page_pool_alloc to transition to netmem by converting the call sites to page_pool_alloc_netmem. Signed-off-by: Mina Almasry --- include/net/page_pool/helpers.h | 25 --

[PATCH net-next v1 4/7] page_pool: disable sync for cpu for dmabuf memory provider

2024-10-29 Thread Mina Almasry
dmabuf dma-addresses should not be dma_sync'd for CPU/device. Typically its the driver responsibility to dma_sync for CPU, but the driver should not dma_sync for CPU if the netmem is actually coming from a dmabuf memory provider. The page_pool already exposes a helper for dma_sync_for_cpu: page_po

[PATCH net-next v1 5/7] netmem: add netmem_prefetch

2024-10-29 Thread Mina Almasry
prefect(page) is a common thing to be called from drivers. Add netmem_prefetch that can be called on generic netmem. Skips the prefetch for net_iovs. Signed-off-by: Mina Almasry --- include/net/netmem.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/net/netmem.h b/include/net

[PATCH net-next v1 0/7] devmem TCP fixes

2024-10-29 Thread Mina Almasry
A few unrelated devmem TCP fixes bundled in a series for some convenience (if that's ok). Patch 1-2: fix naming and provide page_pool_alloc_netmem for fragged netmem. Patch 3-4: fix issues with dma-buf dma addresses being potentially passed to dma_sync_for_* helpers. Patch 5-6: fix syzbot SO_DEV

[PATCH v3] selftests/net: Add missing gitignore file

2024-10-29 Thread Li Zhijian
Compiled binary files should be added to .gitignore 'git status' complains: Untracked files: (use "git add ..." to include in what will be committed) net/netfilter/conntrack_reverse_clash Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub

Re: [PATCH for-next 7/7] selftests/net: Fix ./ns-XXXXXX not cleanup

2024-10-29 Thread Zhijian Li (Fujitsu)
On 30/10/2024 07:43, Jakub Kicinski wrote: > On Fri, 25 Oct 2024 09:40:10 +0800 Li Zhijian wrote: >> ``` >> readonly STATS="$(mktemp -p /tmp ns-XX)" >> readonly BASE=`basename $STATS` >> ``` >> It could be a mistake to write to $BASE rather than $STATS, where $STATS >> is used to save the NST

[PATCH v3] selftests/net: Fix ./ns-XXXXXX not cleanup

2024-10-29 Thread Li Zhijian
``` readonly STATS="$(mktemp -p /tmp ns-XX)" readonly BASE=`basename $STATS` ``` It could be a mistake to write to $BASE rather than $STATS, where $STATS is used to save the NSTAT_HISTORY and it will be cleaned up before exit. Although since we've been creating the wrong file this whole time a

Re: [PATCH] selftest/hid: increase timeout to 10 min

2024-10-29 Thread Shuah Khan
On 10/29/24 03:07, Yun Lu wrote: If running hid testcases with command "./run_kselftest.sh -c hid", NIT - When inestead of "If" the following tests will take longer than the kselftest framework timeout (now 200 seconds) to run and thus got terminated with TIMEOUT error: hid-multitouch.sh -

Re: [PATCH v5 01/13] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 12:30:00PM -0700, Nicolin Chen wrote: > > iommufd_device_unbind() can't fail, and if the object can't be > > destroyed because it has an elevated long term refcount it WARN's: > > > > > > ret = iommufd_object_remove(ictx, obj, obj->id, REMOVE_WAIT_SHORTTERM); > > > >

Re: [PATCH net-next v5 03/12] selftests: ncdevmem: Unify error handling

2024-10-29 Thread Jakub Kicinski
On Wed, 23 Oct 2024 08:43:53 -0700 Stanislav Fomichev wrote: > ret = inet_pton(server_sin.sin_family, server_ip, &server_sin.sin_addr); > - if (socket < 0) > - error(79, 0, "%s: [FAIL, create socket]\n", TEST_PREFIX); > + if (ret < 0) > + error(1, pton, "%s: [F

[PATCH v2 0/2] kselftest/arm64: fp-stress signal delivery interval improvements

2024-10-29 Thread Mark Brown
message and log output. - Link to v1: https://lore.kernel.org/r/20241029-arm64-fp-stress-interval-v1-0-db540abf6...@kernel.org --- Mark Brown (2): kselftest/arm64: Increase frequency of signal delivery in fp-stress kselftest/arm64: Poll less often while waiting for fp-stress children

Re: [PATCH] remoteproc: qcom: pas: Make remoteproc name human friendly

2024-10-29 Thread Chris Lew
On 10/21/2024 9:21 PM, Bjorn Andersson wrote: The remoteproc "name" property is supposed to present the "human readable" name of the remoteproc, while using the device name is readable, it's not "friendly". Instead, use the "sysmon_name" as the identifier for the remoteproc instance. It match

[PATCH net-next v1 3/7] page_pool: Set `dma_sync` to false for devmem memory provider

2024-10-29 Thread Mina Almasry
From: Samiullah Khawaja Move the `dma_map` and `dma_sync` checks to `page_pool_init` to make them generic. Set dma_sync to false for devmem memory provider because the dma_sync APIs should not be used for dma_buf backed devmem memory provider. Cc: Jason Gunthorpe Signed-off-by: Samiullah Khawaj

[PATCH net-next v1 0/7] devmem TCP fixes

2024-10-29 Thread Mina Almasry
A few unrelated devmem TCP fixes bundled in a series for some convenience (if that's ok). Patch 1-2: fix naming and provide page_pool_alloc_netmem for fragged netmem. Patch 3-4: fix issues with dma-buf dma addresses being potentially passed to dma_sync_for_* helpers. Patch 5-6: fix syzbot SO_DEV

Re: [PATCH v2 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-29 Thread Frederic Weisbecker
Le Tue, Oct 29, 2024 at 02:52:31PM +0100, Sebastian Andrzej Siewior a écrit : > On 2024-10-28 15:01:55 [+0100], Frederic Weisbecker wrote: > > > diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h > > > index 457151f9f263d..9637af78087f3 100644 > > > --- a/include/linux/interrupt.h >

Re: [PATCH v5 07/13] iommufd/selftest: Add container_of helpers

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:47PM -0700, Nicolin Chen wrote: > Use these inline helpers to shorten those container_of lines. > > Note that one of them goes back and forth between iommu_domain and > mock_iommu_domain, which isn't necessary. So drop its container_of. > > Signed-off-by: Nicolin Che

Re: [PATCH v5 08/13] iommufd/selftest: Prepare for mock_viommu_alloc_domain_nested()

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:48PM -0700, Nicolin Chen wrote: > A nested domain now can be allocated for a parent domain for a vIOMMU > object. Rework the existing allocators to prepare for the latter case. > > Signed-off-by: Nicolin Chen > --- > drivers/iommu/iommufd/selftest.c | 89 +++

[PATCH] selftests/lam: Test get_user() LAM pointer handling

2024-10-29 Thread Maciej Wieczor-Retman
Recent change in how get_user() handles pointers [1] has a specific case for LAM. It assigns a different bitmask that's later used to check whether a pointer comes from userland in get_user(). While currently commented out (until LASS [2] is merged into the kernel) it's worth making changes to the

Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-29 Thread Jason Gunthorpe
On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote: > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote: > > On Mon, Oct 28, 2024 at 11:24:10AM +0800, Zhangfei Gao wrote: > > > > > > +/** > > > > + * iommufd_viommu_alloc_hwpt_nested() - Get a hwpt_nested for a vIOMMU > > >

Re: [PATCH v2] selftests: tc-testing: Fix typo error

2024-10-29 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Tue, 22 Oct 2024 18:30:52 + you wrote: > Correct the typo errors in json files > > - "diffferent" is corrected to "different". > - "muliple" and "miltiple" is corrected to "multiple". > > Reviewed-by: Simon H

Re: [PATCH v5 05/13] iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:50:34PM -0700, Nicolin Chen wrote: > @@ -497,17 +497,35 @@ int iommufd_hwpt_invalidate(struct iommufd_ucmd *ucmd) > goto out; > } > > - hwpt = iommufd_get_hwpt_nested(ucmd, cmd->hwpt_id); > - if (IS_ERR(hwpt)) { > - rc = PTR_ERR(h

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > > +void iommufd_viommu_destroy(struct iommufd_object *obj) > > +{ > > + struct iommufd_viommu *viommu = > > + container_of(obj, struct iommufd_viommu, obj);

Re: [PATCH v5 01/13] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:58:24PM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:50:30PM -0700, Nicolin Chen wrote: > > diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c > > index 5fd3dd420290..e50113305a9c 100644 > > --- a/drivers/iommu/iommufd/device.c > >

Re: [PATCH v5 01/13] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:50:30PM -0700, Nicolin Chen wrote: > +/** > + * struct iommu_vdevice_alloc - ioctl(IOMMU_VDEVICE_ALLOC) > + * @size: sizeof(struct iommu_vdevice_alloc) > + * @viommu_id: vIOMMU ID to associate with the virtual device > + * @dev_id: The pyhsical device to allocate a virtua

Re: [PATCH v5 02/13] iommufd/selftest: Add IOMMU_VDEVICE_ALLOC test coverage

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:50:31PM -0700, Nicolin Chen wrote: > Add a vdevice_alloc op to the viommu mock_viommu_ops for the coverage of > IOMMU_VIOMMU_TYPE_SELFTEST allocations. Then, add a vdevice_alloc TEST_F > to cover the IOMMU_VDEVICE_ALLOC ioctl. > > Signed-off-by: Nicolin Chen > --- > to

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 08:46:40AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 12:36:24PM -0300, Jason Gunthorpe wrote: > > On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > > > On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > > > > +void iommufd_viommu_dest

Re: [PATCH v5 05/13] iommufd: Add alloc_domain_nested op to iommufd_viommu_ops

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:45PM -0700, Nicolin Chen wrote: > Allow IOMMU driver to use a vIOMMU object that holds a nesting parent > hwpt/domain to allocate a nested domain. > > Suggested-by: Jason Gunthorpe > Reviewed-by: Kevin Tian > Signed-off-by: Nicolin Chen > --- > include/linux/iommu

Re: [PATCH v5 04/13] iommufd/hw_pagetable: Enforce invalidation op on vIOMMU-based hwpt_nested

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:50:33PM -0700, Nicolin Chen wrote: > A vIOMMU-based hwpt_nested requires a cache invalidation op too, either > using the one in iommu_domain_ops or the one in viommu_ops. Enforce that > upon the allocated hwpt_nested. > > Signed-off-by: Nicolin Chen > --- > drivers/iom

Re: [PATCH v5 09/13] iommufd/selftest: Add refcount to mock_iommu_device

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:34:38PM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:49:49PM -0700, Nicolin Chen wrote: > > For an iommu_dev that can unplug (so far only this selftest does so), the > > viommu->iommu_dev pointer has no guarantee of its life cycle after it is > > copied from

Re: [PATCH v5 03/13] iommufd: Add iommufd_verify_unfinalized_object

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:43PM -0700, Nicolin Chen wrote: > To support driver-allocated vIOMMU objects, it's suggested to call the > allocator helper in IOMMU dirvers. However, there is no guarantee that > drivers will all use it and allocate objects properly. > > Add a helper for iommufd core

Re: [PATCH v3 rcu 3/3] rcu: Finer-grained grace-period-end checks in rcu_dump_cpu_stacks()

2024-10-29 Thread Paul E. McKenney
On Tue, Oct 29, 2024 at 02:20:51AM +, Cheng-Jui Wang (王正睿) wrote: > On Mon, 2024-10-28 at 17:22 -0700, Paul E. McKenney wrote: > > The result is that the current leaf rcu_node structure's ->lock is > > acquired only if a stack backtrace might be needed from the current CPU, > > and is held acro

Re: [PATCH v5 01/13] iommufd/viommu: Add IOMMUFD_OBJ_VDEVICE and IOMMU_VDEVICE_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 10:29:56AM -0700, Nicolin Chen wrote: > On Tue, Oct 29, 2024 at 12:58:24PM -0300, Jason Gunthorpe wrote: > > On Fri, Oct 25, 2024 at 04:50:30PM -0700, Nicolin Chen wrote: > > > diff --git a/drivers/iommu/iommufd/device.c > > > b/drivers/iommu/iommufd/device.c > > > index 5f

Re: [PATCH v5 03/13] iommufd: Add iommufd_verify_unfinalized_object

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 03:55:58PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 29, 2024 at 09:18:05AM -0700, Nicolin Chen wrote: > > On Tue, Oct 29, 2024 at 11:49:07AM -0300, Jason Gunthorpe wrote: > > > On Fri, Oct 25, 2024 at 04:49:43PM -0700, Nicolin Chen wrote: > > > > To support driver-allocat

[PATCH v4 0/2] vsock/test: fix wrong setsockopt() parameters

2024-10-29 Thread Konstantin Shkolnyy
Parameters were created using wrong C types, which caused them to be of wrong size on some architectures, causing problems. The problem with SO_RCVLOWAT was found on s390 (big endian), while x86-64 didn't show it. After the fix, all tests pass on s390. Then Stefano Garzarella pointed out that SO_V

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > +void iommufd_viommu_destroy(struct iommufd_object *obj) > +{ > + struct iommufd_viommu *viommu = > + container_of(obj, struct iommufd_viommu, obj); > + > + if (viommu->ops && viommu->ops->free) > + viom

Re: [PATCH] rpmsg_ns: Work around TI non-standard message

2024-10-29 Thread Romain Naour
Hello Richard, All, Le 15/10/2024 à 20:00, Richard Weinberger a écrit : > Am Dienstag, 15. Oktober 2024, 19:56:08 CEST schrieb Mathieu Poirier: In my opinion the real fix here is to get TI to use the standard message announcement structure. The ->desc field doesn't seem to be that usefu

Re: [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs

2024-10-29 Thread Mathieu Poirier
I have applied all 3 patches in this set. Thanks, Mathieu On Mon, Oct 21, 2024 at 03:45:55PM -0500, Andrew Davis wrote: > While it should be safe to use normal memset() on these memories as they > are mapped as Normal Non-Cached, using the memset_io() provides stronger > guarantees on access alig

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:36:24PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > > On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > > > +void iommufd_viommu_destroy(struct iommufd_object *obj) > > > +{ > > > + struct iommufd_viommu

Re: [PATCH 2/2] kselftest/arm64: Lower poll interval while waiting for fp-stress children

2024-10-29 Thread Mark Rutland
Nit: the title says we lower the poll interval, while we actually raise it. Maybe that'd be clearer as: kselftest/arm64: Raise poll timeout while waiting for fp-stress children ... or: kselftest/arm64: Poll less frequently while waiting for fp-stress children That aside, this l

Re: [PATCH v5 10/13] iommufd/selftest: Add IOMMU_VIOMMU_TYPE_SELFTEST

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:50PM -0700, Nicolin Chen wrote: > Implement the viommu alloc/free functions to increase/reduce refcount of > its dependent mock iommu device. User space can verify this loop via the > IOMMU_VIOMMU_TYPE_SELFTEST. > > Signed-off-by: Nicolin Chen > --- > drivers/iommu/

Re: [PATCH v2] kunit: Introduce autorun option

2024-10-29 Thread Rae Moar
On Mon, Oct 28, 2024 at 5:54 PM Stanislav Kinsburskii wrote: > > The new option controls tests run on boot or module load. With the new > debugfs "run" dentry allowing to run tests on demand, an ability to disable > automatic tests run becomes a useful option in case of intrusive tests. > > The op

Re: [PATCH v5 03/13] iommufd: Add iommufd_verify_unfinalized_object

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 11:49:07AM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:49:43PM -0700, Nicolin Chen wrote: > > To support driver-allocated vIOMMU objects, it's suggested to call the > > allocator helper in IOMMU dirvers. However, there is no guarantee that > > drivers will all

Re: [PATCH v3] selftests: add new kallsyms selftests

2024-10-29 Thread Sami Tolvanen
Hi Luis, On Mon, Oct 21, 2024 at 12:33 PM Luis Chamberlain wrote: > > diff --git a/lib/tests/module/gen_test_kallsyms.sh > b/lib/tests/module/gen_test_kallsyms.sh > new file mode 100755 > index ..e85f10dc11bd > --- /dev/null > +++ b/lib/tests/module/gen_test_kallsyms.sh > @@ -0,0 +1,

Re: [PATCH v5 09/13] iommufd/selftest: Add refcount to mock_iommu_device

2024-10-29 Thread Jason Gunthorpe
On Fri, Oct 25, 2024 at 04:49:49PM -0700, Nicolin Chen wrote: > For an iommu_dev that can unplug (so far only this selftest does so), the > viommu->iommu_dev pointer has no guarantee of its life cycle after it is > copied from the idev->dev->iommu->iommu_dev. > > Track the user count of the iommu_

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > On Fri, Oct 25, 2024 at 04:49:44PM -0700, Nicolin Chen wrote: > > +void iommufd_viommu_destroy(struct iommufd_object *obj) > > +{ > > + struct iommufd_viommu *viommu = > > + container_of(obj, struct iommufd_viommu, obj);

Re: [PATCH v5 04/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-29 Thread Nicolin Chen
On Tue, Oct 29, 2024 at 12:59:35PM -0300, Jason Gunthorpe wrote: > On Tue, Oct 29, 2024 at 08:46:40AM -0700, Nicolin Chen wrote: > > On Tue, Oct 29, 2024 at 12:36:24PM -0300, Jason Gunthorpe wrote: > > > On Tue, Oct 29, 2024 at 11:54:36AM -0300, Jason Gunthorpe wrote: > > > > On Fri, Oct 25, 2024 a

Re: [PATCH v5 04/13] iommufd/hw_pagetable: Enforce invalidation op on vIOMMU-based hwpt_nested

2024-10-29 Thread Jason Gunthorpe
On Tue, Oct 29, 2024 at 08:22:43AM +, Tian, Kevin wrote: > > From: Nicolin Chen > > Sent: Saturday, October 26, 2024 7:51 AM > > > > @@ -302,7 +302,9 @@ iommufd_viommu_alloc_hwpt_nested(struct > > iommufd_viommu *viommu, u32 flags, > > } > > hwpt->domain->owner = viommu->iommu_dev->op

  1   2   >