From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id CF8001E955 for ; Tue, 12 Jun 2018 14:58:39 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DBBD620E24; Tue, 12 Jun 2018 08:58:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 12 Jun 2018 08:58:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=Eso8tp5TT5oYiusBktXpIqBAt+ DQxp90+0cxyi5lPIU=; b=itjN5RTV6cU9V3qI3Ji5lQNcYWPStECRD4f5G3xIeb UmpeiQm4b+8NJpsdVmL/uY1VsvO5UzpiHRcl3CuB32feypwCDDjkefSryAEYTvuS Qqh58wrfCQgFCCholXoQqhvkyH3LnKKJq0VIYMvYRfWg+wByiGyFcOo+hffcK/hZ o= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Eso8tp 5TT5oYiusBktXpIqBAt+DQxp90+0cxyi5lPIU=; b=ABgG+7woRYr1Qfbn33e3l7 k6OBiDW7uSZAIcd5qXf6v2kHMJzQYZq34vacOcVJYK8U1eha4nKKsqpI2RtXphC1 Rg7gQNJmPaZ5EUza70q9d+64VRmxTS0ToZ3lbF0mRhOtuzJMvq8SXccn5ah/ooXV 7l+fx9bubs65gOoXL3ThXc+fC4QO7+CciN7y4/XBrmPJfXuwV7OxFhAvo5XeVanF 9B/PBSsjKDUpBIfLGDjSNSfUZvkg2tdF4rJqp/Kur66KTaYpu2NLjLYhrdvtH3gq +2e+tOacwIlEFYi0VQTrOLJbm76X1V/sx6bVGyovuzjxFbbBu8Zrkq8+M7DOCDQQ == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id F23DA10262; Tue, 12 Jun 2018 08:58:37 -0400 (EDT) From: Thomas Monjalon To: "Wiles, Keith" Cc: dev@dpdk.org, Ophir Munk , Pascal Mazon , Olga Shern Date: Tue, 12 Jun 2018 14:58:36 +0200 Message-ID: <3694221.zYt2n70HGy@xps> In-Reply-To: <81903AA5-6353-44CE-A8AB-B4B387BC036B@intel.com> References: <1528733172-24747-1-git-send-email-ophirmu@mellanox.com> <3421596.l5OksTDFGx@xps> <81903AA5-6353-44CE-A8AB-B4B387BC036B@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v1] net/tap: explain how to compile eBPF C file 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, 12 Jun 2018 12:58:40 -0000 12/06/2018 14:36, Wiles, Keith: >=20 > > On Jun 12, 2018, at 7:26 AM, Thomas Monjalon wrot= e: > >=20 > > 11/06/2018 18:35, Wiles, Keith: > >>=20 > >>> On Jun 11, 2018, at 11:06 AM, Ophir Munk wrote: > >>>=20 > >>> This commit explains how to manually compile the C source file > >>> tap_bpf_program.c into an ELF file using the clang compiler. > >>> The code in tap_bpf_program.c requires definitions found in iproute2 > >>> source code. This commit suggests cloning the iproute2 git tree and > >>> include its path in the clang command. It also adds inclusion of file > >>> bpf_api.h (required for eBPF definitions) which is located in iproute2 > >>> source tree. For more details refer to TAP documentation. > >>> This commit is related to commits [1] and [2]. > >>=20 > >> Normally I would have suggested that eBPF be disable in the TAP driver= as it requires external code and programs, but that ship has sailed. > >=20 > > The external programs are required only to generate new instructions, > > changing the behaviour of the BPF program. > > Currently, the instructions for RSS behaviour are provided. > >=20 > >> I would like to see building the tap_bpf_program.o as a target in the = Makefile, this way the developer can just run the =E2=80=98make bpf_program= =E2=80=99 target and it would be simpler and less error prone. As explained in the documentation, for now there is a dependency on iproute2 for the compilation of this BPF program. So we cannot make it as simple as a "make command". Probably that we can rework it to change the dependency. I heard there are some good BPF libraries available now? > > For this to happen, we need to improve the tools. >=20 > In what way do we need to improve the tools and which tools are we talkin= g about. Building the .o file below appears to be a simple set of command l= ines. I have a question in my original email about what tool. The .o file is only the an intermediate file. The next step (numbered as 5 in this patch) is to extract the section of BPF instructions to be uploaded in the kernel. This step must be done by a "tool". Ophir did it by hacking tc, but it is not upstreamed yet. There could be other ways (possibly easier) to achieve the same result. > > It is a work in progress. Contributions are welcome. > > This is a very first step to use Linux BPF with DPDK. > > If there are more interests, we should really streamline its usage > > for all parts of DPDK which runs on top of some kernel code. >=20 > streamlining other parts of DPDK would be nice, but we are now talking ab= out the tap/eBPF patch.