Re: [PATCH v3 03/17] riscv: sbi: add SBI FWFT extension calls

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:10PM +0100, Clément Léger wrote: > Add FWFT extension calls. This will be ratified in SBI V3.0 hence, it is > provided as a separate commit that can be left out if needed. > > Signed-off-by: Clément Léger > --- > arch/riscv/kernel/sbi.c | 30

Re: [PATCH v3 16/17] RISC-V: KVM: add support for FWFT SBI extension

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:23PM +0100, Clément Léger wrote: > Add basic infrastructure to support the FWFT extension in KVM. > > Signed-off-by: Clément Léger > --- > arch/riscv/include/asm/kvm_host.h | 4 + > arch/riscv/include/asm/kvm_vcpu_sbi.h | 1 + > arch/riscv/include/

Re: [PATCH v3 17/17] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:24PM +0100, Clément Léger wrote: > SBI_FWFT_MISALIGNED_DELEG needs hedeleg to be modified to delegate > misaligned load/store exceptions. Save and restore it during CPU > load/put. > > Signed-off-by: Clément Léger > Reviewed-by: Deepak Gupta > --- > arch/riscv/kvm/

Re: [PATCH v3 07/17] riscv: misaligned: move emulated access uniformity check in a function

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:14PM +0100, Clément Léger wrote: > Split the code that check for the uniformity of misaligned accesses > performance on all cpus from check_unaligned_access_emulated_all_cpus() > to its own function which will be used for delegation check. No > functional changes inten

Re: [PATCH v3 08/17] riscv: misaligned: add a function to check misalign trap delegability

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:15PM +0100, Clément Léger wrote: > Checking for the delegability of the misaligned access trap is needed > for the KVM FWFT extension implementation. Add a function to get the > delegability of the misaligned trap exception. > > Signed-off-by: Clément Léger > --- >

Re: [PATCH net-next v7 2/9] net: add get_netmem/put_netmem support

2025-03-13 Thread Mina Almasry
On Thu, Mar 13, 2025 at 3:47 AM Paolo Abeni wrote: > > On 3/8/25 10:40 PM, Mina Almasry wrote: > > Currently net_iovs support only pp ref counts, and do not support a > > page ref equivalent. > > > > This is fine for the RX path as net_iovs are used exclusively with the > > pp and only pp refcount

Re: [PATCH v3 14/17] RISC-V: KVM: add SBI extension init()/deinit() functions

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:21PM +0100, Clément Léger wrote: > The FWFT SBI extension will need to dynamically allocate memory and do > init time specific initialization. Add an init/deinit callbacks that > allows to do so. > > Signed-off-by: Clément Léger > --- > arch/riscv/include/asm/kvm_vc

Re: [PATCH v3 15/17] RISC-V: KVM: add SBI extension reset callback

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:22PM +0100, Clément Léger wrote: > Currently, oonly the STA extension needed a reset function but that's only > going to be the case for FWFT as well. Add a reset callback that can be > implemented by SBI extensions. > > Signed-off-by: Clément Léger > --- > arch/r

Re: [PATCH v3 01/17] riscv: add Firmware Feature (FWFT) SBI extensions definitions

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:08PM +0100, Clément Léger wrote: > The Firmware Features extension (FWFT) was added as part of the SBI 3.0 > specification. Add SBI definitions to use this extension. > > Signed-off-by: Clément Léger > Reviewed-by: Samuel Holland > Tested-by: Samuel Holland > Revie

Re: [PATCH v3 02/17] riscv: sbi: add FWFT extension interface

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:09PM +0100, Clément Léger wrote: > This SBI extensions enables supervisor mode to control feature that are > under M-mode control (For instance, Svadu menvcfg ADUE bit, Ssdbltrp > DTE, etc). > > Signed-off-by: Clément Léger > --- > arch/riscv/include/asm/sbi.h | 5

Re: [PATCH v3 06/17] riscv: misaligned: use correct CONFIG_ ifdef for misaligned_access_speed

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:13PM +0100, Clément Léger wrote: > misaligned_access_speed is defined under CONFIG_RISCV_SCALAR_MISALIGNED > but was used under CONFIG_RISCV_PROBE_UNALIGNED_ACCESS. Fix that by > using the correct config option. > > Signed-off-by: Clément Léger > --- > arch/riscv/ke

Re: [PATCH v3 05/17] riscv: misaligned: use on_each_cpu() for scalar misaligned access probing

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:12PM +0100, Clément Léger wrote: > schedule_on_each_cpu() was used without any good reason while documented > as very slow. This call was in the boot path, so better use > on_each_cpu() for scalar misaligned checking. Vector misaligned check > still needs to use schedu

Re: [PATCH v3 04/17] riscv: misaligned: request misaligned exception from SBI

2025-03-13 Thread Andrew Jones
On Mon, Mar 10, 2025 at 04:12:11PM +0100, Clément Léger wrote: > Now that the kernel can handle misaligned accesses in S-mode, request > misaligned access exception delegation from SBI. This uses the FWFT SBI > extension defined in SBI version 3.0. > > Signed-off-by: Clément Léger > --- > arch/r

[PATCH net-next 04/12] mptcp: pm: only fill id_avail_bitmap for in-kernel pm

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang id_avail_bitmap of struct mptcp_pm_data is currently only used by the in-kernel PM, so this patch moves its initialization operation under the "if (pm_type == MPTCP_PM_TYPE_KERNEL)" condition. Suggested-by: Matthieu Baerts Signed-off-by: Geliang Tang Reviewed-by: Matthieu Ba

Re: [PATCH v6 0/3] printf: convert self-test to KUnit

2025-03-13 Thread Petr Mladek
On Fri 2025-03-07 17:08:55, Tamir Duberstein wrote: > This is one of just 3 remaining "Test Module" kselftests (the others > being bitmap and scanf), the rest having been converted to KUnit. > > I tested this using: > > $ tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 printf

[PATCH net-next 11/12] mptcp: sysctl: add available_path_managers

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Similarly to net.mptcp.available_schedulers, this patch adds a new one net.mptcp.available_path_managers to list the available path managers. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- Documentation/networking/

Re: [PATCH v6 0/3] printf: convert self-test to KUnit

2025-03-13 Thread Petr Mladek
On Sat 2025-03-08 07:52:49, Tamir Duberstein wrote: > On Sat, Mar 8, 2025 at 7:51 AM Tamir Duberstein wrote: > > > > On Fri, Mar 7, 2025 at 11:49 PM Kees Cook wrote: > > > > > > On Fri, Mar 07, 2025 at 05:08:55PM -0500, Tamir Duberstein wrote: > > > > This is one of just 3 remaining "Test Module"

Re: [PATCH v6 0/3] printf: convert self-test to KUnit

2025-03-13 Thread Kees Cook
On Fri, 07 Mar 2025 17:08:55 -0500, Tamir Duberstein wrote: > This is one of just 3 remaining "Test Module" kselftests (the others > being bitmap and scanf), the rest having been converted to KUnit. > > I tested this using: > > $ tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1

[PATCH net-next v10 04/10] tun: Add common virtio-net hash feature code

2025-03-13 Thread Akihiko Odaki
Add common code required for the features being added to TUN and TAP. They will be enabled for each of them in following patches. Added Features == Hash reporting -- Allow the guest to reuse the hash value to make receive steering consistent between the host and guest, an

[PATCH net-next v10 03/10] tun: Allow steering eBPF program to fall back

2025-03-13 Thread Akihiko Odaki
This clarifies a steering eBPF program takes precedence over the other steering algorithms. Signed-off-by: Akihiko Odaki --- Documentation/networking/tuntap.rst | 7 +++ drivers/net/tun.c | 28 +--- include/uapi/linux/if_tun.h | 9 +

[PATCH net-next v10 02/10] net: flow_dissector: Export flow_keys_dissector_symmetric

2025-03-13 Thread Akihiko Odaki
flow_keys_dissector_symmetric is useful to derive a symmetric hash and to know its source such as IPv4, IPv6, TCP, and UDP. Signed-off-by: Akihiko Odaki Tested-by: Lei Yang --- include/net/flow_dissector.h | 1 + net/core/flow_dissector.c| 3 ++- 2 files changed, 3 insertions(+), 1 deletion

[PATCH net-next v10 08/10] selftest: tun: Add tests for virtio-net hashing

2025-03-13 Thread Akihiko Odaki
The added tests confirm tun can perform RSS for all supported hash types to select the receive queue and report hash values. Signed-off-by: Akihiko Odaki Tested-by: Lei Yang --- tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/net/tun.c| 455 +++

[PATCH net-next v10 10/10] vhost/net: Support VIRTIO_NET_F_HASH_REPORT

2025-03-13 Thread Akihiko Odaki
VIRTIO_NET_F_HASH_REPORT allows to report hash values calculated on the host. When VHOST_NET_F_VIRTIO_NET_HDR is employed, it will report no hash values (i.e., the hash_report member is always set to VIRTIO_NET_HASH_REPORT_NONE). Otherwise, the values reported by the underlying socket will be repor

[PATCH net-next v10 09/10] selftest: tap: Add tests for virtio-net ioctls

2025-03-13 Thread Akihiko Odaki
They only test the ioctls are wired up to the implementation common with tun as it is already tested for tun. Signed-off-by: Akihiko Odaki --- tools/testing/selftests/net/tap.c | 97 ++- 1 file changed, 95 insertions(+), 2 deletions(-) diff --git a/tools/test

[PATCH net-next v10 00/10] tun: Introduce virtio-net hashing feature

2025-03-13 Thread Akihiko Odaki
based on context rewrites, which is in feature freeze. We can adopt kfuncs, but they will not be UAPIs. We opt to ioctl to align with other relevant UAPIs (KVM and vhost_net). The patches for QEMU to use this new feature was submitted as RFC and is available at: https://patchew.org/QEMU/20250313

[PATCH net-next v10 01/10] virtio_net: Add functions for hashing

2025-03-13 Thread Akihiko Odaki
They are useful to implement VIRTIO_NET_F_RSS and VIRTIO_NET_F_HASH_REPORT. Signed-off-by: Akihiko Odaki Tested-by: Lei Yang --- include/linux/virtio_net.h | 188 + 1 file changed, 188 insertions(+) diff --git a/include/linux/virtio_net.h b/include/l

[PATCH net-next v10 05/10] tun: Introduce virtio-net hash feature

2025-03-13 Thread Akihiko Odaki
Add ioctls and storage required for the virtio-net hash feature to TUN. Signed-off-by: Akihiko Odaki --- drivers/net/Kconfig| 1 + drivers/net/tun.c | 54 ++ include/linux/skbuff.h | 3 +++ net/core/skbuff.c | 4 4 files chang

[PATCH net-next v10 06/10] tap: Introduce virtio-net hash feature

2025-03-13 Thread Akihiko Odaki
Add ioctls and storage required for the virtio-net hash feature to TAP. Signed-off-by: Akihiko Odaki --- drivers/net/tap.c | 60 -- include/linux/if_tap.h | 2 ++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/drivers/net/tap

[PATCH net-next v10 07/10] selftest: tun: Test vnet ioctls without device

2025-03-13 Thread Akihiko Odaki
Ensure that vnet ioctls result in EBADFD when the underlying device is deleted. Signed-off-by: Akihiko Odaki Tested-by: Lei Yang --- tools/testing/selftests/net/tun.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/tools/testing/selftests/net/tun.c b

[PATCH net-next 00/12] mptcp: pm: prep work for new ops and sysctl knobs

2025-03-13 Thread Matthieu Baerts (NGI0)
Here are a few cleanups, preparation work for the new PM ops, and sysctl knobs. - Patch 1: reorg: move generic NL code used by all PMs to pm_netlink.c. - Patch 2: use kmemdup() instead of kmalloc + copy. - Patch 3: small cleanup to use pm var instead of msk->pm. - Patch 4: reorg: id_avail_bitma

[PATCH net-next 02/12] mptcp: pm: in-kernel: use kmemdup helper

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Instead of using kmalloc() or kzalloc() to allocate an entry and then immediately duplicate another entry to the newly allocated one, kmemdup() helper can be used to simplify the code. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Ba

[PATCH net-next 03/12] mptcp: pm: use pm variable instead of msk->pm

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang The variable "pm" has been defined in mptcp_pm_fully_established() and mptcp_pm_data_reset() as "msk->pm", so use "pm" directly instead of using "msk->pm". Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/p

[PATCH net-next 01/12] mptcp: pm: split netlink and in-kernel init

2025-03-13 Thread Matthieu Baerts (NGI0)
The registration of mptcp_genl_family is useful for both the in-kernel and the userspace PM. It should then be done in pm_netlink.c. On the other hand, the registration of the in-kernel pernet subsystem is specific to the in-kernel PM, and should stay there in pm_kernel.c. Reviewed-by: Mat Martin

[PATCH net-next 05/12] mptcp: pm: add struct_group in mptcp_pm_data

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch adds a "struct_group(reset, ...)" in struct mptcp_pm_data to simplify the reset, and make sure we don't miss any. Suggested-by: Matthieu Baerts Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/p

[PATCH net-next 07/12] mptcp: pm: register in-kernel and userspace PM

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch defines the original in-kernel netlink path manager as a new struct mptcp_pm_ops named "mptcp_pm_kernel", and register it in mptcp_pm_kernel_register(). And define the userspace path manager as a new struct mptcp_pm_ops named "mptcp_pm_userspace", and register it in

[PATCH net-next 08/12] mptcp: sysctl: set path manager by name

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang Similar to net.mptcp.scheduler, a new net.mptcp.path_manager sysctl knob is added to determine which path manager will be used by each newly created MPTCP socket by setting the name of it. Dealing with an explicit name is easier than with a number, especially when more PMs wil

[PATCH net-next 06/12] mptcp: pm: define struct mptcp_pm_ops

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang In order to allow users to develop their own BPF-based path manager, this patch defines a struct ops "mptcp_pm_ops" for an MPTCP path manager, which contains a set of interfaces. Currently only init() and release() interfaces are included, subsequent patches will add others ste

[PATCH net-next 09/12] mptcp: sysctl: map path_manager to pm_type

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch maps the newly added path manager sysctl "path_manager" to the old one "pm_type". path_manager pm_type "kernel"-> MPTCP_PM_TYPE_KERNEL "userspace" -> MPTCP_PM_TYPE_USERSPACE others -> __MPTCP_PM_TYPE_NR It is important to

[PATCH net-next 10/12] mptcp: sysctl: map pm_type to path_manager

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch adds a new proc_handler "proc_pm_type" for "pm_type" to map old path manager sysctl "pm_type" to the newly added "path_manager". path_manager pm_type MPTCP_PM_TYPE_KERNEL-> "kernel" MPTCP_PM_TYPE_USERSPACE -> "userspace" I

[PATCH net-next 12/12] selftests: mptcp: add pm sysctl mapping tests

2025-03-13 Thread Matthieu Baerts (NGI0)
From: Geliang Tang This patch checks if the newly added net.mptcp.path_manager is mapped successfully from or to the old net.mptcp.pm_type in userspace_pm.sh. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net

Re: [PATCH net-next v7 2/9] net: add get_netmem/put_netmem support

2025-03-13 Thread Paolo Abeni
On 3/8/25 10:40 PM, Mina Almasry wrote: > Currently net_iovs support only pp ref counts, and do not support a > page ref equivalent. > > This is fine for the RX path as net_iovs are used exclusively with the > pp and only pp refcounting is needed there. The TX path however does not > use pp ref co

Re: [PATCH net-next v7 8/9] net: check for driver support in netmem TX

2025-03-13 Thread Paolo Abeni
On 3/8/25 10:40 PM, Mina Almasry wrote: > We should not enable netmem TX for drivers that don't declare support. > > Check for driver netmem TX support during devmem TX binding and fail if > the driver does not have the functionality. > > Check for driver support in validate_xmit_skb as well. >