From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 41686A2E1B for ; Tue, 3 Sep 2019 12:59:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A28DF1E901; Tue, 3 Sep 2019 12:59:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id E39BE1E901 for ; Tue, 3 Sep 2019 12:59:26 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x83At1wG024830; Tue, 3 Sep 2019 03:59:24 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=jyrwm8GAtGXTDG6nwugMW8m6sDjkL90kfoBeK5BVaWY=; b=xrTnqB2uEJJuMaw+B9of59KZN8htnmaTdvnvFVxt6JmigGpRa7608uGJWYvyxTucZArs dG/3hwq2G/dJT8lfWaM8D5Z5iv4pDef4RoKuValKUeJa3Hyi9/h63W5TipM0/HmYZMul /fWQLPRbg/wlhzke2TmQ+urzek540U0lRlKp0p52y4ligIk66J/PETd/gWsDMi4gpt4T 3BNSZk8lmUDqAlkZZDQJ/qmZwSVN6ylBAeIk5eEyd6PZgRU8mtcgaFJh7WFa28e1lWeS Pbm+eUtRm03P3J4VlPJRCOSdIX97V9N+ZeFM8o80+NKrhQstqjJWOBignbRgUrJchKhH jg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2uqrdm956x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 03 Sep 2019 03:59:23 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 3 Sep 2019 03:59:21 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 3 Sep 2019 03:59:21 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 19B0F3F7041; Tue, 3 Sep 2019 03:59:18 -0700 (PDT) From: To: CC: , , , , Jerin Jacob Date: Tue, 3 Sep 2019 16:29:31 +0530 Message-ID: <20190903105938.33231-2-jerinj@marvell.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190903105938.33231-1-jerinj@marvell.com> References: <20190903105938.33231-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-03_01:2019-09-03,2019-09-03 signatures=0 Subject: [dpdk-dev] [PATCH 1/8] bpf/arm64: add build infrastructure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob Add build infrastructure and documentation update for arm64 JIT support. Signed-off-by: Jerin Jacob --- MAINTAINERS | 1 + doc/guides/prog_guide/bpf_lib.rst | 2 +- doc/guides/rel_notes/release_19_11.rst | 5 +++++ lib/librte_bpf/Makefile | 2 ++ lib/librte_bpf/bpf.c | 4 +++- lib/librte_bpf/bpf_impl.h | 3 +-- lib/librte_bpf/bpf_jit_arm64.c | 19 +++++++++++++++++++ lib/librte_bpf/meson.build | 2 ++ 8 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 lib/librte_bpf/bpf_jit_arm64.c diff --git a/MAINTAINERS b/MAINTAINERS index 410026086..c2e91343c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -252,6 +252,7 @@ M: Gavin Hu 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 7c08e6b2d..9c728da7b 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 8490d897c..a0a92b8ae 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -56,6 +56,11 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **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 c0e8aaa68..419a5162e 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 cc963d52e..7e1879ffa 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 b577e2cbe..03ba0ae11 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 000000000..621bb7f46 --- /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 + +#include + +#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 11c1fb558..13fc02db3 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', -- 2.23.0