History

bpf: Add BPF_MAP_TYPE_LRU_HASH

Provide a LRU version of the existing BPF_MAP_TYPE_HASH.

Martin KaFai Lau committed 10 years ago

Commit 29ba7321 parent fd91de72 files · +260 −14Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/bpf.h+8−0
@@ -85,6 +85,7 @@ enum bpf_map_type { · 84 unmodified lines
8585 BPF_MAP_TYPE_PERCPU_ARRAY,
8686 BPF_MAP_TYPE_STACK_TRACE,
8787 BPF_MAP_TYPE_CGROUP_ARRAY,
88+ BPF_MAP_TYPE_LRU_HASH,
8889 };
8990
9091 enum bpf_prog_type {
@@ -106,6 +107,13 @@ enum bpf_prog_type { · 15 unmodified lines
106107 #define BPF_EXIST 2 /* update existing element */
107108
108109 #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)
109117
110118 union bpf_attr {
111119 struct { /* anonymous struct used by BPF_MAP_CREATE command */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t