Commit ecb2774
Tests: Declare the ringbuf map with its real type and a legal size
The map was declared as RingBuf, which is not an exported name -- the class is
RingBuffer. maps_pass has no processor registered under RingBuf, so it fell
through to the 'unknown map type, defaulting to HashMap' path and was emitted
as BPF_MAP_TYPE_HASH with no key or value size. The kernel rejected it:
libbpf: map 'mymap': found type = 1.
libbpf: map 'mymap': failed to create: -EINVAL
Nothing caught this earlier because the test framework compiles the file's AST
and never imports it, so the bogus 'from pythonbpf.maps import RingBuf' never
raised ImportError.
Using the real name also subjects the map to process_ringbuf_map's validation,
which max_entries=1024 does not survive: a ringbuf needs a power of two at
least as large as the page size. Raised to 4096. libbpf now reports
type = 27 with max_entries = 4096.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent a7e2bc3 commit ecb2774
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments