Commit 05038388 authored by JofDiamonds's avatar JofDiamonds
Browse files

bpf: support BPF_PROG_QUERY for progs attached to sockmap

mainline inclusion
from mainline-v6.4-rc3
commit 748cd572
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I776SR
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=748cd5729ac7421091316e32dcdffb0578563880



----------------------------------------------------------------------

Right now there is no way to query whether BPF programs are
attached to a sockmap or not.

we can use the standard interface in libbpf to query, such as:
bpf_prog_query(mapFd, BPF_SK_SKB_STREAM_PARSER, 0, NULL, ...);
the mapFd is the fd of sockmap.

Signed-off-by: default avatarDi Zhu <zhudi2@huawei.com>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/r/20220119014005.1209-1-zhudi2@huawei.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Conflicts:
	net/core/sock_map.c
	include/linux/bpf.h
Signed-off-by: default avatarJofDiamonds <kwb0523@163.com>
Reviewed-by: default avatarwuchangye <wuchangye@huawei.com>
parent 7420251e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment