From patchwork Tue May 29 15:48:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ophir Munk X-Patchwork-Id: 40507 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 057A4B62; Tue, 29 May 2018 17:48:15 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0040.outbound.protection.outlook.com [104.47.0.40]) by dpdk.org (Postfix) with ESMTP id 8868E160 for ; Tue, 29 May 2018 17:48:13 +0200 (CEST) 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:X-MS-Exchange-SenderADCheck; bh=8B8O8YkmRIeBXiK0kt5PnarixjFdh7B9Llrp9QDCBUQ=; b=YyuipSczPobA0VRl4paxJZA32DpRRcD08UeY45DLSrlkekFsDwoGk+ihYDigR7GkV19q8iy+sal2ZiSxjgWy1daycuKTeptoPoAMVgh/T6Hrf5DfH67raIwh2hxE8EBzb+oWXKHbvralebsztehI6H1UvN5Rh+WTiqivki/LZPY= Received: from HE1PR0501MB2314.eurprd05.prod.outlook.com (10.168.34.19) by HE1PR0501MB2827.eurprd05.prod.outlook.com (10.172.125.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.820.11; Tue, 29 May 2018 15:48:11 +0000 Received: from HE1PR0501MB2314.eurprd05.prod.outlook.com ([fe80::1071:70d0:eac1:5d97]) by HE1PR0501MB2314.eurprd05.prod.outlook.com ([fe80::1071:70d0:eac1:5d97%18]) with mapi id 15.20.0797.017; Tue, 29 May 2018 15:48:10 +0000 From: Ophir Munk To: Sameeh Jubran , "dev@dpdk.org" CC: Yan Vugenfirer , Thomas Monjalon Thread-Topic: Compiling RSS ebpf Thread-Index: AQHT6qKfuRGUloy0MU+7pNUNkkKtzqQtcbqAgBLEugCABrpgAA== Date: Tue, 29 May 2018 15:48:10 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0501MB2827; 7:j22G5Yxe+lYtA4cSfgJRS2L8tHFxRpLN0CQL5jGWhxrnj+vZ1D1611n9Ew5g0+MlS3t30+/lZihEPWEdLXkPWDSl1Wx7Ansv9XQ2E9cHTcdkuOu6FguFxD97HHE71w4p+EDP4xro/tWT3pi4r7LzJHoulQVlz3oyTDV8mXN18t5lmKBcXknmgWcMaeLfhEKbgqCEE5dtUNsYfe8i9FbhLj2sb7NB+1FO9XWSgpkXmqmMPJgUk5czSMDC8xWxdxyq x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0501MB2827; x-ms-traffictypediagnostic: HE1PR0501MB2827: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(189930954265078)(116415991822766)(84791874153150)(45079756050767)(21748063052155)(81160342030619); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:HE1PR0501MB2827; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2827; x-forefront-prvs: 0687389FB0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(376002)(39380400002)(366004)(346002)(53754006)(199004)(189003)(149574003)(174874002)(81156014)(81166006)(8676002)(186003)(19609705001)(66066001)(54906003)(7116003)(5660300001)(53546011)(6506007)(102836004)(59450400001)(3480700004)(76176011)(9326002)(316002)(2900100001)(486006)(3280700002)(74316002)(97736004)(2906002)(6246003)(53936002)(4326008)(110136005)(11346002)(446003)(476003)(86362001)(106356001)(2501003)(45080400002)(5250100002)(7736002)(6306002)(54896002)(55016002)(478600001)(9686003)(236005)(25786009)(3660700001)(6116002)(3846002)(105586002)(790700001)(606006)(8936002)(7696005)(33656002)(26005)(99286004)(68736007)(229853002)(6436002)(14454004)(966005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2827; H:HE1PR0501MB2314.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:3; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: /EDUlt1WVGdMmr8sT9gCdUzQuQOQfC5NLB/WOgNtFo5oiLllVQ3VbHhqJTC9GF459Gyi0hS/K3D+FrRaWsLbQqZe/3heT3IfaLIbbf7ThVfSbUhDpotTbS++j9vhNtHpJRFGEYsIQlpLvvU5fuo+Zbmm76HUDFqZ38t0veseLvMf+DQNfFV7SmJabCzd3ZYt spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: d5d6844a-c9a6-45fd-4939-08d5c57b94b8 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5d6844a-c9a6-45fd-4939-08d5c57b94b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2018 15:48:10.9079 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2827 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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=bpf -filetype=obj -o tap_bpf_program.o That’s all is needed. [1] ------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------- 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=bpf -filetype=obj -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 = data + off + offsetof(struct iphdr, saddr); ^ tap_bpf_program.c:157:46: error: expected expression __u8 *src_dst_addr = data + off + offsetof(struct iphdr, saddr); ^ tap_bpf_program.c:157:60: error: use of undeclared identifier 'saddr' __u8 *src_dst_addr = 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_PIPE' 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=] 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. 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) | \