From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B590A0C4E; Thu, 21 Oct 2021 16:15:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7014041224; Thu, 21 Oct 2021 16:15:28 +0200 (CEST) Received: from mail-108-mta244.mxroute.com (mail-108-mta244.mxroute.com [136.175.108.244]) by mails.dpdk.org (Postfix) with ESMTP id 82A3B411FE for ; Thu, 21 Oct 2021 16:15:27 +0200 (CEST) Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta244.mxroute.com (ZoneMTA) with ESMTPSA id 17ca334e5660000b55.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Thu, 21 Oct 2021 14:15:25 +0000 X-Zone-Loop: 6eb86c5c806a50b1b2359827a2b67f69442ee7d48844 X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc: To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9QL5c7ZJ5/B+StMOplN7vqXknARnhgG5OMKnJ9vzSbo=; b=cB6JD/8fUt+4Ol8tuzfhaPM7Tz 0Hw/zvgygAvDpdvFUbx5UfFEwPRZ0v+ZP07cEVC5oJWIyYHv8eJ0VQPX/Upr/UExU2Y9TrRyuV2dZ 2tJakAjk/U1N3X8mMxeEx3i/MldtXFKxQ82c+Jss9Up6cbyYgI5fwCqP4kfrwyKlup50kIAlzHNeR Bd54jTztS6j68CMaERKRJyZcmCCGBCvoSeQRTZSu4TxMp6pmw+ZL++I2rXVCHgQiuevSrKZBZUxZF O8IyIvoQjchUT0NRT6roAt13vXWf5aNspKOjCDR3dLn1OXGI0O3NeaVLao3X/N2cwoNsv2zhvJi0w PzZju8Kw==; Message-ID: Date: Thu, 21 Oct 2021 15:15:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Content-Language: en-US To: Stephen Hemminger , dev@dpdk.org Cc: Konstantin Ananyev References: <20210903004732.109023-1-stephen@networkplumber.org> <20211020214236.71444-1-stephen@networkplumber.org> <20211020214236.71444-5-stephen@networkplumber.org> From: "Kinsella, Ray" In-Reply-To: <20211020214236.71444-5-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu X-Zone-Spam-Resolution: no action X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0, FROM_HAS_DN=0, RCPT_COUNT_THREE=0, TO_DN_SOME=0, MIME_GOOD=-0.1, FROM_EQ_ENVFROM=0, MIME_TRACE=0, RCVD_COUNT_ZERO=0, NEURAL_SPAM=0, MID_RHS_MATCH_FROM=0] Subject: Re: [dpdk-dev] [PATCH v15 04/12] bpf: add function to convert classic BPF to DPDK BPF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 20/10/2021 22:42, Stephen Hemminger wrote: > The pcap library emits classic BPF (32 bit) and is useful for > creating filter programs. The DPDK BPF library only implements > extended BPF (eBPF). Add an function to convert from old to > new. > > The rte_bpf_convert function uses rte_malloc to put the resulting > program in hugepage shared memory so it can be passed from a > secondary process to a primary process. > > The code to convert was originally done as part of the Linux > kernel implementation then converted to a userspace program. > See https://github.com/tklauser/filter2xdp > > Both authors have agreed that it is allowable to create a modified > version of this code and license it with BSD license used by DPDK. > > Signed-off-by: Stephen Hemminger > Acked-by: Konstantin Ananyev > --- > lib/bpf/bpf_convert.c | 575 ++++++++++++++++++++++++++++++++++++++++++ > lib/bpf/meson.build | 5 + > lib/bpf/rte_bpf.h | 25 ++ > lib/bpf/version.map | 6 + > 4 files changed, 611 insertions(+) > create mode 100644 lib/bpf/bpf_convert.c > Acked-by: Ray Kinsella