From: Liu Jian liujian56@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8J90J
----------------------------------------------------
Let sockops can use bpf_get_current_comm().
Signed-off-by: Liu Jian liujian56@huawei.com Signed-off-by: Zhengchao Shao shaozhengchao@huawei.com --- net/Kconfig | 6 ++++++ net/core/filter.c | 4 ++++ 2 files changed, 10 insertions(+)
diff --git a/net/Kconfig b/net/Kconfig index d532ec33f1fe..7fbd17e188a5 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -508,4 +508,10 @@ config NETDEV_ADDR_LIST_TEST default KUNIT_ALL_TESTS depends on KUNIT
+config NETACC_BPF + bool "Network acceleration" + default y + help + Network acceleration in bpf. + endif # if NET diff --git a/net/core/filter.c b/net/core/filter.c index a094694899c9..d5a22975a885 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -8214,6 +8214,10 @@ sock_ops_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) case BPF_FUNC_tcp_sock: return &bpf_tcp_sock_proto; #endif /* CONFIG_INET */ +#if IS_ENABLED(CONFIG_NETACC_BPF) + case BPF_FUNC_get_current_comm: + return &bpf_get_current_comm_proto; +#endif default: return bpf_sk_base_func_proto(func_id); }