| .. | .. |
|---|
| 50 | 50 | #define MAX_INSNS BPF_MAXINSNS |
|---|
| 51 | 51 | #define MAX_TEST_INSNS 1000000 |
|---|
| 52 | 52 | #define MAX_FIXUPS 8 |
|---|
| 53 | | -#define MAX_NR_MAPS 20 |
|---|
| 53 | +#define MAX_NR_MAPS 21 |
|---|
| 54 | 54 | #define MAX_TEST_RUNS 8 |
|---|
| 55 | 55 | #define POINTER_VALUE 0xcafe4all |
|---|
| 56 | 56 | #define TEST_DATA_LEN 64 |
|---|
| .. | .. |
|---|
| 87 | 87 | int fixup_sk_storage_map[MAX_FIXUPS]; |
|---|
| 88 | 88 | int fixup_map_event_output[MAX_FIXUPS]; |
|---|
| 89 | 89 | int fixup_map_reuseport_array[MAX_FIXUPS]; |
|---|
| 90 | + int fixup_map_ringbuf[MAX_FIXUPS]; |
|---|
| 90 | 91 | const char *errstr; |
|---|
| 91 | 92 | const char *errstr_unpriv; |
|---|
| 92 | 93 | uint32_t insn_processed; |
|---|
| .. | .. |
|---|
| 640 | 641 | int *fixup_sk_storage_map = test->fixup_sk_storage_map; |
|---|
| 641 | 642 | int *fixup_map_event_output = test->fixup_map_event_output; |
|---|
| 642 | 643 | int *fixup_map_reuseport_array = test->fixup_map_reuseport_array; |
|---|
| 644 | + int *fixup_map_ringbuf = test->fixup_map_ringbuf; |
|---|
| 643 | 645 | |
|---|
| 644 | 646 | if (test->fill_helper) { |
|---|
| 645 | 647 | test->fill_insns = calloc(MAX_TEST_INSNS, sizeof(struct bpf_insn)); |
|---|
| .. | .. |
|---|
| 817 | 819 | fixup_map_reuseport_array++; |
|---|
| 818 | 820 | } while (*fixup_map_reuseport_array); |
|---|
| 819 | 821 | } |
|---|
| 822 | + if (*fixup_map_ringbuf) { |
|---|
| 823 | + map_fds[20] = create_map(BPF_MAP_TYPE_RINGBUF, 0, |
|---|
| 824 | + 0, 4096); |
|---|
| 825 | + do { |
|---|
| 826 | + prog[*fixup_map_ringbuf].imm = map_fds[20]; |
|---|
| 827 | + fixup_map_ringbuf++; |
|---|
| 828 | + } while (*fixup_map_ringbuf); |
|---|
| 829 | + } |
|---|
| 820 | 830 | } |
|---|
| 821 | 831 | |
|---|
| 822 | 832 | struct libcap { |
|---|