[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <157020976367.1824887.285329296145540311.stgit@alrua-x1>
Date: Fri, 04 Oct 2019 19:22:43 +0200
From: Toke Høiland-Jørgensen <toke@...hat.com>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: Alexei Starovoitov <ast@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Marek Majkowski <marek@...udflare.com>,
Lorenz Bauer <lmb@...udflare.com>,
Alan Maguire <alan.maguire@...cle.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
bpf@...r.kernel.org
Subject: [PATCH bpf-next v2 3/5] tools: Update bpf.h header for program chain
calls
From: Toke Høiland-Jørgensen <toke@...hat.com>
This updates the bpf.h UAPI header in tools/ to add the bpf chain
call-related definitions.
Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
---
tools/include/uapi/linux/bpf.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 77c6be96d676..b5dbc49fa1a3 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -107,6 +107,9 @@ enum bpf_cmd {
BPF_MAP_LOOKUP_AND_DELETE_ELEM,
BPF_MAP_FREEZE,
BPF_BTF_GET_NEXT_ID,
+ BPF_PROG_CHAIN_ADD,
+ BPF_PROG_CHAIN_DEL,
+ BPF_PROG_CHAIN_GET,
};
enum bpf_map_type {
@@ -288,6 +291,12 @@ enum bpf_attach_type {
/* The verifier internal test flag. Behavior is undefined */
#define BPF_F_TEST_STATE_FREQ (1U << 3)
+/* Whether to enable chain call injection at program return. If set, the
+ * verifier will rewrite program returns to check for and jump to chain call
+ * programs configured with the BPF_PROG_CHAIN_* commands to the bpf syscall.
+ */
+#define BPF_F_INJECT_CHAIN_CALLS (1U << 4)
+
/* When BPF ldimm64's insn[0].src_reg != 0 then this can have
* two extensions:
*
@@ -510,6 +519,13 @@ union bpf_attr {
__u64 probe_offset; /* output: probe_offset */
__u64 probe_addr; /* output: probe_addr */
} task_fd_query;
+
+ struct { /* anonymous struct used by BPF_PROG_CHAIN_* commands */
+ __u32 prev_prog_fd;
+ __u32 next_prog_fd;
+ __u32 retcode;
+ __u32 next_prog_id; /* output: prog_id */
+ };
} __attribute__((aligned(8)));
/* The description below is an attempt at providing documentation to eBPF
Powered by blists - more mailing lists