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
85 BPF_MAP_TYPE_PERCPU_ARRAY,85 BPF_MAP_TYPE_PERCPU_ARRAY,
86 BPF_MAP_TYPE_STACK_TRACE,86 BPF_MAP_TYPE_STACK_TRACE,
87 BPF_MAP_TYPE_CGROUP_ARRAY,87 BPF_MAP_TYPE_CGROUP_ARRAY,
88 BPF_MAP_TYPE_LRU_HASH,
88};89};
89 90
90enum bpf_prog_type {91enum bpf_prog_type {
@@ -106,6 +107,13 @@ enum bpf_prog_type { · 15 unmodified lines
106#define BPF_EXIST 2 /* update existing element */107#define BPF_EXIST 2 /* update existing element */
107 108
108#define BPF_F_NO_PREALLOC (1U << 0)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
110union bpf_attr {118union bpf_attr {
111 struct { /* anonymous struct used by BPF_MAP_CREATE command */119 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