]> git.droids-corp.org - dpdk.git/commitdiff
bpf/arm: add build infrastructure
authorJerin Jacob <jerinj@marvell.com>
Tue, 3 Sep 2019 10:59:31 +0000 (16:29 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 12 Oct 2019 12:20:21 +0000 (14:20 +0200)
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>
MAINTAINERS
doc/guides/prog_guide/bpf_lib.rst
doc/guides/rel_notes/release_19_11.rst
lib/librte_bpf/Makefile
lib/librte_bpf/bpf.c
lib/librte_bpf/bpf_impl.h
lib/librte_bpf/bpf_jit_arm64.c [new file with mode: 0644]
lib/librte_bpf/meson.build

index b020662701e4211bb79b2d6ea59d2f24ccedde92..f8a56e2e2615feb9d573bf4b7814bb0615b7257f 100644 (file)
@@ -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_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
 F: lib/librte_lpm/rte_lpm_neon.h
 F: lib/librte_hash/rte*_arm64.h
 F: lib/librte_efd/rte*_arm64.h
index 7c08e6b2d392b421e5cc2fede3e9c86183302809..9c728da7bdc66557f9ced4c1e5422e8b942cdf0b 100644 (file)
@@ -30,7 +30,7 @@ The library API provides the following basic operations:
 Not currently supported eBPF features
 -------------------------------------
 
 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
  - cBPF
  - tail-pointer call
  - eBPF MAP
index 23ceb8f6702e8954a1109892255d5fc63044d744..85953b962d04b3b1841467f2b2406eb17ff52291 100644 (file)
@@ -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 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
 -------------
 
 Removed Items
 -------------
index c0e8aaa68c812645f646241227a5d6751318d3f8..419a5162e01338d78a36ecda0ffe6d8c8368b657 100644 (file)
@@ -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
 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
 endif
 
 # install header files
index cc963d52e78378bc568450a3d379c9a2deb9f310..7e1879ffa5b5ef7c532d0693fe03875cac83560c 100644 (file)
@@ -41,8 +41,10 @@ bpf_jit(struct rte_bpf *bpf)
 {
        int32_t rc;
 
 {
        int32_t rc;
 
-#ifdef RTE_ARCH_X86_64
+#if defined(RTE_ARCH_X86_64)
        rc = bpf_jit_x86(bpf);
        rc = bpf_jit_x86(bpf);
+#elif defined(RTE_ARCH_ARM64)
+       rc = bpf_jit_arm64(bpf);
 #else
        rc = -ENOTSUP;
 #endif
 #else
        rc = -ENOTSUP;
 #endif
index b577e2cbe9b2d540910cf782da40cb8f92590c53..03ba0ae1128d17821049bbfad1322cb163dd099f 100644 (file)
@@ -25,9 +25,8 @@ extern int bpf_validate(struct rte_bpf *bpf);
 
 extern int bpf_jit(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 *);
 extern int bpf_jit_x86(struct rte_bpf *);
-#endif
+extern int bpf_jit_arm64(struct rte_bpf *);
 
 extern int rte_bpf_logtype;
 
 
 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 (file)
index 0000000..621bb7f
--- /dev/null
@@ -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;
+}
index 11c1fb5586630c1fa65cbe61ac84758159e23eec..13fc02db38ed92ec0df1307ae2c41042ec9f70b7 100644 (file)
@@ -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')
 
 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',
 endif
 
 install_headers = files('bpf_def.h',