aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/test
diff options
context:
space:
mode:
authorPaul Chaignon <paul.chaignon@gmail.com>2023-11-06 19:59:51 +0100
committerAleksandr Nogikh <nogikh@google.com>2023-11-09 18:26:45 +0000
commit24206adf8c2510ab24ff5391c676da047e2523d0 (patch)
tree40f2299354dc4ca0b40055a84574ae8ba747658f /sys/linux/test
parentdb8894c2e1eb547c641b57d2dcfd61109d5af28a (diff)
sys/linux: describe ringbuf map creation
The corresponding test does the same as this map declaration: struct { __uint(type, BPF_MAP_TYPE_RINGBUF); __uint(max_entries, 256 * 1024); } rb SEC(".maps"); Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Diffstat (limited to 'sys/linux/test')
-rw-r--r--sys/linux/test/bpf_helpers4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/linux/test/bpf_helpers b/sys/linux/test/bpf_helpers
index b625b68a2..246e903b0 100644
--- a/sys/linux/test/bpf_helpers
+++ b/sys/linux/test/bpf_helpers
@@ -20,3 +20,7 @@ r10 = bpf$MAP_CREATE_TAIL_CALL(AUTO, &AUTO={AUTO, AUTO, AUTO, AUTO, AUTO, 0x0, 0
r11 = bpf$MAP_UPDATE_ELEM_TAIL_CALL(AUTO, &AUTO={{r10, r10}, &AUTO=0x0, &AUTO=r4, AUTO}, 0x1c)
r4 = bpf$PROG_LOAD(AUTO, &AUTO={0x3, AUTO, &AUTO=@framed={{AUTO, AUTO, AUTO, AUTO, 0x0, AUTO, AUTO, AUTO, 0x0}, [@tail_call={{AUTO, AUTO, AUTO, AUTO, r10, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}}], {AUTO, AUTO, AUTO, AUTO}}, &AUTO='GPL\x00', 0x0, 0x0, 0x0, 0x0, 0x0, "00000000000000000000000000000000", 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, 0xa0)
+
+# Prepare, load, and execute a BPF program that calls ringbuf helpers
+
+r1 = bpf$MAP_CREATE_RINGBUF(AUTO, &AUTO={AUTO, AUTO, AUTO, 0x40000, AUTO, 0x0, 0x0, "00000000000000000000000000000000", 0x0, 0x0, 0x0, 0x0, 0x0, AUTO}, 0x48)