Introduce ring__consume_n() and ring_buffer__consume_n() API to
partially consume items from one (or more) ringbuffer(s).
This can be useful, for example, to consume just a single item or when
we need to copy multiple items to a limited user-space buffer from the
ringbuffer callback.
Practical example (where this API can be used):
https://github.com/sched-ext/scx/blob/b7c06b9ed9f72cad83c31e39e9c4e2cfd8683…
See also:
https://lore.kernel.org/lkml/20240310154726.734289-1-andrea.righi@canonical…
v4:
- add a selftest to test the new API
- open a new 1.5.0 cycle
v3:
- rename ring__consume_max() -> ring__consume_n() and
ring_buffer__consume_max() -> ring_buffer__consume_n()
- add new API to a new 1.5.0 cycle
- fixed minor nits / comments
v2:
- introduce a new API instead of changing the callback's retcode
behavior
Andrea Righi (4):
libbpf: Start v1.5 development cycle
libbpf: ringbuf: allow to consume up to a certain amount of items
libbpf: Add ring__consume_n / ring_buffer__consume_n
selftests/bpf: Add tests for ring__consume_n and ring_buffer__consume_n
tools/lib/bpf/libbpf.h | 12 +++++
tools/lib/bpf/libbpf.map | 6 +++
tools/lib/bpf/libbpf_version.h | 2 +-
tools/lib/bpf/ringbuf.c | 59 ++++++++++++++++++++----
tools/testing/selftests/bpf/prog_tests/ringbuf.c | 8 ++++
5 files changed, 76 insertions(+), 11 deletions(-)
This patchset allows for io_uring zerocopy to support REQ_F_CQE_SKIP,
skipping the normal completion notification, but not the zerocopy buffer
release notification.
This patchset also includes a test to test these changes, and a patch to
mini_liburing to enable io_uring_peek_cqe, which is needed for the test.
Oliver Crumrine (3):
io_uring: Add REQ_F_CQE_SKIP support for io_uring zerocopy
io_uring: Add io_uring_peek_cqe to mini_liburing
io_uring: Support IOSQE_CQE_SKIP_SUCCESS in io_uring zerocopy test
io_uring/net.c | 6 +--
tools/include/io_uring/mini_liburing.h | 18 +++++++++
.../selftests/net/io_uring_zerocopy_tx.c | 37 +++++++++++++++++--
.../selftests/net/io_uring_zerocopy_tx.sh | 7 +++-
4 files changed, 59 insertions(+), 10 deletions(-)
--
2.44.0
This series aims to improve the usability of the ftrace selftests when
running as part of the kselftest runner, mainly for use with automated
systems. It fixes the output of verbose mode when run in KTAP output
mode and then enables verbose mode by default when invoked from the
kselftest runner so that the diagnostic information is there by default
when run in automated systems.
I've split this into two patches in case there is a concern with one
part but not the other, especially given the verbosity of the verbose
output when it triggers.
Signed-off-by: Mark Brown <broonie(a)kernel.org>
---
Mark Brown (2):
tracing/selftests: Support log output when generating KTAP output
tracing/selftests: Default to verbose mode when running in kselftest
tools/testing/selftests/ftrace/ftracetest | 8 +++++++-
tools/testing/selftests/ftrace/ftracetest-ktap | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
---
base-commit: 4cece764965020c22cff7665b18a012006359095
change-id: 20240319-kselftest-ftrace-ktap-verbose-72e37957e213
Best regards,
--
Mark Brown <broonie(a)kernel.org>
Earlier commit fc8b2a619469378 ("net: more strict VIRTIO_NET_HDR_GSO_UDP_L4 validation")
added check of potential number of UDP segment vs UDP_MAX_SEGMENTS
in linux/virtio_net.h.
After this change certification test of USO guest-to-guest
transmit on Windows driver for virtio-net device fails,
for example with packet size of ~64K and mss of 536 bytes.
In general the USO should not be more restrictive than TSO.
Indeed, in case of unreasonably small mss a lot of segments
can cause queue overflow and packet loss on the destination.
Limit of 128 segments is good for any practical purpose,
with minimal meaningful mss of 536 the maximal UDP packet will
be divided to ~120 segments.
Signed-off-by: Yuri Benditovich <yuri.benditovich(a)daynix.com>
---
include/linux/udp.h | 2 +-
tools/testing/selftests/net/udpgso.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 3748e82b627b..7e75ccdf25fe 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -108,7 +108,7 @@ struct udp_sock {
#define udp_assign_bit(nr, sk, val) \
assign_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags, val)
-#define UDP_MAX_SEGMENTS (1 << 6UL)
+#define UDP_MAX_SEGMENTS (1 << 7UL)
#define udp_sk(ptr) container_of_const(ptr, struct udp_sock, inet.sk)
diff --git a/tools/testing/selftests/net/udpgso.c b/tools/testing/selftests/net/udpgso.c
index 1d975bf52af3..85b3baa3f7f3 100644
--- a/tools/testing/selftests/net/udpgso.c
+++ b/tools/testing/selftests/net/udpgso.c
@@ -34,7 +34,7 @@
#endif
#ifndef UDP_MAX_SEGMENTS
-#define UDP_MAX_SEGMENTS (1 << 6UL)
+#define UDP_MAX_SEGMENTS (1 << 7UL)
#endif
#define CONST_MTU_TEST 1500
--
2.34.3
"Bail out! " is not descriptive. It rather should be: "Failed: " and
then this added prefix doesn't need to be added everywhere. Usually in
the logs, we are searching for "Failed" or "Error" instead of "Bail
out" so it must be replace.
Remove Error/Failed prefixes from all usages as well.
Muhammad Usama Anjum (2):
selftests: Replace "Bail out" with "Error"
selftests: Remove Error/Failed prefix from ksft_exit_fail*() usages
tools/testing/selftests/exec/load_address.c | 8 +-
.../testing/selftests/exec/recursion-depth.c | 10 +-
tools/testing/selftests/kselftest.h | 2 +-
.../selftests/mm/map_fixed_noreplace.c | 24 +--
tools/testing/selftests/mm/map_populate.c | 2 +-
tools/testing/selftests/mm/mremap_dontunmap.c | 2 +-
tools/testing/selftests/mm/pagemap_ioctl.c | 166 +++++++++---------
.../selftests/mm/split_huge_page_test.c | 2 +-
8 files changed, 108 insertions(+), 108 deletions(-)
--
2.39.2