Provide a LRU version of the existing BPF_MAP_TYPE_HASH.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -85,6 +85,7 @@ enum bpf_map_type { · 84 unmodified lines | ||
| 85 | 85 | BPF_MAP_TYPE_PERCPU_ARRAY, |
| 86 | 86 | BPF_MAP_TYPE_STACK_TRACE, |
| 87 | 87 | BPF_MAP_TYPE_CGROUP_ARRAY, |
| 88 | + BPF_MAP_TYPE_LRU_HASH, | |
| 88 | 89 | }; |
| 89 | 90 | |
| 90 | 91 | enum bpf_prog_type { |
| @@ -106,6 +107,13 @@ enum bpf_prog_type { · 15 unmodified lines | ||
| 106 | 107 | #define BPF_EXIST 2 /* update existing element */ |
| 107 | 108 | |
| 108 | 109 | #define BPF_F_NO_PREALLOC (1U << 0) |
| 110 | +/* Instead of having one common LRU list in the | |
| 111 | + * BPF_MAP_TYPE_LRU_HASH map, use a percpu LRU list | |
| 112 | + * which can scale and perform better. | |
| 113 | + * Note, the LRU nodes (including free nodes) cannot be moved | |
| 114 | + * across different LRU lists. | |
| 115 | + */ | |
| 116 | +#define BPF_F_NO_COMMON_LRU (1U << 1) | |
| 109 | 117 | |
| 110 | 118 | union bpf_attr { |
| 111 | 119 | struct { /* anonymous struct used by BPF_MAP_CREATE command */ |