History

bpf/flow_dissector: pass input flags to BPF flow dissector program

C flow dissector supports input flags that tell it to customize parsing by either stopping early or trying to parse as deep as possible. Pass those flags to the BPF flow dissector so it can make the same decisions. In the next commits I'll add support for those flags to our reference bpf_flow.c v3: * Export copy of flow dissector flags instead of moving (Alexei Starovoitov)

Stanislav Fomichev committed 7 years ago

Commit 086f9561 parent 03cd1d14 files · +17 −4Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/bpf.h+5−0
@@ -3507,6 +3507,10 @@ enum bpf_task_fd_type { · 3506 unmodified lines
35073507 BPF_FD_TYPE_URETPROBE, /* filename + offset */
35083508 };
35093509
3510+#define BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG (1U << 0)
3511+#define BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL (1U << 1)
3512+#define BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP (1U << 2)
3513+
35103514 struct bpf_flow_keys {
35113515 __u16 nhoff;
35123516 __u16 thoff;
@@ -3528,6 +3532,7 @@ struct bpf_flow_keys { · 15 unmodified lines
35283532 __u32 ipv6_dst[4]; /* in6_addr; network order */
35293533 };
35303534 };
3535+ __u32 flags;
35313536 };
35323537
35333538 struct bpf_func_info {