From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60068.outbound.protection.outlook.com [40.107.6.68]) by dpdk.org (Postfix) with ESMTP id 281CE1B01D for ; Wed, 10 Jan 2018 08:06:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nDOXbcwAyY798sSeSe8iUvg/tCJBlQe03qsmSSSycdQ=; b=xYJ4IQy9HbYJZhK2drakAQ7KvFPCt+BH7Jc0y5cqomBtEgWzjzbl0dlmGQYR3mRm0JF3ttDvixxtgprydRtqISIEhTbbPHus9kKg/qY6JhXUi+8CFcpi3wH1ezF1dS7NGI3ECWbE1tBBORK0Kds8hfqERHai3J07KWyn+3hT82s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM0PR0502MB3875.eurprd05.prod.outlook.com (2603:10a6:208:20::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 07:06:24 +0000 From: Ophir Munk To: dev@dpdk.org, Pascal Mazon Cc: Thomas Monjalon , Olga Shern , Ophir Munk Date: Wed, 10 Jan 2018 07:06:07 +0000 Message-Id: <1515567969-27946-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1514455745-17349-1-git-send-email-ophirmu@mellanox.com> References: <1514455745-17349-1-git-send-email-ophirmu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: AM0PR0102CA0054.eurprd01.prod.exchangelabs.com (2603:10a6:208::31) To AM0PR0502MB3875.eurprd05.prod.outlook.com (2603:10a6:208:20::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 11f5c2e3-3f33-4d54-0290-08d557f8a950 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM0PR0502MB3875; X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3875; 3:0UKgE88MYUu1jwcYJCVs66fJejV10lAQo8h04pnAqSiCWS2sd8ItrTsI9mw6IeOkKVukVNR2NTv2/zo5G2eTor+iJop8YG+Zeh4805bWTuFIEWYvuAsu+ZPo9LC4fHz66coSGkZZtX9OoSaN52uxhyITBh02S+OBBnMyA4TZLiYuBMIV+CTnNDZEtphscNJtQRUOt/2gB28GBzSf2bMA95u6Zz3fixC4DypwYdmKY6KG5jCP/5tbWqpRRw6f5CdH; 25:yVqmLeLzjycM8Ul0+phT8ooXL5gOQ9Kf9A8OumJpKYfpoplRBs01NU7wRn9evnDvOgGtM/yXDqCMtVM5/F2d3r+yNCk0iF7hfmsylTkXnAly0Hj9ztIl4o+QM0mn4rooJpkgEA9QCztMjkAtzq89Bg5kjatiuc5DL4TEs5IrrTVplEXYkZz2QDQdvJk1/B9Ex1sury32mO+H/9gmU2zGOQQ+nl6Vjlr1VKMd2ZOOwlFsvyLUN+BE4iSBPm/t+ujylEAAc4ZFQ02zqks0ATsfzfz7xGmPmHCB5u4gUM23IwS8DtOeGS+Cfi/8n9tCMpV3ptrYKrSg9t23245UQRDMPw==; 31:kyaE4cMGNWPEWXp5wXfVKFJE1NQ6fwisr+4ENomqEQMseIPUAs+k6xKrmYN9aibMVxpzU74fxtv3jyvCwv5l92AJN7EdsiXajKWa3le/1Buo3OfxZg0h8BVjARrLTPeKtqHiCm8jKGlcgPQt7isd0i8W77aohkPKdQcgXGAjBWc3mYnLFAQs70fcXYqdKXlSJ+fOOgo7uQQ3Fl6ZpKUTdBJ8/4fWxL4H9mzL/w7XDZ4= X-MS-TrafficTypeDiagnostic: AM0PR0502MB3875: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3875; 20:yUkMwPx5WC338/DBI6D9sfYXXCa4XuEpVDiQx0fsM76Ae2jVKSrjiOb0896rvHc+V71On8UHfqi2xTWEgsCBNq5a+O3/CVdZOw98v4CQDK2PFk6o4X5A3qB3EGXjjNrbA154nf3HBJN2OkCMaT+/rNtWDmOMBdm4YRHyvKio3hnWNFlyQ1h1TnKEbPSFNg8rDMA4dQ5VePxJWA2PMc3jmHanJZJEuSzGCDn/Izy93DR+GyOS7h6vRFKSMdpq9JsOclPoErnT+J9rXkBhilQdYsQVXGVZ0IDndN6M8K7Uq7x7sl654dcxt+7C5d9b+QVAd3hHcuznb3pavgczbI8b6tYUs6ij5OdD1/bMWG9893P9VVTlIBR2MnlaO1RZ0p++N32Gx4+Rd/fHVkQ1MsJ9EbhgblfoQ8YeWV2q0RiJatdyH4ZAUH8DZvQiLQ8c21pX6yXa5WfzL8OJzp0+mnzOCNUSSgHbfII41dMGQf9s4/TgVl1OhiyfMEmPjQl59RSr; 4:eYcaJ5i0vsggxse0IpGvhNN9ChZwDiOdWP35D+cthpFoeujNz1KIftZfu6BfBMbLD1/OHUYpUxNRDZV+ngvX6tfH97MjlZ3Xif/WrPOLdaSer2+J7oMpyD0yAmzhGxUWSt+GllEcpEKoY/OMszZegNz2+SjuLsNuP0YjoMbxoy7YV29TQKwTv1HOh0s8C+NQ2MNhFWMq19dilJ2XYPKbupNtSzxfcRo9CF96tl4eAC1yzbY202F8O1e7V1f86+2bTHSXTxZnvun+P/8YBb6Ozw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231023)(944501119)(6055026)(6041268)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:AM0PR0502MB3875; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM0PR0502MB3875; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(396003)(376002)(346002)(39860400002)(199004)(189003)(86362001)(106356001)(7736002)(105586002)(5660300001)(4720700003)(16526018)(2950100002)(6666003)(25786009)(6916009)(50466002)(54906003)(48376002)(305945005)(69596002)(33026002)(16586007)(66066001)(4326008)(47776003)(316002)(478600001)(21086003)(3846002)(6116002)(107886003)(966005)(68736007)(2906002)(8936002)(53936002)(6306002)(55016002)(50226002)(36756003)(97736004)(59450400001)(386003)(8676002)(81156014)(81166006)(7696005)(52116002)(51416003)(76176011)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3875; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR0502MB3875; 23:/CKwdU/23+C/tv6jQRItU8P8wl5XzHsUkXh3Scd?= =?us-ascii?Q?dcZOrNxJJWw7DlGzeSh5x1+Nz8+4pncGyttTZMiQmAZWh5FbjbpHthBNLdAZ?= =?us-ascii?Q?Nq6wXr9IZGjdm81O4hXA2N8/CZOrhPrS7kYRiuRjc1LGUDRvQyUvS4kjjuF5?= =?us-ascii?Q?isiX1ZHBItVmAbSf3h0MotvohrUC/5MSglBX9DZIyq4MVvfQ6xQ356vhvUvK?= =?us-ascii?Q?7hVfoEKaevbGOyVEGVJx1VkC5SDqmalRAGbD1yXr7mhcgwvjVDw/DsGfeVK0?= =?us-ascii?Q?dBaCTEcgB1mePelY+aCiE0/V1x1R8s96cuIELfn2s0gliqXa9/gVHcLtOnjd?= =?us-ascii?Q?EbZZUrnnJSEc20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wtyH0tmuqap?= =?us-ascii?Q?sb4BaDHqdNNMJu4ttvoRy4NtE/FGsNFgFGoP44Vl7?= X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3875; 6:7P9jjlsyA7luvf4jJBMOzb/XVJoznl7YPTFxAzN4t+/PJdT0iocZL2yF9ZeQFx9vJzg8V2uXO/6gjA4IGnKib2XjxJH/V8InF+volcJpRtBH0qWOcgCiSrrvfu+aBV0fAutuEccDAziwbiVavd9Hk7/0ZQk0vZM8Xs06+OvTlKcVX7RedyxiAL5xo8Cg+blnRzA54RyJANoSQd0VCFXlCwCAgOmDV4X+CDyJK+aXsB5LzTMGQBCQAjMOKhAwnrVGg/86I538TDLIfKnlrlGttuGTB9VRnO2GbALRPtH/9lW+sJivJRovvbNjnbz7WCr/zj6jlXOCcM/JEROrJanv8R/LaMoEE4FSSDSR8lgHgoM=; 5:jC9N7pcAIiC2CQ8vW486Fhr9I0EpvhLC0If3q49E2LJ8hScQR2z1Bn83LFuS0+GLh2qAH97/YdCeubYCqeYcS2B2WNy2b/iU/e9wpgZAUZhLQlX8A22LTpM88LbE7h1sAvBuPPgL6ugIdJ88qJ/S+lLtQI1Lk39lwyVP+53LT4U=; 24:ypik82G+zPu17b7q59JrQnbYuL6tVrjzlvhpq8hcUOslAAXwFVMDIy9uQbpbq0/ENH2HJBvUIm0P1NgPeDfUcBzhHl75SpdBgg9CwUzciZw=; 7:ktpDyu7MZDENdu++69+E0rYpyOSgQrxs+wl4WMbIhJoZa1AXT5QXfBwkOhWFRBBkIhm8uEVVzWPoCvvxyr29yd2ScJ/raw160s4jfPx7q/r4RsEtgGuoP24vNWXflAs5Ja25t0qEd9T2yK8fl7/GAY+If1y7KkrF/7fcA1b25Kqgs2cgkwxOSIpSIhgBttLeFdgQTPHDmLhVH3psysRwhhDsEdccd2YUnTRtwqedBFpiBYMdUQl+FX30OvK5tXiU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 07:06:24.0485 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11f5c2e3-3f33-4d54-0290-08d557f8a950 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3875 Subject: [dpdk-dev] [PATCH v3 0/2] TAP RSS eBPF cover letter 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: Wed, 10 Jan 2018 07:06:26 -0000 The patches of TAP RSS eBPF follow the RFC on this issue https://dpdk.org/dev/patchwork/patch/31781/ v3 changes with respect to v2 ============================= * Add support for IPv6 RSS in BPF program * Bug fixes * Updated compatibility to kernel versions: eBPF requires Linux version 4.9 configured with BPF * New license header (SPDX) for newly added files v2 changes with respect to v1 ============================= * v2 has new commits organization (3 --> 2) * BPF program was revised. It is successfully tested on IPv4 L3 L4 layers (compatible to mlx4 device) * Licensing: no comments received for using "Dual BSD/GPL" string during BPF program loading to the kernel. (v1 and v2 are using the same license strings) Any comments are welcome. * Compatibility to kernel versions: eBPF requires Linux version 4.2 configured with BPF. TAP PMD will successfully compile on systems with old or non-BPF configured kernels. During compilation time the required Linux headers are searched for. If they are not present missing definitions are locally added (tap_autoconf.h). If the kernel cannot support a BPF operation - at runtime it will gracefully reject the netlink message (with BPF) sent to it. Commit #1: net/tap: add eBPF instructions to TAP device =========================================== This commit introduces BPF program (tap_bpf_program.c) with a classifier and an action sections. The current implementation calculates RSS hash over L3 addresses and L4 ports. BPF program compilation is not part of dpdk compilation. This commit includes the eBPF machine instructions in the format of C arrays (tap_bpf_insns.c). The option to update the BPF program and download new machine instructions will be described in another commit. Commit #2: net/tap: implement RSS with eBPF classifier and action ====================================================== This commit builds and sends netlink messages to the kernel that include BPF programs. There is a single BPF classifier for each TAP queue. Packets marked with an RSS queue will be directed to this queue using a traffic control with "skbedit" action otherwise they will be pipelined to the following rules. There is a single BPF action for each RSS rule (may add more to support IPv6). The action is to calculate Toeplitz hash based on L3 addresses and L4 ports, mark the packet with the RSS queue according the resulting hash, then reclassify the packet. Ophir Munk (2): net/tap: add eBPF instructions to TAP device net/tap: implement RSS with eBPF classifier and action drivers/net/tap/Makefile | 31 + drivers/net/tap/rte_eth_tap.h | 9 +- drivers/net/tap/tap_bpf.h | 92 ++ drivers/net/tap/tap_bpf_insns.c | 1905 +++++++++++++++++++++++++++++++++++++ drivers/net/tap/tap_bpf_program.c | 221 +++++ drivers/net/tap/tap_flow.c | 635 +++++++++++-- drivers/net/tap/tap_flow.h | 15 + drivers/net/tap/tap_rss.h | 32 + drivers/net/tap/tap_tcmsgs.h | 4 + 9 files changed, 2848 insertions(+), 96 deletions(-) create mode 100644 drivers/net/tap/tap_bpf.h create mode 100644 drivers/net/tap/tap_bpf_insns.c create mode 100644 drivers/net/tap/tap_bpf_program.c create mode 100644 drivers/net/tap/tap_rss.h -- 2.7.4