<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/bpf/prog_tests/ringbuf.c, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2025-10-28T02:46:32Z</updated>
<entry>
<title>selftests/bpf: Add overwrite mode test for BPF ring buffer</title>
<updated>2025-10-28T02:46:32Z</updated>
<author>
<name>Xu Kuohai</name>
<email>xukuohai@huawei.com</email>
</author>
<published>2025-10-18T03:57:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8f7a86ecde429709da5851043ab2e0b8236cfd29'/>
<id>urn:sha1:8f7a86ecde429709da5851043ab2e0b8236cfd29</id>
<content type='text'>
Add overwrite mode test for BPF ring buffer. The test creates a BPF ring
buffer in overwrite mode, then repeatedly reserves and commits records
to check if the ring buffer works as expected both before and after
overwriting occurs.

Signed-off-by: Xu Kuohai &lt;xukuohai@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20251018035738.4039621-3-xukuohai@huaweicloud.com
</content>
</entry>
<entry>
<title>selftests/bpf: Fix ringbuf/ringbuf_write test failure with arm64 64KB page size</title>
<updated>2025-06-07T02:21:43Z</updated>
<author>
<name>Yonghong Song</name>
<email>yonghong.song@linux.dev</email>
</author>
<published>2025-06-07T01:36:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8c8c5e3c854a2593ec90dacd868f3066b67de1c4'/>
<id>urn:sha1:8c8c5e3c854a2593ec90dacd868f3066b67de1c4</id>
<content type='text'>
The ringbuf max_entries must be PAGE_ALIGNED. See kernel function
ringbuf_map_alloc(). So for arm64 64KB page size, adjust max_entries
and other related metrics properly.

Signed-off-by: Yonghong Song &lt;yonghong.song@linux.dev&gt;
Link: https://lore.kernel.org/r/20250607013621.1552332-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Add more ring buffer test coverage</title>
<updated>2024-06-24T11:43:55Z</updated>
<author>
<name>Daniel Borkmann</name>
<email>daniel@iogearbox.net</email>
</author>
<published>2024-06-21T14:08:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=316930d06b92a2419d8e767193266e678545b31d'/>
<id>urn:sha1:316930d06b92a2419d8e767193266e678545b31d</id>
<content type='text'>
Add test coverage for reservations beyond the ring buffer size in order
to validate that bpf_ringbuf_reserve() rejects the request with NULL, all
other ring buffer tests keep passing as well:

  # ./vmtest.sh -- ./test_progs -t ringbuf
  [...]
  ./test_progs -t ringbuf
  [    1.165434] bpf_testmod: loading out-of-tree module taints kernel.
  [    1.165825] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
  [    1.284001] tsc: Refined TSC clocksource calibration: 3407.982 MHz
  [    1.286871] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fc34e357, max_idle_ns: 440795379773 ns
  [    1.289555] clocksource: Switched to clocksource tsc
  #274/1   ringbuf/ringbuf:OK
  #274/2   ringbuf/ringbuf_n:OK
  #274/3   ringbuf/ringbuf_map_key:OK
  #274/4   ringbuf/ringbuf_write:OK
  #274     ringbuf:OK
  #275     ringbuf_multi:OK
  [...]

Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
[ Test fixups for getting BPF CI back to work ]
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20240621140828.18238-2-daniel@iogearbox.net
</content>
</entry>
<entry>
<title>selftests/bpf: Add ring_buffer__consume_n test.</title>
<updated>2024-04-25T18:46:04Z</updated>
<author>
<name>Andrea Righi</name>
<email>andrea.righi@canonical.com</email>
</author>
<published>2024-04-25T14:06:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=638a485c4996be1d38303cf25ea8d12dfd16011b'/>
<id>urn:sha1:638a485c4996be1d38303cf25ea8d12dfd16011b</id>
<content type='text'>
Add a testcase for the ring_buffer__consume_n() API.

The test produces multiple samples in a ring buffer, using a
sys_getpid() fentry prog, and consumes them from user-space in batches,
rather than consuming all of them greedily, like ring_buffer__consume()
does.

Signed-off-by: Andrea Righi &lt;andrea.righi@canonical.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Link: https://lore.kernel.org/lkml/CAEf4BzaR4zqUpDmj44KNLdpJ=Tpa97GrvzuzVNO5nM6b7oWd1w@mail.gmail.com
Link: https://lore.kernel.org/bpf/20240425140627.112728-1-andrea.righi@canonical.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add tests for ring__consume</title>
<updated>2023-09-25T23:22:43Z</updated>
<author>
<name>Martin Kelly</name>
<email>martin.kelly@crowdstrike.com</email>
</author>
<published>2023-09-25T21:50:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cb3d7dd2d0dbe92ff3ebdd87fefc254f1c89aeeb'/>
<id>urn:sha1:cb3d7dd2d0dbe92ff3ebdd87fefc254f1c89aeeb</id>
<content type='text'>
Add tests for new API ring__consume.

Signed-off-by: Martin Kelly &lt;martin.kelly@crowdstrike.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230925215045.2375758-15-martin.kelly@crowdstrike.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add tests for ring__map_fd</title>
<updated>2023-09-25T23:22:43Z</updated>
<author>
<name>Martin Kelly</name>
<email>martin.kelly@crowdstrike.com</email>
</author>
<published>2023-09-25T21:50:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6e38ba5291f9e082f9472a8ef682dc54cff0b3e4'/>
<id>urn:sha1:6e38ba5291f9e082f9472a8ef682dc54cff0b3e4</id>
<content type='text'>
Add tests for the new API ring__map_fd.

Signed-off-by: Martin Kelly &lt;martin.kelly@crowdstrike.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230925215045.2375758-13-martin.kelly@crowdstrike.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add tests for ring__size</title>
<updated>2023-09-25T23:22:43Z</updated>
<author>
<name>Martin Kelly</name>
<email>martin.kelly@crowdstrike.com</email>
</author>
<published>2023-09-25T21:50:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bb32dd2c8fec71990bbc231aac934e1c73a17341'/>
<id>urn:sha1:bb32dd2c8fec71990bbc231aac934e1c73a17341</id>
<content type='text'>
Add tests for the new API ring__size.

Signed-off-by: Martin Kelly &lt;martin.kelly@crowdstrike.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230925215045.2375758-11-martin.kelly@crowdstrike.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add tests for ring__avail_data_size</title>
<updated>2023-09-25T23:22:43Z</updated>
<author>
<name>Martin Kelly</name>
<email>martin.kelly@crowdstrike.com</email>
</author>
<published>2023-09-25T21:50:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f3a01d385fbb9c76abfad8d104d08453f289e2d3'/>
<id>urn:sha1:f3a01d385fbb9c76abfad8d104d08453f289e2d3</id>
<content type='text'>
Add test for the new API ring__avail_data_size.

Signed-off-by: Martin Kelly &lt;martin.kelly@crowdstrike.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230925215045.2375758-9-martin.kelly@crowdstrike.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add tests for ring__*_pos</title>
<updated>2023-09-25T23:22:42Z</updated>
<author>
<name>Martin Kelly</name>
<email>martin.kelly@crowdstrike.com</email>
</author>
<published>2023-09-25T21:50:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b18db8712ecf5c880da222f6e0d7be53f0af4c4d'/>
<id>urn:sha1:b18db8712ecf5c880da222f6e0d7be53f0af4c4d</id>
<content type='text'>
Add tests for the new APIs ring__producer_pos and ring__consumer_pos.

Signed-off-by: Martin Kelly &lt;martin.kelly@crowdstrike.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230925215045.2375758-7-martin.kelly@crowdstrike.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add test verifying bpf_ringbuf_reserve retval use in map ops</title>
<updated>2022-10-22T02:23:34Z</updated>
<author>
<name>Dave Marchevsky</name>
<email>davemarchevsky@fb.com</email>
</author>
<published>2022-10-20T16:07:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=51ee71d38d8ce5a30496251200ab2f12b71e1fb6'/>
<id>urn:sha1:51ee71d38d8ce5a30496251200ab2f12b71e1fb6</id>
<content type='text'>
Add a test_ringbuf_map_key test prog, borrowing heavily from extant
test_ringbuf.c. The program tries to use the result of
bpf_ringbuf_reserve as map_key, which was not possible before previouis
commits in this series. The test runner added to prog_tests/ringbuf.c
verifies that the program loads and does basic sanity checks to confirm
that it runs as expected.

Also, refactor test_ringbuf such that runners for existing test_ringbuf
and newly-added test_ringbuf_map_key are subtests of 'ringbuf' top-level
test.

Signed-off-by: Dave Marchevsky &lt;davemarchevsky@fb.com&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/r/20221020160721.4030492-3-davemarchevsky@fb.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
