summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerin Jacob <jerinj@marvell.com>2019-09-03 16:29:31 +0530
committerThomas Monjalon <thomas@monjalon.net>2019-10-12 14:20:21 +0200
commit6861c01001ac3b1869f5cf1f492809875f753e67 (patch)
tree912a74b2614119bd6849f0261344fe621d05b147
parentfc8b96fbc060ad72d5f1d555ae9c4eac93669d5c (diff)
downloaddpdk-next-eventdev-6861c01001ac3b1869f5cf1f492809875f753e67.zip
dpdk-next-eventdev-6861c01001ac3b1869f5cf1f492809875f753e67.tar.gz
dpdk-next-eventdev-6861c01001ac3b1869f5cf1f492809875f753e67.tar.xz
bpf/arm: add build infrastructure
Add build infrastructure and documentation update for arm64 JIT support. Signed-off-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
-rw-r--r--MAINTAINERS1
-rw-r--r--doc/guides/prog_guide/bpf_lib.rst2
-rw-r--r--doc/guides/rel_notes/release_19_11.rst5
-rw-r--r--lib/librte_bpf/Makefile2
-rw-r--r--lib/librte_bpf/bpf.c4
-rw-r--r--lib/librte_bpf/bpf_impl.h3
-rw-r--r--lib/librte_bpf/bpf_jit_arm64.c19
-rw-r--r--lib/librte_bpf/meson.build2
8 files changed, 34 insertions, 4 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index b020662..f8a56e2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -251,6 +251,7 @@ M: Gavin Hu <gavin.hu@arm.com>
F: lib/librte_eal/common/include/arch/arm/*_64.h
F: lib/librte_net/net_crc_neon.h
F: lib/librte_acl/acl_run_neon.*
+F: lib/librte_bpf/bpf_jit_arm64.c
F: lib/librte_lpm/rte_lpm_neon.h
F: lib/librte_hash/rte*_arm64.h
F: lib/librte_efd/rte*_arm64.h
diff --git a/doc/guides/prog_guide/bpf_lib.rst b/doc/guides/prog_guide/bpf_lib.rst
index 7c08e6b..9c728da 100644
--- a/doc/guides/prog_guide/bpf_lib.rst
+++ b/doc/guides/prog_guide/bpf_lib.rst
@@ -30,7 +30,7 @@ The library API provides the following basic operations:
Not currently supported eBPF features
-------------------------------------
- - JIT for non X86_64 platforms
+ - JIT support only available for X86_64 and arm64 platforms
- cBPF
- tail-pointer call
- eBPF MAP
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 23ceb8f..85953b9 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -110,6 +110,11 @@ New Features
Added stateful decompression support in the Intel QuickAssist Technology PMD.
Please note that stateful compression is not supported.
+* **Added eBPF JIT support for arm64.**
+
+ Added eBPF JIT support for arm64 architecture to improve the eBPF program
+ performance.
+
Removed Items
-------------
diff --git a/lib/librte_bpf/Makefile b/lib/librte_bpf/Makefile
index c0e8aaa..419a516 100644
--- a/lib/librte_bpf/Makefile
+++ b/lib/librte_bpf/Makefile
@@ -31,6 +31,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_BPF) += bpf_load_elf.c
endif
ifeq ($(CONFIG_RTE_ARCH_X86_64),y)
SRCS-$(CONFIG_RTE_LIBRTE_BPF) += bpf_jit_x86.c
+else ifeq ($(CONFIG_RTE_ARCH_ARM64),y)
+SRCS-$(CONFIG_RTE_LIBRTE_BPF) += bpf_jit_arm64.c
endif
# install header files
diff --git a/lib/librte_bpf/bpf.c b/lib/librte_bpf/bpf.c
index cc963d5..7e1879f 100644
--- a/lib/librte_bpf/bpf.c
+++ b/lib/librte_bpf/bpf.c
@@ -41,8 +41,10 @@ bpf_jit(struct rte_bpf *bpf)
{
int32_t rc;
-#ifdef RTE_ARCH_X86_64
+#if defined(RTE_ARCH_X86_64)
rc = bpf_jit_x86(bpf);
+#elif defined(RTE_ARCH_ARM64)
+ rc = bpf_jit_arm64(bpf);
#else
rc = -ENOTSUP;
#endif
diff --git a/lib/librte_bpf/bpf_impl.h b/lib/librte_bpf/bpf_impl.h
index b577e2c..03ba0ae 100644
--- a/lib/librte_bpf/bpf_impl.h
+++ b/lib/librte_bpf/bpf_impl.h
@@ -25,9 +25,8 @@ extern int bpf_validate(struct rte_bpf *bpf);
extern int bpf_jit(struct rte_bpf *bpf);
-#ifdef RTE_ARCH_X86_64
extern int bpf_jit_x86(struct rte_bpf *);
-#endif
+extern int bpf_jit_arm64(struct rte_bpf *);
extern int rte_bpf_logtype;
diff --git a/lib/librte_bpf/bpf_jit_arm64.c b/lib/librte_bpf/bpf_jit_arm64.c
new file mode 100644
index 0000000..621bb7f
--- /dev/null
+++ b/lib/librte_bpf/bpf_jit_arm64.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2019 Marvell International Ltd.
+ */
+
+#include <errno.h>
+
+#include <rte_common.h>
+
+#include "bpf_impl.h"
+/*
+ * Produce a native ISA version of the given BPF code.
+ */
+int
+bpf_jit_arm64(struct rte_bpf *bpf)
+{
+ RTE_SET_USED(bpf);
+
+ return -ENOTSUP;
+}
diff --git a/lib/librte_bpf/meson.build b/lib/librte_bpf/meson.build
index 11c1fb5..13fc02d 100644
--- a/lib/librte_bpf/meson.build
+++ b/lib/librte_bpf/meson.build
@@ -10,6 +10,8 @@ sources = files('bpf.c',
if arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64')
sources += files('bpf_jit_x86.c')
+elif dpdk_conf.has('RTE_ARCH_ARM64')
+ sources += files('bpf_jit_arm64.c')
endif
install_headers = files('bpf_def.h',