From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0056.outbound.protection.outlook.com [104.47.38.56]) by dpdk.org (Postfix) with ESMTP id EB1AE1B729 for ; Mon, 9 Apr 2018 06:54:36 +0200 (CEST) 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=dp2qq2hnXtbWl9knvKTIHhOLOyFuOTmls5PDPs6iexA=; b=nBCwYjQNZpdn4yFLrNHC5ExfR1LEhbpsv/NVqMEn5kDFnyJwHUqBW4IAsBIls7eq5ZDAeS6KKxCR/h38m0+x4pg3rv+5LRnyFixKrwLBHGnI5uLY0mmOXHz6/rl5qS6G6WEC/OdehIvdh188Ze+qi6NVSnsgjzzemgkLkQ6craM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (111.93.218.67) by BN3PR07MB2514.namprd07.prod.outlook.com (2a01:111:e400:7bbf::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Mon, 9 Apr 2018 04:54:34 +0000 Date: Mon, 9 Apr 2018 10:24:27 +0530 From: Jerin Jacob To: Konstantin Ananyev Cc: dev@dpdk.org Message-ID: <20180409045426.GA9585@jerin> References: <1522431163-25621-2-git-send-email-konstantin.ananyev@intel.com> <1523040581-2522-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: <1523040581-2522-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: BYAPR03CA0025.namprd03.prod.outlook.com (2603:10b6:a02:a8::38) To BN3PR07MB2514.namprd07.prod.outlook.com (2a01:111:e400:7bbf::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 08e1b9d2-fc33-4f7d-c989-08d59dd5fe14 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN3PR07MB2514; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2514; 3:kWVe/ShLcQos6U18+BhsLECWn1Zu6A5f8LUMW7UVS0R4sPaKE7rBXKjTnAack8xbAtUZsUvLc3WapEgN7+fnMuzhlUlgSfGCqWKRf39NuyVGLAijx67LvhY64vj0r2XhhVu+i/MwMCRxcLyDGmVFtYEhHw3O2hF9osogjQYWdN/yO3sW8ieb7iywingPaAISPRfyEjdAKwkgWmEc7tlfrxCf5Os6OhffoKNzKw8apqiTcmff8bZ8FeyDLI55rvu7; 25:/9OjAAYZb0xkE7qp28V43pMQs+chFmwRdYl1+1MGVRpXSPfrRPTjanN4ymi0EXzreFRHeyR+WuvLity3rvkgdHI26vhSIAurN4aydRL/fRZLf0VjkjQrZyg6/0p9mDk5Fj1m9FRCLRJdz4EmvCGrRghagFVdTnuXF09MzeRX3/YBh85SxF7hahzdOKOkheDJsjzyLLXEKxdm7nHNxxliJ5+S7EExdhA0fwGfd7xBjVPkoba9MhjuRIG2K5sh9aNg9Wlhb3Ks2OdhnGpQyd36gVE0da5ss4sOU2Oc+bNFR0O/DRF3rKNFWkg0VZzel3QwFrza/07VfcbHOc2uuT5n9A==; 31:/WQ03hvma7Mirbyu6rcndsgngMVKQ0rCVZgDRcH9366dTVJQ2bTgMr0NdNKRnwmAs5vE6UGtDzp+kqc+ukSYYLf1GdigJq5sw+Xl5Ba6pypr7dNcYPIN1axSoXAj/ZY0OQLglGg3WCNYJFrC2iw2Pc+MdZLmqEBS8jOkXkGQ9vKvo/taY7Xh9MB/lwcUQGUUuPR4QcDegqk8cVDA6oABhwkoShJfS58XIUfvjkdF+jY= X-MS-TrafficTypeDiagnostic: BN3PR07MB2514: X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2514; 20:PNEqlpWoDn8WbgF2BXrDv9sz/SnKSMsEJ8cbXKvtG21afwGt1m5Hoe3INAMDY1bkEPna1pKNo21V0VoYywBJqdNiqw238C/n+Ik8bzuFL5phO1AHPYeU7ueyHRmlVePmYsKCmSjtSczKK1pd+tCVSGDo00rZRp5iPlZLMUH23aw3UZnV0XDXCoIaBTx7kDhiscHFmUikfqyYrc46dS+j9ouOLJsgRMIodbf31KM8li6W79yrQUr7CMksCiHYw3CVZb6oxPO/pWSy/MAAOl2mtEn06NrkmbP/A1OeCxx+JeAZYDIPI/YZ9gYSU53rKMPkMi42FzrWcOMqw/5S1e1uDcW5sMQ81ofJbH+t4tnIBTU4Q2Po6NW8gGCsKte74FvmC6l3XHhnp8yoHR2W/kyXKK0Kut7eNaEGhws+nCOfDglRzzqI8Qy2rcHmvFL4k1hB6iaf3zXxMVbfZRhACMrV1oQ9rZOwglPUcx5L/4zFmGuuk/SMfFZkvY5BZVyh0g7ZktXFaGTfQZlLv8XW8nWtQoQ8VKMNNO2s6VtW5zhrtm97OLhe1eVJB91TSEm4iXN0/j9XVAkHGZXG3Y/gw9L+B4qLA7cCkz4Os6YjPC1U4WY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(190756311086443)(166708455590820)(228905959029699)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3002001)(3231221)(944501327)(52105095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:BN3PR07MB2514; BCL:0; PCL:0; RULEID:; SRVR:BN3PR07MB2514; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2514; 4:cU5xM7ijBdKnBQOvBLx3qOS8Yf+sNrMtMiywiX80Smilz+pivicaW5OngfRjbT7Xg69Jtw9ZSAQLxkn/MOMg2mjN+QZrcapRj6PPl0mxS3+SAr8LzijwAHScbRwTi0pbrnUugvigqaDvYZz562NRu3tPhOmRu2YBaT7tAeYYBnlHgeBBnTiQL3nrBthBlnRNApcRC9PoLQDYn3zrM+GMOSzlvsYaTPeRKHJvSm+ex4WyKVq17jgIjLQVjVSTOgDk0lKSz7d0JupsUc64DdQSqbCo9p24xMVDK1ZjqQ1u8H2W9oqwpe7oRwuhcliW0tInyRzlZtaWBYeNxZk7yTHFhSpYd3wrGJL6CGQb2qRTg/0j9VB8i+mwDvurURnMU5YHAHkBsd2m/ZFBwVkjCzuQHcVzcWS6UDjgudNKHTPfVOs= X-Forefront-PRVS: 0637FCE711 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(39380400002)(39850400004)(396003)(189003)(199004)(13464003)(6916009)(50466002)(478600001)(58126008)(52116002)(966005)(33656002)(72206003)(68736007)(8936002)(3846002)(66066001)(97736004)(6496006)(76176011)(47776003)(6116002)(229853002)(6246003)(23726003)(33896004)(42882007)(1076002)(6666003)(25786009)(2906002)(16526019)(186003)(4326008)(956004)(305945005)(446003)(476003)(11346002)(7736002)(26005)(5009440100003)(9686003)(486006)(81166006)(16586007)(8676002)(316002)(386003)(59450400001)(6306002)(106356001)(105586002)(53936002)(33716001)(81156014)(55016002)(5660300001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR07MB2514; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR07MB2514; 23:QOiKA7fa6DpTBQYS1i1HN2sMYsSNVqJEx2edHgPVp?= =?us-ascii?Q?PGkeO/SwJnl5pk60jYb38y6tpAvSLH6kUVsaDg0AWtH/5riJ3X5ONsJBUasU?= =?us-ascii?Q?e7jS3iopstf1uqMHbF4fUt2w4YqzHDq/OvC/PTjZn1Y7Tbkrxrh+RnYIfQLB?= =?us-ascii?Q?+TE97JReN/hW+x60CAC4UZNltav8bRK1mLHnJgLv6voR8niMtynb7KdGOOPV?= =?us-ascii?Q?zk5727Jjj/PdRfMZZp/fOHpevwonbNB5HayIz5yELwaXQcRX4QPG4vEQLYH5?= =?us-ascii?Q?IhBiBlaKiIv6vlIhoXFOpd+QhMgebXAbIrf+xTUp4NV0Bj4zHN5Frf/EwtIE?= =?us-ascii?Q?n0BKT29vqqottFYxP1nUtOlEM5EUHbBgfblf9EfhAbJIorsOhh/uYyUjly5A?= =?us-ascii?Q?5bbBxtI844cEwjdB7Z8BM2QZwp1hgwKGt5pdo3vJCH29fAoxJ3eJwHzqTEUX?= =?us-ascii?Q?7fR1jvKFw2aKYvsq+W84F+NZOlRNYqq38CcXd4PzhxIA+pRCre2sfEEUlQyE?= =?us-ascii?Q?JoKt7pr64wRErCpCDluqqy2lw3ipCaITWDg0tNsIQsbK0/EZlVasCh4s9B/5?= =?us-ascii?Q?5A51KIm0a1flaMK477vSIVCnBIn+/1nDzmSKyU1+Tr6wTLYR3wdACnp4ah69?= =?us-ascii?Q?1Pegur78LMx/8nThSXliDtaiyc1s/perhArfMictou2/i95STNlCIvTWp+72?= =?us-ascii?Q?r+CkpyjGX/VVcunpB4CktDCktOXwbMGRFrkCOCvKPUSONPV7D3+SWH7BWzis?= =?us-ascii?Q?y/pBgHNWJchm95NAhmXscTT/IFu5exRqBSd6E/LteLsI4cWcw5Nm2tTDCQyc?= =?us-ascii?Q?Bx2LuYN7Ekf+5ln4p6DPxZBKkTPTPTXceP4OgPBl3lQ04yzT4p+nkk4fgEcp?= =?us-ascii?Q?PKbst/RvMpFmWr5UqRfXuNu5sdAsypkCbxdCE91vdO5oCy3idOWPAOFvIYcL?= =?us-ascii?Q?iy43gWr0ZkQs4KHbE1sV4WAzrnd9hnl2W6pyBdy9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/7lpKowwYDWinagMa1hId1+FQiQTm3sppFmh8vCdGeZfasOlxTBFwItSjxGLIRPBZ8Zx8ZR9jg6vvbfb4ltxaQ2Hh4iavAZ3CusDUUNVjAogxIiX6IRkulPAYRzSlX+21tPYpQs3TvJnRJh3nPQFG6Z479MxNZ4Aw5DE6/Tq8HUtJ4ufQ==; 5:NwR34OKAzzl7szwKRlDSUIoXrHwg5EpzIotYH/QassWJQ7xGiGUtOvNUZSLVBfynkF0RCW6K+W64Xm/pBe8si3k/JrqyGhj2rcCw2d45QdcIpf3WoZlSPOXMe/pSrnoSz4gcgVuZyYn0yf9ETuU0nVWLBDiECLpsDPP2fwtt8vw=; 24:dk/0pkqHpmt7EBiOL4HPAzJ1RVzx1NmxEo5Lnsgmfg7CM1q7voaGRg85IoQY/xEaVRiBk6je9hKjjqzHkLcfISZOQHcs8KgllQ/ctAmspdo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2514; 7:/Rwe+v49ZKQr3mqnnyznyNO2FrSVGSnK6sml30/3wjXbP+B7fuyk3d8n2fVheWKgbCFsTQzYbMgNLYQY/RF6MIdoia8ddlP/dS8eYGqm48HBZks2oyE80BD4zvoTtrr1fZzUxND6fUF6t/7kEbZFUA+A9Y3H23phG/P2mzq3dxxT/gK1YdJkYjWeoI/4AnG6KgVz0pEUu+nL32iHo5qmD9HPdbi/OpLVAcYDZ+mKt5EHL6tDI4Tldll1oBOKFi3A X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2018 04:54:34.5160 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08e1b9d2-fc33-4f7d-c989-08d59dd5fe14 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2514 Subject: Re: [dpdk-dev] [PATCH v3 00/10] 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: Mon, 09 Apr 2018 04:54:37 -0000 -----Original Message----- > Date: Fri, 6 Apr 2018 19:49:32 +0100 > From: Konstantin Ananyev > To: dev@dpdk.org > CC: Konstantin Ananyev > Subject: [dpdk-dev] [PATCH v3 00/10] add framework to load and execute BPF > code > X-Mailer: git-send-email 1.7.0.7 > > 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. > - Comeup with your own idea > > 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). > > How to try it: > =============== > > 1) run testpmd as usual and start your favorite forwarding case. > 2) build bpf program you'd like to load > (you'll need clang v3.7 or above): > $ cd test/bpf > $ clang -O2 -target bpf -c t1.c > > 3) load bpf program(s): > testpmd> bpf-load rx|tx > > : [-][J][M] > J - use JIT generated native code, otherwise BPF interpreter will be used. > M - assume input parameter is a pointer to rte_mbuf, > otherwise assume it is a pointer to first segment's data. > > Few examples: > > # to load (not JITed) dummy.o at TX queue 0, port 0: > testpmd> bpf-load tx 0 0 - ./dpdk.org/test/bpf/dummy.o > #to load (and JIT compile) t1.o at RX queue 0, port 1: > testpmd> bpf-load rx 1 0 J ./dpdk.org/test/bpf/t1.o > > #to load and JIT t3.o (note that it expects mbuf as an input): > testpmd> bpf-load rx 2 0 JM ./dpdk.org/test/bpf/t3.o > > 4) observe changed traffic behavior > Let say with the examples above: > - dummy.o does literally nothing, so no changes should be here, > except some possible slowdown. > - t1.o - should force to drop all packets that doesn't match: > 'dst 1.2.3.4 && udp && dst port 5000' filter. > - t3.o - should dump to stdout ARP packets. > > 5) unload some or all bpf programs: > testpmd> bpf-unload tx 0 0 > > 6) continue with step 3) or exit > > Not currently supported features: > ================================= > - cBPF > - tail-pointer call > - eBPF MAP > - JIT for non X86_64 targets May be for next release, we are planning to add arm64 JIT support. Just wondering, How do you test all EBPF opcodes in JIT/Interpreter mode? Are you planning to add any UT like linux kernel in dpdk ? or it was similar to https://github.com/iovisor/ubpf/tree/master/tests ? Just asking because, when we introduce arm64 JIT support similar test cases should be required to verify the implementation.