From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0047.outbound.protection.outlook.com [104.47.33.47]) by dpdk.org (Postfix) with ESMTP id 9C25BA495 for ; Tue, 13 Mar 2018 14:02:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=WPTVyu2vp3YXtRqjdEVvlxqrFAIH7WyVJcY/cy/dk0k=; b=VC1qNetl9ZP0neyxh9ZiEi+UMCdmpA4I/dgaDVfbULRgzCqZZQSYJeE5K3RtAyZq9cUfsDkHWVUEwd7NtJEVRlN2M0Lv3udAt7EpuflR6ez0/W3D+LQjZ98YSSg3NMhD6pJHrXBIFupUuokZ8Ewjcb77HYnRDIN80kD9o8briv0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (111.93.218.67) by CY1PR07MB2524.namprd07.prod.outlook.com (10.167.16.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Tue, 13 Mar 2018 13:02:56 +0000 Date: Tue, 13 Mar 2018 18:32:41 +0530 From: Jerin Jacob To: Konstantin Ananyev Cc: dev@dpdk.org Message-ID: <20180313130240.GA31588@jerin> References: <1520613725-9176-1-git-send-email-konstantin.ananyev@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1520613725-9176-1-git-send-email-konstantin.ananyev@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0112.INDPRD01.PROD.OUTLOOK.COM (10.174.208.28) To CY1PR07MB2524.namprd07.prod.outlook.com (10.167.16.15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb35044b-3741-4751-079a-08d588e2be33 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2524; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 3:CWPm9JCHHZj+FTvtgmqZbIgU1SakvCr1FGZtb07YEpZ4dNPB3ux0b2JRgg5LBGDWnnIuQQEAIBmfwRGvtndDO/5NAPinOd3k4FdmFYfAbmx+55uWbmV256dWuD9bzwMekSjvCefp1Euhn31sLOCIMYGSPjsPJJy5KYmg1erKlBpikJQgaClaMVLD053TCgg5QD3vkc7/QcG6N+3K8wjdnyO5SFnyKbonT98arY4jya3D7Ko000zLk6WfbjH9PkRD; 25:TD+cRaMPEGsF0d3+rpwjstvRMfhcPkdYtyn46mTy3DJwiq324/1Eul60NQ8BlI0+2NsIeabHM+Mgi8p/eiH7+oeyFAYrQXen2fs6ohEHcJaOEXWjLw3tq8Jd9fRWlfv0hmaJf/7XEAdw+iWlXe4u9YGped2TM0JgwVuhp4of4H6F0ChTaGtS78iGhb8RrY7kNPiTCtCXYcipQCc9bQBMxVSXGnnCrSyoXUMDWL9PAqsnkKJ1yMLB2z/cv9y39b5qKFGfXjXfP0973omB7LmiRUMqRrcepkkPuoSC/dAm2UO75BhnUXxkjDLgmKjki5Yr0Xs7cFJLr3ImrYpJfYPkGA==; 31:L8cPvtJLwajLRhLjzv56LzcPY7dq8phNf9s/0FG/RIi1D2UuRM7W2K28Q+RFKmeDRYL/b0R2keZnxZ6k1BphoZpWxkXwwcIJdmkAcHZYn87gC4e9KhpW83rljQgwFfpW6zjd821KieLM45z0mj36lfYob+oDpw49Wejj7ez2AjkOmOb+Z7HTDYkxdBQxGG9x4LeauNKxHjjZYmNAyLvruLBuUxhGQFuHVw/SwwIyIJw= X-MS-TrafficTypeDiagnostic: CY1PR07MB2524: X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 20:x6gszd4w8xEkuUXYS8/WBjyA9HIy3SdG0Szv5zZP9sjjFY5ma3GU0fyz1+QxTB+07wWzR2TSrc24tIPSuFsxUXCuyddhqudjt5GiaUtGRdIMP/kwD/RhfQFgn3BVBFB43obOlnVYo0smqsOU5JsiGaQjBv7ypaWKEJElKX31hjX7lUXv2bUKD1hwAeaJcRw8KdZKTFRGL79URZVpTdSfEjnNcBDRBKPEF0ZLVXfpWVdHWxIhar+zxAWag37m19TclF95DQCHty2UDc7ksTEwVZGqPUrQSUwjcP/1Iyyy1AmpYCEVk6UP514p2JLldefz+lZYFBR/UnlbpS2hGzml8sLPB7y2tQEihB+h800z+GfHGtX3n9GJg6+nuw913b/6UwWcYNt/Kwcn7+iPHFH5XdRzCoQAEuOPc5DBpIV4pf0QlJiNw7P+kjNfXeRQcSmBww27y/Z3kazZAm19d/wg+uXztHyN4eOQZsiKBRTgoS9R2+mNo4kn7thrsl92JJtnFEOMUjUUi7JWcOmjM6aKsrCaWgAGX2HL+1HZTmKG3PsqR6HPLoG2+E60XyZR7kJG/O6BUHjHJ8hHoHpT3NtBrIBDEvh9cktccg2NLGUnymg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231221)(944501244)(52105095)(6041310)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:CY1PR07MB2524; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2524; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2524; 4:Ebj1rSvRSWk2shAdBblZYw1APrvkDQaHFOLICSrfmvksU8ux85Ix23mERLVQRIYvAPAzP+W0VY9ohhBQQ5Y4A0VhPue8qusBhAK/YQnTXVL3giV1nYeqvt8slx4nX8bkoqLCUU9Axc2+muD3osJf7afPcamlRze37EBHzz/wvzmTw5HagjLoexseY3/Iy+h0v7mkFB1ojPQm1bSUCygv9dGJ5DcR7nbc7TzwoLntd4sO6wg1yRTlXlrm8biHq5YBYgB4+mdSQOh1NbTZnZi8Lg1S59dAGEBjvsiRPwzZmFMIxCvKBrRKr1DaubLBhX/TQceyGjd3al086/+nYdbXIEmMkt9QCesPDf8YIc8inqw= X-Forefront-PRVS: 0610D16BBE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(346002)(39380400002)(396003)(13464003)(199004)(189003)(76094002)(229853002)(55016002)(16526019)(66066001)(316002)(8676002)(58126008)(81156014)(386003)(106356001)(25786009)(53936002)(16586007)(81166006)(33896004)(4326008)(8936002)(6496006)(52116002)(186003)(47776003)(76176011)(6916009)(33716001)(305945005)(50466002)(1076002)(23726003)(105586002)(26005)(97736004)(6246003)(33656002)(3846002)(478600001)(5009440100003)(7736002)(6666003)(2906002)(42882007)(68736007)(9686003)(5660300001)(6116002)(72206003)(2950100002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2524; H:jerin; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2524; 23:2+fouM9mN4KTbwqE8vinMOFeAaYCD7SlaNUyP9vsR?= =?us-ascii?Q?lDnJFR1NfSXbKSxhMqw7KaRtwOIHL3FTpmysAWcXbYidbUkkEvt+tzN6/6wx?= =?us-ascii?Q?SK3JKfUb96+5UuGeUgfTr2E6l+2kwesUjvkRwa+Q4H0PQThY8snQiUtplUNk?= =?us-ascii?Q?YTo8VTQcFZPewTkF40DxcqPeZwnjHINAIS6pYDa4eWKbO8uRYBl/ryBO+ubI?= =?us-ascii?Q?3dMGVxcONkNs3yPuDEE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qOYw+7/zWz/d7XRKqp6BrUMc4oE2/9qIV/noCJg2iv+DBPS7tzMMQAGQzcoyv2xwfrzcg6uvvtAwFxnds=; 7:6E45YR+ALt1qCd5cUClvXPt7LDGk01G3+iDh17nNFd+SvFfrVjUj2ZzYvnv+4E3SrWBMPhqyoO/Zt/ZC6h/dAc4cv3/J+0Uk04mnacZ5yj8LlKPtzEIWUMC6ZF1hQ6hkixvcdIkJ8MaLgH1eP/j+6Agvx6k8cId3whKVimSXHw0Y8v4p7O4dn1FaJBvgEOglqareenLGa2CvmUryp6ywphkJUfwFDWHqtumXL3Jct1SOJHs1fWm4asJGlkJetbuf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2018 13:02:56.6857 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb35044b-3741-4751-079a-08d588e2be33 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2524 Subject: Re: [dpdk-dev] [PATCH v1 0/5] add framework to load and execute BPF code 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: , X-List-Received-Date: Tue, 13 Mar 2018 13:03:00 -0000 -----Original Message----- > Date: Fri, 9 Mar 2018 16:42:00 +0000 > From: Konstantin Ananyev > To: dev@dpdk.org > CC: Konstantin Ananyev > Subject: [dpdk-dev] [PATCH v1 0/5] add framework to load and execute BPF > code > X-Mailer: git-send-email 1.7.0.7 Hi Konstantin, > > BPF is used quite intensively inside Linux (and BSD) kernels > for various different purposes and proved to be extremely useful. > > BPF inside DPDK might also be used in a lot of places > for a lot of similar things. > As an example to: > - packet filtering/tracing (aka tcpdump) > - packet classification > - statistics collection > - HW/PMD live-system debugging/prototyping - trace HW descriptors, > internal PMD SW state, etc. > ... > > All of that in a dynamic, user-defined and extensible manner. > > So these series introduce new library - librte_bpf. > librte_bpf provides API to load and execute BPF bytecode within > user-space dpdk app. > It supports basic set of features from eBPF spec. > Also it introduces basic framework to load/unload BPF-based filters > on eth devices (right now via SW RX/TX callbacks). It is an interesting feature. I am yet to catch up on your implementation details. Meanwhile, I have tried to run non JIT version on arm64. I had some compilation issue with 4.9 kernel with gcc 5.3 toolchain. Following patch fixes that. Just wondering what we will do with FreeBSD, May it better to kill the dependency of linux/filter.h and different kernel versions by making bpf_impl.h self sufficient. Just a thought. diff --git a/lib/librte_bpf/bpf_impl.h b/lib/librte_bpf/bpf_impl.h index f094170..e500e26 100644 --- a/lib/librte_bpf/bpf_impl.h +++ b/lib/librte_bpf/bpf_impl.h @@ -13,6 +13,26 @@ extern "C" { #endif +#ifndef BPF_JLT +#define BPF_JLT 0xa0 /* LT is unsigned, '<' */ +#endif + +#ifndef BPF_JLE +#define BPF_JLE 0xb0 /* LE is unsigned, '<=' */ +#endif + +#ifndef BPF_JSLT +#define BPF_JSLT 0xc0 /* SLT is signed, '<' */ +#endif + +#ifndef BPF_JSLE +#define BPF_JSLE 0xd0 /* SLE is signed, '<=' */ +#endif + +#ifndef EM_BPF +#define EM_BPF 247 /* Linux BPF - in-kernel virtual machine */ +#endif +