[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 03/12] ebpf/uBPF: Introduce userspace ebpf data structure
From: |
Zhang Chen |
Subject: |
[RFC PATCH 03/12] ebpf/uBPF: Introduce userspace ebpf data structure |
Date: |
Fri, 17 Jun 2022 15:36:21 +0800 |
Add ebpf/ubpf.h for the UbpfState.
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
---
ebpf/ubpf.h | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 ebpf/ubpf.h
diff --git a/ebpf/ubpf.h b/ebpf/ubpf.h
new file mode 100644
index 0000000000..2562fff503
--- /dev/null
+++ b/ebpf/ubpf.h
@@ -0,0 +1,37 @@
+/*
+ * QEMU Userspace eBPF Header
+ *
+ * Copyright(C) 2022 Intel Corporation.
+ *
+ * Author:
+ * Zhang Chen <chen.zhang@intel.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef QEMU_UBPF_H
+#define QEMU_UBPF_H
+
+#include <ubpf.h>
+#include <math.h>
+#include <elf.h>
+
+#define MAX_LEN (1024 * 1024)
+
+typedef struct UbpfState {
+ bool jit;
+ char *code_path;
+ void *code;
+ size_t code_len;
+ char *target_path;
+ void *target;
+ size_t target_len;
+ struct ubpf_vm *vm;
+ ubpf_jit_fn fn;
+ int type;
+ char *func;
+} UbpfState;
+
+#endif /* QEMU_UBPF_H */
--
2.25.1
- [RFC PATCH 00/12] Introduce QEMU userspace ebpf support, Zhang Chen, 2022/06/17
- [RFC PATCH 01/12] configure: Add iovisor/ubpf project as a submodule for QEMU, Zhang Chen, 2022/06/17
- Re: [RFC PATCH 01/12] configure: Add iovisor/ubpf project as a submodule for QEMU, Daniel P . Berrangé, 2022/06/17
- RE: [RFC PATCH 01/12] configure: Add iovisor/ubpf project as a submodule for QEMU, Zhang, Chen, 2022/06/20
- Re: [RFC PATCH 01/12] configure: Add iovisor/ubpf project as a submodule for QEMU, Daniel P . Berrangé, 2022/06/20
- Re: [RFC PATCH 01/12] configure: Add iovisor/ubpf project as a submodule for QEMU, Thomas Huth, 2022/06/20
- RE: [RFC PATCH 01/12] configure: Add iovisor/ubpf project as a submodule for QEMU, Zhang, Chen, 2022/06/20
- Re: [RFC PATCH 01/12] configure: Add iovisor/ubpf project as a submodule for QEMU, Thomas Huth, 2022/06/20
[RFC PATCH 02/12] meson: Add ubpf build config and misc, Zhang Chen, 2022/06/17
[RFC PATCH 03/12] ebpf/uBPF: Introduce userspace ebpf data structure,
Zhang Chen <=
[RFC PATCH 05/12] ebpf/uBPF: Add qemu_prepare_ubpf to load ebpf binary, Zhang Chen, 2022/06/17
[RFC PATCH 04/12] ebpf/uBPF: Introduce ubpf initialize functions, Zhang Chen, 2022/06/17
[RFC PATCH 06/12] ebpf/uBPF: Add qemu_ubpf_run_once excute real ebpf program, Zhang Chen, 2022/06/17
[RFC PATCH 07/12] net/filter: Introduce filter-ubpf module, Zhang Chen, 2022/06/17
[RFC PATCH 09/12] softmmu/vl.c: Add filter-ubpf for netdev as other netfilters, Zhang Chen, 2022/06/17
[RFC PATCH 08/12] qapi: Add FilterUbpfProperties and qemu-options, Zhang Chen, 2022/06/17
[RFC PATCH 10/12] net/filter-ubpf.c: run the ubpf program to handle network packet, Zhang Chen, 2022/06/17
[RFC PATCH 11/12] docs/devel: Add userspace-ebpf.rst, Zhang Chen, 2022/06/17