Skip to content

Commit c22fbae

Browse files
Petar PenkovAlexei Starovoitov
authored andcommitted
bpf: support flow dissector in libbpf and bpftool
This patch extends libbpf and bpftool to work with programs of type BPF_PROG_TYPE_FLOW_DISSECTOR. Signed-off-by: Petar Penkov <ppenkov@google.com> Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 2f965e3 commit c22fbae

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

tools/bpf/bpftool/prog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ static const char * const prog_type_name[] = {
7474
[BPF_PROG_TYPE_RAW_TRACEPOINT] = "raw_tracepoint",
7575
[BPF_PROG_TYPE_CGROUP_SOCK_ADDR] = "cgroup_sock_addr",
7676
[BPF_PROG_TYPE_LIRC_MODE2] = "lirc_mode2",
77+
[BPF_PROG_TYPE_FLOW_DISSECTOR] = "flow_dissector",
7778
};
7879

7980
static void print_boot_time(__u64 nsecs, char *buf, unsigned int size)

tools/lib/bpf/libbpf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,7 @@ static bool bpf_prog_type__needs_kver(enum bpf_prog_type type)
15021502
case BPF_PROG_TYPE_CGROUP_SOCK_ADDR:
15031503
case BPF_PROG_TYPE_LIRC_MODE2:
15041504
case BPF_PROG_TYPE_SK_REUSEPORT:
1505+
case BPF_PROG_TYPE_FLOW_DISSECTOR:
15051506
return false;
15061507
case BPF_PROG_TYPE_UNSPEC:
15071508
case BPF_PROG_TYPE_KPROBE:
@@ -2121,6 +2122,7 @@ static const struct {
21212122
BPF_PROG_SEC("sk_skb", BPF_PROG_TYPE_SK_SKB),
21222123
BPF_PROG_SEC("sk_msg", BPF_PROG_TYPE_SK_MSG),
21232124
BPF_PROG_SEC("lirc_mode2", BPF_PROG_TYPE_LIRC_MODE2),
2125+
BPF_PROG_SEC("flow_dissector", BPF_PROG_TYPE_FLOW_DISSECTOR),
21242126
BPF_SA_PROG_SEC("cgroup/bind4", BPF_CGROUP_INET4_BIND),
21252127
BPF_SA_PROG_SEC("cgroup/bind6", BPF_CGROUP_INET6_BIND),
21262128
BPF_SA_PROG_SEC("cgroup/connect4", BPF_CGROUP_INET4_CONNECT),

0 commit comments

Comments
 (0)