Re: [PATCH v2 1/6] iommu: Add new iommu op to create domains owned by userspace

2023-10-15 Thread Nicolin Chen
On Thu, Sep 28, 2023 at 12:15:23AM -0700, Yi Liu wrote: > diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h > index b4ba0c0cbab6..4a7c5c8fdbb4 100644 > --- a/include/uapi/linux/iommufd.h > +++ b/include/uapi/linux/iommufd.h > @@ -347,10 +347,20 @@ struct iommu_vfio_ioas { >

[PATCH] iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly

2023-10-15 Thread Nicolin Chen
TEST_LENGTH passing ".size = sizeof(struct _struct) - 1" expects -EINVAL from "if (ucmd.user_size < op->min_size)" check in iommufd_fops_ioctl(). This has been working when min_size is exactly the size of the structure. However, if the size of the structure becomes larger than min_size, i.e. the p

Re: [PATCH] selftests/powerpc: Fix emit_tests to work with run_kselftest.sh

2023-10-15 Thread Michael Ellerman
On Thu, 21 Sep 2023 17:26:10 +1000, Michael Ellerman wrote: > In order to use run_kselftest.sh the list of tests must be emitted to > populate kselftest-list.txt. > > The powerpc Makefile is written to use EMIT_TESTS. But support for > EMIT_TESTS was dropped in commit d4e59a536f50 ("selftests: Use

[PATCH bpf-next] selftests/bpf: Use pkg-config to determine ld flags

2023-10-15 Thread Akihiko Odaki
When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Signed-off-by: Akihiko Odaki --- tools/testing/selftests/bpf/Makefile | 3 ++- tools/testing/selftests/bpf/REA

[RFC PATCH v2 0/7] tun: Introduce virtio-net hashing feature

2023-10-15 Thread Akihiko Odaki
virtio-net have two usage of hashes: one is RSS and another is hash reporting. Conventionally the hash calculation was done by the VMM. However, computing the hash after the queue was chosen defeats the purpose of RSS. Another approach is to use eBPF steering program. This approach has another dow

[RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH

2023-10-15 Thread Akihiko Odaki
This new program type will be used by tun to determine the queues to deliver packets and the hash values and types reported with virtio-net headers. Signed-off-by: Akihiko Odaki --- Documentation/bpf/bpf_prog_run.rst | 1 + Documentation/bpf/libbpf/program_types.rst | 2 ++ include/lin

[RFC PATCH v2 2/7] bpf: Add vnet_hash members to __sk_buff

2023-10-15 Thread Akihiko Odaki
They will be used only by BPF_PROG_TYPE_VNET_HASH to tell the queues to deliver packets and the hash values and types reported with virtio-net headers. Signed-off-by: Akihiko Odaki --- include/linux/filter.h | 7 net/core/filter.c | 77 +

[RFC PATCH v2 3/7] skbuff: Introduce SKB_EXT_TUN_VNET_HASH

2023-10-15 Thread Akihiko Odaki
This new extension will be used by tun to carry the hash values and types to report with virtio-net headers. Signed-off-by: Akihiko Odaki --- include/linux/skbuff.h | 10 ++ net/core/skbuff.c | 3 +++ 2 files changed, 13 insertions(+) diff --git a/include/linux/skbuff.h b/include/

[RFC PATCH v2 4/7] virtio_net: Add virtio_net_hdr_v1_hash_from_skb()

2023-10-15 Thread Akihiko Odaki
It is identical with virtio_net_hdr_from_skb() except that it impelements hash reporting. Signed-off-by: Akihiko Odaki --- include/linux/virtio_net.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 7b4dd695

[RFC PATCH v2 5/7] tun: Support BPF_PROG_TYPE_VNET_HASH

2023-10-15 Thread Akihiko Odaki
Support BPF_PROG_TYPE_VNET_HASH with TUNSETSTEERINGEBPF ioctl to make it possible to report hash values and types when steering packets. Signed-off-by: Akihiko Odaki --- drivers/net/tun.c | 158 ++ 1 file changed, 117 insertions(+), 41 deletions(-) di

[RFC PATCH v2 6/7] selftests/bpf: Test BPF_PROG_TYPE_VNET_HASH

2023-10-15 Thread Akihiko Odaki
The added tests will ensure that the new relevant members of struct __sk_buff are initialized with 0, that the members are properly interpreted by tun, and tun checks the virtio-net header size before reporting hash values and types the BPF program computed. Signed-off-by: Akihiko Odaki --- tool

[RFC PATCH v2 7/7] vhost_net: Support VIRTIO_NET_F_HASH_REPORT

2023-10-15 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

Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH

2023-10-15 Thread Alexei Starovoitov
On Sun, Oct 15, 2023 at 7:17 AM Akihiko Odaki wrote: > > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > index 0448700890f7..298634556fab 100644 > --- a/include/uapi/linux/bpf.h > +++ b/include/uapi/linux/bpf.h > @@ -988,6 +988,7 @@ enum bpf_prog_type { > BPF_PROG_TYPE_S

Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH

2023-10-15 Thread Akihiko Odaki
On 2023/10/16 1:07, Alexei Starovoitov wrote: On Sun, Oct 15, 2023 at 7:17 AM Akihiko Odaki wrote: diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 0448700890f7..298634556fab 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -988,6 +988,7 @@ enum bpf

Re: [PATCH net v2 0/4] selftests: openvswitch: Minor fixes for some systems

2023-10-15 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net.git (main) by David S. Miller : On Wed, 11 Oct 2023 15:49:35 -0400 you wrote: > A number of corner cases were caught when trying to run the selftests on > older systems. Missed skip conditions, some error cases, and outdated > python setups would all

RE: [RESEND PATCH V9 0/7] amd-pstate preferred core

2023-10-15 Thread Meng, Li (Jassmine)
[AMD Official Use Only - General] Hi Oleksandr: > -Original Message- > From: Oleksandr Natalenko > Sent: Friday, October 13, 2023 11:45 PM > To: Rafael J . Wysocki ; Huang, Ray > ; Meng, Li (Jassmine) > Cc: linux...@vger.kernel.org; linux-ker...@vger.kernel.org; > x...@kernel.org; linux

[PATCH] selftests:modify the incorrect print format

2023-10-15 Thread zhujun2
printf %d in format string requires 'int' but the argument type is 'unsigned int' Signed-off-by: zhujun2 --- tools/testing/selftests/kselftest.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/ksel

Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op

2023-10-15 Thread Yi Liu
On 2023/10/14 01:56, Nicolin Chen wrote: On Fri, Oct 13, 2023 at 11:04:56AM -0300, Jason Gunthorpe wrote: On Fri, Oct 13, 2023 at 12:33:13PM +0800, Yi Liu wrote: not really. Below the users of the struct iommu_user_data in my current iommufd_nesting branch. Only the domain_alloc_user op has ty

Re: [PATCH v6 0/8] Add printf attribute to kselftest functions

2023-10-15 Thread Maciej Wieczór-Retman
On 2023-10-13 at 15:03:11 -0600, Shuah wrote: >On 10/13/23 05:36, Maciej Wieczor-Retman wrote: >> kselftest.h declares many variadic functions that can print some >> formatted message while also executing selftest logic. These >> declarations don't have any compiler mechanism to verify if passed >>

RE: [RESEND PATCH V9 3/7] cpufreq: amd-pstate: Enable amd-pstate preferred core supporting.

2023-10-15 Thread Meng, Li (Jassmine)
[AMD Official Use Only - General] Hi Peter: > -Original Message- > From: Peter Zijlstra > Sent: Saturday, October 14, 2023 12:01 AM > To: Meng, Li (Jassmine) > Cc: Rafael J . Wysocki ; Huang, Ray > ; linux...@vger.kernel.org; linux- > ker...@vger.kernel.org; x...@kernel.org; linux-a...@

[PATCH v2] selftests/x86/lam: Zero out buffer for readlink()

2023-10-15 Thread Binbin Wu
Zero out the buffer for readlink() since readlink() does not append a terminating null byte to the buffer. Also change the buffer length passed to readlink() to 'PATH_MAX - 1' to ensure the resulting string is always null terminated. Fixes: 833c12ce0f430 ("selftests/x86/lam: Add inherit test case

[PATCH] selftests: net: remove unused variables

2023-10-15 Thread zhujun2
These variables are never referenced in the code, just remove them Signed-off-by: zhujun2 --- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/test_unix_oob.c | 2 -- tools/testing/selftests/net/nettest.c | 5 +++-- 3 files changed, 3 i