bpf: add helper for retrieving current numa node id

Use case is mainly for soreuseport to select sockets for the local
numa node, but since generic, lets also add this for other networking
and tracing program types.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Daniel Borkmann
2016-10-21 12:46:33 +02:00
committed by David S. Miller
parent a10b91b8b8
commit 2d0e30c30f
6 changed files with 24 additions and 0 deletions

View File

@@ -426,6 +426,12 @@ enum bpf_func_id {
*/
BPF_FUNC_set_hash_invalid,
/**
* bpf_get_numa_node_id()
* Returns the id of the current NUMA node.
*/
BPF_FUNC_get_numa_node_id,
__BPF_FUNC_MAX_ID,
};