From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 291981CE53 for ; Wed, 6 Jun 2018 14:06:32 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id z6-v6so21681798wma.0 for ; Wed, 06 Jun 2018 05:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BX8VhKqfQShT6iurGx4bW2A0bFFJTCFzzJOF6ZqbazA=; b=hAX1Tas2mHKgn3ChS8oU7gYHPuiSE9iR+H/5PDVDxvYlzf+NlJQfJfTm4SH5EXJmok WsoohCYvW9HO840bsHDDLsFqp0yKEX2/kNXujgw3AAC0l9riO9oMMhtbylUvHmf9eJEP nx9tGzBmF39bgVzE62yhO/tr4pKjeiUZOwhq9Xn+D7lBcaHNE5jf/1VxeRobnBdg0Lkb M1XmlQUI/rSCJ01gozSDrxCtAa7v2R3/8y7N347FJCG6EpVF+BOT6BT2HUyR+5lp/QgA qk1NAfe5JxMETXrbuHmTg0/f0tz6zZyHioJVP3tZNlgFnrjUd+cwiv+k9wEZjJjJV4OB qE1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BX8VhKqfQShT6iurGx4bW2A0bFFJTCFzzJOF6ZqbazA=; b=Ebs437j3az1GIFTlAadj3Kih/rJZ2h6d1s0FU4ZSXMGP4xzD7nXjbgUYCPimMhdsz5 5LDWeZ1oV84xJ3KMFr6GcA5E3HhJx4T43qQEMlnQslbxUfyxCN+BILxBu3lFjX/EwCea RWFF43IX4O1krqtkK6kb1xfsgr9ZZuL5Xng65aOt7GCAqoEfTCZdx8a1DvHsMp5ZNfiQ 1SYulxvJ3NtRqw2DxKA4Bp/bmENrPQ2TeLOdl0eQMzvmiZdsvIJ8N6tuuvIDGmZz+lZn FA5oedFy2plNKJpSmfD1IsW6k1x37DAv9JqEnWJkFJT4hxkWuBo92FEzvIGinBHXwI5h O8iw== X-Gm-Message-State: APt69E1AACtrAo8P5gpJiQPNBQYLdV22HsnfBhSQZl6bzOcfWn7HuMvI 8ztquj955uOycm5C7vw7KsTVRpYN+JeLCMtxDJdCNg== X-Google-Smtp-Source: ADUXVKJXThbQ4UHW0kGZ+u/SSuLPmaMJfmaRa956tgzynv7imv9O7LAdOFO5XkB3loS+t7cKNfDnnH4JanWyHqI5DC0= X-Received: by 2002:a50:f043:: with SMTP id u3-v6mr3433893edl.91.1528286791824; Wed, 06 Jun 2018 05:06:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:f4a5:0:0:0:0:0 with HTTP; Wed, 6 Jun 2018 05:06:31 -0700 (PDT) X-Originating-IP: [195.110.41.42] In-Reply-To: References: From: Sameeh Jubran Date: Wed, 6 Jun 2018 15:06:31 +0300 Message-ID: To: Ophir Munk Cc: "dev@dpdk.org" , Yan Vugenfirer , Thomas Monjalon Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] Compiling RSS ebpf 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, 06 Jun 2018 12:06:32 -0000 On Tue, May 29, 2018 at 6:48 PM, Ophir Munk wrote: > Hi Sameeh, > > RSS ebpf source code compilation is planned for dpdk next releases. > > > > In order to compile the current tap_bpf_program.c code you will need > definitions found in iproute2: > > > > https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/ > > > > 1. Please clone iproute2 tree and make it accessible to your build > environment, say under directory . > > > > 2. Please add "bpf_api.h" file inclusion in tap_bpf_program.c > (following tap_rss.h inclusion, see [1]) > > > > 3. When running the clang command please include the iproute2 > include directory, for example, > > clang -I /iproute2/include -O2 -emit-llvm -c > tap_bpf_program.c -o - | llc -march=3Dbpf -filetype=3Dobj -o tap_bpf_prog= ram.o > > > > That=E2=80=99s all is needed. > I have just tested this and this indeed solved the compilation errors! It'll be great if you'll add them to the documentation as it is misleading and not up-to-date :) Thanks > > > [1] > > ------------------------------------------------------------ > ------------------------------------------- > > diff --git a/drivers/net/tap/tap_bpf_program.c b/drivers/net/tap/tap_bpf_ > program.c > > index 1cb7382..d65f9b8 100644 > > --- a/drivers/net/tap/tap_bpf_program.c > > +++ b/drivers/net/tap/tap_bpf_program.c > > @@ -17,6 +17,7 @@ > > #include > > > > #include "tap_rss.h" > > +#include "bpf_api.h" > > > > /** Create IPv4 address */ > > #define IPv4(a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \ > > ------------------------------------------------------------ > ------------------------------------------- > > > > Regards, > > Ophir > > > > *From:* Sameeh Jubran [mailto:sameeh@daynix.com] > *Sent:* Friday, May 25, 2018 11:54 AM > *To:* dev@dpdk.org; Ophir Munk > *Cc:* Yan Vugenfirer > *Subject:* Re: Compiling RSS ebpf > > > > Ping. > > > > On Sun, May 13, 2018 at 1:16 PM, Sameeh Jubran wrote: > > Sorry I have accidentally sent my last email without finishing it. > > > > I believe it is due misconfiguration of the linux headers and their > inclusion. Anyone else faced these errors? > > > > > > On Sun, May 13, 2018 at 1:10 PM, Sameeh Jubran wrote: > > Hi All, > > > > I am attempting to compile the rss epbf program dpdk and I am getting too > much compilation errors, is there anything specific that I need to > configure when compiling? > > > > I am running the following line: > > > > clang -O2 -emit-llvm -c tap_bpf_program.c -o - | llc -march=3Dbpf > -filetype=3Dobj -o tap_bpf_program.o > > > > I think it is due to some misconfiguration of > > The errors I am getting: > > > > tap_bpf_program.c:157:37: warning: implicit declaration of function > 'offsetof' is invalid in C99 [-Wimplicit-function-declaration] > > __u8 *src_dst_addr =3D data + off + offsetof(struct iphdr= , > saddr); > > ^ > > tap_bpf_program.c:157:46: error: expected expression > > __u8 *src_dst_addr =3D data + off + offsetof(struct iphdr= , > saddr); > > ^ > > tap_bpf_program.c:157:60: error: use of undeclared identifier 'saddr' > > __u8 *src_dst_addr =3D data + off + offsetof(struct iphdr= , > saddr); > > = ^ > > tap_bpf_program.c:180:11: error: use of undeclared identifier 'TC_ACT_OK' > > return TC_ACT_OK; > > ^ > > tap_bpf_program.c:182:15: error: expected expression > > offsetof(struct ipv6hdr, saddr); > > ^ > > tap_bpf_program.c:182:31: error: use of undeclared identifier 'saddr' > > offsetof(struct ipv6hdr, saddr); > > ^ > > tap_bpf_program.c:204:10: error: use of undeclared identifier 'TC_ACT_PIP= E' > > return TC_ACT_PIPE; > > ^ > > tap_bpf_program.c:212:9: error: use of undeclared identifier > 'TC_ACT_RECLASSIFY' > > return TC_ACT_RECLASSIFY; > > ^ > > tap_bpf_program.c:222:1: error: expected parameter declarator > > RSS(l3_l4) > > ^ > > tap_bpf_program.c:216:12: note: expanded from macro 'RSS' > > __section(#L) int \ > > ^ > > :76:1: note: expanded from here > > "l3_l4" > > ^ > > tap_bpf_program.c:222:1: error: expected ')' > > tap_bpf_program.c:216:12: note: expanded from macro 'RSS' > > __section(#L) int \ > > ^ > > :76:1: note: expanded from here > > "l3_l4" > > ^ > > tap_bpf_program.c:222:1: note: to match this '(' > > tap_bpf_program.c:216:11: note: expanded from macro 'RSS' > > __section(#L) int \ > > ^ > > tap_bpf_program.c:222:1: warning: type specifier missing, defaults to > 'int' [-Wimplicit-int] > > RSS(l3_l4) > > ^ > > tap_bpf_program.c:216:2: note: expanded from macro 'RSS' > > __section(#L) int \ > > ^ > > tap_bpf_program.c:222:1: error: expected ';' after top level declarator > > tap_bpf_program.c:216:16: note: expanded from macro 'RSS' > > __section(#L) int \ > > ^ > > fatal error: too many errors emitted, stopping now [-ferror-limit=3D] > > 6 warnings and 20 errors generated. > > sameeh@bark:~/Builds/bpf_rss/dpdk/drivers/net/tap$ clear > > > > -- > > Respectfully, > > *Sameeh Jubran* > > *Linkedin* > > > *Software Engineer @ Daynix > .* > > > > > > -- > > Respectfully, > > *Sameeh Jubran* > > *Linkedin* > > > *Software Engineer @ Daynix > .* > > > > > > -- > > Respectfully, > > *Sameeh Jubran* > > *Linkedin* > > > *Software Engineer @ Daynix > .* > --=20 Respectfully, *Sameeh Jubran* *Linkedin * *Software Engineer @ Daynix .*