From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v9 1/1] net/af_xdp: introduce AF XDP PMD driver Date: Wed, 3 Apr 2019 14:34:40 +0100 Message-ID: References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190402154653.711-1-xiaolong.ye@intel.com> <20190402154653.711-2-xiaolong.ye@intel.com> <3b489dd8-c70f-94d1-163f-1cf3199f1cf5@intel.com> <20190403132214.GA1309@bricha3-MOBL.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Xiaolong Ye , dev@dpdk.org, Stephen Hemminger , Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Luca Boccassi , Ananyev Konstantin , David Marchand , Andrew Rybchenko , Olivier Matz To: Bruce Richardson Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 99AC91B43D for ; Wed, 3 Apr 2019 15:34:44 +0200 (CEST) In-Reply-To: <20190403132214.GA1309@bricha3-MOBL.ger.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 4/3/2019 2:22 PM, Bruce Richardson wrote: > On Tue, Apr 02, 2019 at 08:43:48PM +0100, Ferruh Yigit wrote: >> On 4/2/2019 4:46 PM, Xiaolong Ye wrote: >>> Add a new PMD driver for AF_XDP which is a proposed faster version of >>> AF_PACKET interface in Linux. More info about AF_XDP, please refer to [1] >>> [2]. >>> >>> This is the vanilla version PMD which just uses a raw buffer registered as >>> the umem. >>> >>> [1] https://fosdem.org/2018/schedule/event/af_xdp/ >>> [2] https://lwn.net/Articles/745934/ >>> >>> Signed-off-by: Xiaolong Ye >> >> <...> >> >>> @@ -0,0 +1,956 @@ >>> +/* SPDX-License-Identifier: BSD-3-Clause >>> + * Copyright(c) 2019 Intel Corporation. >>> + */ >> >>> +#include >>> +#include >> >> Under linux, both headers are in same 'bpf' folder, why one included as >> 'bpf/bpf.h' but other 'xsk.h'? >> >> Perhaps this is not problem when headers are installed into system folders, but >> I am compiling using RTE_KERNELDIR, which used in Makefile as: >> -I$(RTE_KERNELDIR)/tools/lib/bpf > > When installed in system folders they will still need the "bpf" prefix. On > my system after running "make headers_install" in libbpf folder, the > headers are placed in "/usr/local/include/bpf/" This is for 'xsk.h' which was not installed via "make headers_install", but as Luca pointed out there is a patch to install 'xsk.h' too, so it should be OK to remove that line. > >> >> This fails to find 'bpf/bpf.h' >> >> Also for '-lbpf', shouldn't need to add '-L$(RTE_KERNELDIR)/tools/lib/bpf', to >> new added line in 'rte.app.mk', so that it can find the library? >> >> I assume you are building in a system with new kernel, I think you need this for >> functionality, where 'xsk.h' is located in that case? Because I was thinking >> building and installing libbpf can solve the issue but it is not installing >> 'xsk.h', not sure why, so not exactly solving. >> >> if you still need "CFLAGS += -I$(RTE_KERNELDIR)/tools/lib/bpf" for your case, >> does it make sense update as following: >> CFLAGS += -I$(RTE_KERNELDIR)/tools/lib >> #include > > We should not include in any driver a cflag or ldflag that points to the > kernel dir. We should expect the headers for libbpf in a regular include > folder and the library itself in /usr/lib or /usr/local/lib. Overall agree, but there is a dependency from 'xsk.h' to 'tools/include/asm/barrier.h', and this header file is not installed into system folders, it can be found only in kernel source code. Hopefully it looks like there is a way to get rid of 'tools/include/asm/barrier.h' dependency for DPDK, so we can remove that cflags too.