From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 4E9721B1E0 for ; Wed, 10 Jan 2018 11:11:05 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8706C44BF2; Wed, 10 Jan 2018 10:11:04 +0000 (UTC) Received: from [10.72.12.115] (ovpn-12-115.pek2.redhat.com [10.72.12.115]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81BC680E0B; Wed, 10 Jan 2018 10:11:01 +0000 (UTC) To: Ophir Munk , dev@dpdk.org, Pascal Mazon Cc: Thomas Monjalon , Olga Shern References: <1514455745-17349-1-git-send-email-ophirmu@mellanox.com> <1515567969-27946-1-git-send-email-ophirmu@mellanox.com> From: Jason Wang Message-ID: Date: Wed, 10 Jan 2018 18:10:57 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1515567969-27946-1-git-send-email-ophirmu@mellanox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 10 Jan 2018 10:11:04 +0000 (UTC) Subject: Re: [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 10:11:05 -0000 On 2018年01月10日 15:06, Ophir Munk wrote: > 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 > TAP will support eBPF classification directly [1] through eBPF socket filter. Compare to tc-bpf, it was more portable for other backends (e.g macvtap). [1] https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/drivers/net/tun.c?id=96f84061620c6325a2ca9a9a05b410e6461d03c3 Thanks