Received: by 10.223.176.5 with SMTP id f5csp407525wra; Sat, 27 Jan 2018 02:23:11 -0800 (PST) X-Google-Smtp-Source: AH8x224f3He4r/EuPJ//WZt5rYoGX0R9c4ms/69sHToQSlBE9Q7V52hbLjlpWrOBQZPZmzjT2/LD X-Received: by 2002:a17:902:424:: with SMTP id 33-v6mr16278151ple.57.1517048590920; Sat, 27 Jan 2018 02:23:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517048590; cv=none; d=google.com; s=arc-20160816; b=KtQlxOI9inR80gWZXRB2iwHNvBzyl1HZ6NJ57+u2Jm7aS2OzLO1zucUzlD5dZEmesM W5Wy5biY2L/GjpZEwlQiSKgnC84MDnmt/m66BD3M40MlwCaSIieRWZZG+OIMVIH92Q2X dwJDUO/nzQV5dCroocQ25hLJulwp5yz9/EN/sJ6P6N3tp1UrZZda/j6n3ZkvXWoFay3q L29Tdz6dIZMmfTc8k3kUev+1iqhHdXVlJCsmG5YcRADSCweY9NSbRTsLhN6ThB2j39cV ZK0LtT/ezFz2njZHLxscdo7GgacPDjInDAVfpPj4mb5vRtEktk0O1aNt0JLOb/nmwE0u t1rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=gxxEL3ZluXjSLpNfRLXyrZ2IXIqUKeLY+WmChDbqOf8=; b=GblK74paPToyVFLBQ1IX3lrubyc+uX37mUm8tuN1Z8UwSgvox2UUi7oDRXltQlEFBW TRDmhmgWXUsHElgyt2pW4d4MdavAziu24Fi9vTEaNA27AjIq0H9hiRntCE14m4h33es/ CS8FDSY5O5kBKuAy7GluS+hDQ+cmo3YPqC2A5Eqbn9QrPnSZoYEvYiHB/Djq7bvP0z/d jSmtvyEu+fUR9GREirLTOUyb1jma4U9MA4ekgpRbUdDlYg4nAVSAh2P0wc68fTslbpM/ CHK3YlKNIUoWBSfwH5AhCvjNXQfnZufoUM9mp9gq62wAdxrCuBbB3zwO/FefZEy1G6oJ nKkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w25si4254991pgc.287.2018.01.27.02.22.55; Sat, 27 Jan 2018 02:23:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577AbeA0KW3 (ORCPT + 99 others); Sat, 27 Jan 2018 05:22:29 -0500 Received: from home.regit.org ([37.187.126.138]:40062 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751957AbeA0KW2 (ORCPT ); Sat, 27 Jan 2018 05:22:28 -0500 Received: from [2a01:e34:ee97:b130:c685:8ff:feb3:c9c8] (helo=tiger2) by home.regit.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1efNcv-0004or-5p; Sat, 27 Jan 2018 11:22:25 +0100 Message-ID: <1517048544.24241.16.camel@regit.org> Subject: Re: [PATCH bpf-next v7 2/5] libbpf: add function to setup XDP From: Eric Leblond To: Daniel Borkmann Cc: alexei.starovoitov@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 27 Jan 2018 11:22:24 +0100 In-Reply-To: References: <4dc597a1-5046-3805-eb81-03a23bf0acbb@iogearbox.net> <20180125000548.12320-1-eric@regit.org> <20180125000548.12320-3-eric@regit.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 (-) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Sat, 2018-01-27 at 02:23 +0100, Daniel Borkmann wrote: > On 01/25/2018 01:05 AM, Eric Leblond wrote: > > Most of the code is taken from set_link_xdp_fd() in bpf_load.c and > > slightly modified to be library compliant. > > > > Signed-off-by: Eric Leblond > > Acked-by: Alexei Starovoitov > > --- > > tools/lib/bpf/bpf.c | 127 > > +++++++++++++++++++++++++++++++++++++++++++++++++ > > tools/lib/bpf/libbpf.c | 2 + > > tools/lib/bpf/libbpf.h | 4 ++ > > 3 files changed, 133 insertions(+) > > > > diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c > > index 5128677e4117..749a447ec9ed 100644 > > --- a/tools/lib/bpf/bpf.c > > +++ b/tools/lib/bpf/bpf.c > > @@ -25,6 +25,17 @@ > > #include > > #include > > #include "bpf.h" > > +#include "libbpf.h" > > +#include "nlattr.h" > > +#include > > Doesn't libbpf pull in already -I$(srctree)/tools/include/uapi? Seems > the > other headers don't need 'uapi/' path prefix. Right, it works without the uapi. > > > +#include > > +#include > > + > > +#ifndef IFLA_XDP_MAX > > +#define IFLA_XDP 43 > > +#define IFLA_XDP_FD 1 > > +#define IFLA_XDP_FLAGS 3 > > +#endif > > Hm, given we pull in tools/include/uapi/linux/netlink.h, shouldn't we > also > get include/uapi/linux/if_link.h dependency in here, so above ifdef > workaround > can be avoided? This values are fixed so we risk nothing by keeping a definition if ever it is not available in system headers. But it is fine with me if you want me to add if_link.h to include/uapi/. BR, -- Eric Leblond Blog: https://home.regit.org/