]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
update headers from net-next (bpf and tc)
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 8 Jun 2017 17:56:14 +0000 (10:56 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 8 Jun 2017 17:56:14 +0000 (10:56 -0700)
More BPF and tc_action values.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
include/linux/bpf.h
include/linux/pkt_cls.h

index 23fe1b64d18fbfba9d995f9ee4ba3ae4acad612d..0ccb01ed27459da5cf0774e15fb9c77ec7510c30 100644 (file)
@@ -82,6 +82,11 @@ enum bpf_cmd {
        BPF_PROG_ATTACH,
        BPF_PROG_DETACH,
        BPF_PROG_TEST_RUN,
+       BPF_PROG_GET_NEXT_ID,
+       BPF_MAP_GET_NEXT_ID,
+       BPF_PROG_GET_FD_BY_ID,
+       BPF_MAP_GET_FD_BY_ID,
+       BPF_OBJ_GET_INFO_BY_FD,
 };
 
 enum bpf_map_type {
@@ -209,6 +214,21 @@ union bpf_attr {
                __u32           repeat;
                __u32           duration;
        } test;
+
+       struct { /* anonymous struct used by BPF_*_GET_*_ID */
+               union {
+                       __u32           start_id;
+                       __u32           prog_id;
+                       __u32           map_id;
+               };
+               __u32           next_id;
+       };
+
+       struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
+               __u32           bpf_fd;
+               __u32           info_len;
+               __aligned_u64   info;
+       } info;
 } __attribute__((aligned(8)));
 
 /* BPF helper function descriptions:
@@ -673,4 +693,25 @@ struct xdp_md {
        __u32 data_end;
 };
 
+#define BPF_TAG_SIZE   8
+
+struct bpf_prog_info {
+       __u32 type;
+       __u32 id;
+       __u8  tag[BPF_TAG_SIZE];
+       __u32 jited_prog_len;
+       __u32 xlated_prog_len;
+       __aligned_u64 jited_prog_insns;
+       __aligned_u64 xlated_prog_insns;
+} __attribute__((aligned(8)));
+
+struct bpf_map_info {
+       __u32 type;
+       __u32 id;
+       __u32 key_size;
+       __u32 value_size;
+       __u32 max_entries;
+       __u32 map_flags;
+} __attribute__((aligned(8)));
+
 #endif /* __LINUX_BPF_H__ */
index edf43ddf47b00b49ebe404ef2cd091a2cb19a312..2055783e6ee9c33cb8d6ffe12b0f1a61e13a3af3 100644 (file)
@@ -37,6 +37,13 @@ enum {
 #define TC_ACT_QUEUED          5
 #define TC_ACT_REPEAT          6
 #define TC_ACT_REDIRECT                7
+#define TC_ACT_TRAP            8 /* For hw path, this means "trap to cpu"
+                                  * and don't further process the frame
+                                  * in hardware. For sw path, this is
+                                  * equivalent of TC_ACT_STOLEN - drop
+                                  * the skb and act like everything
+                                  * is alright.
+                                  */
 
 /* There is a special kind of actions called "extended actions",
  * which need a value parameter. These have a local opcode located in