diff options
Diffstat (limited to 'kernel/bpf/helpers.c')
-rw-r--r-- | kernel/bpf/helpers.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index 39918402e6e9..045cbe673356 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/rcupdate.h> | 13 | #include <linux/rcupdate.h> |
14 | #include <linux/random.h> | 14 | #include <linux/random.h> |
15 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
16 | #include <linux/topology.h> | ||
16 | #include <linux/ktime.h> | 17 | #include <linux/ktime.h> |
17 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
18 | #include <linux/uidgid.h> | 19 | #include <linux/uidgid.h> |
@@ -92,6 +93,17 @@ const struct bpf_func_proto bpf_get_smp_processor_id_proto = { | |||
92 | .ret_type = RET_INTEGER, | 93 | .ret_type = RET_INTEGER, |
93 | }; | 94 | }; |
94 | 95 | ||
96 | BPF_CALL_0(bpf_get_numa_node_id) | ||
97 | { | ||
98 | return numa_node_id(); | ||
99 | } | ||
100 | |||
101 | const struct bpf_func_proto bpf_get_numa_node_id_proto = { | ||
102 | .func = bpf_get_numa_node_id, | ||
103 | .gpl_only = false, | ||
104 | .ret_type = RET_INTEGER, | ||
105 | }; | ||
106 | |||
95 | BPF_CALL_0(bpf_ktime_get_ns) | 107 | BPF_CALL_0(bpf_ktime_get_ns) |
96 | { | 108 | { |
97 | /* NMI safe access to clock monotonic */ | 109 | /* NMI safe access to clock monotonic */ |