sock_map: Introduce BPF_SK_SKB_VERDICT
Reusing BPF_SK_SKB_STREAM_VERDICT is possible but its name is confusing and more importantly we still want to distinguish them from user-space. So we can just reuse the stream verdict code but introduce a new type of eBPF program, skb_verdict. Users are not allowed to attach stream_verdict and skb_verdict programs to the same map. Signed-off-by: Cong Wang <cong.wang@bytedance.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/20210331023237.41094-10-xiyou.wangcong@gmail.com
This commit is contained in:
committed by
Alexei Starovoitov
parent
b017055255
commit
a7ba4558e6
@@ -57,6 +57,7 @@ const char * const attach_type_name[__MAX_BPF_ATTACH_TYPE] = {
|
||||
|
||||
[BPF_SK_SKB_STREAM_PARSER] = "sk_skb_stream_parser",
|
||||
[BPF_SK_SKB_STREAM_VERDICT] = "sk_skb_stream_verdict",
|
||||
[BPF_SK_SKB_VERDICT] = "sk_skb_verdict",
|
||||
[BPF_SK_MSG_VERDICT] = "sk_msg_verdict",
|
||||
[BPF_LIRC_MODE2] = "lirc_mode2",
|
||||
[BPF_FLOW_DISSECTOR] = "flow_dissector",
|
||||
|
||||
@@ -76,6 +76,7 @@ enum dump_mode {
|
||||
static const char * const attach_type_strings[] = {
|
||||
[BPF_SK_SKB_STREAM_PARSER] = "stream_parser",
|
||||
[BPF_SK_SKB_STREAM_VERDICT] = "stream_verdict",
|
||||
[BPF_SK_SKB_VERDICT] = "skb_verdict",
|
||||
[BPF_SK_MSG_VERDICT] = "msg_verdict",
|
||||
[BPF_FLOW_DISSECTOR] = "flow_dissector",
|
||||
[__MAX_BPF_ATTACH_TYPE] = NULL,
|
||||
|
||||
Reference in New Issue
Block a user