Received: by 10.223.176.5 with SMTP id f5csp414063wra; Sat, 27 Jan 2018 02:32:50 -0800 (PST) X-Google-Smtp-Source: AH8x225Wv6iKRkg1ZaaNMPE/eepwMDiC3XZ1vp3sEvTlgh0oO6ntr5Quyynx/LS3Hc4KNjJwbC3f X-Received: by 10.98.135.76 with SMTP id i73mr21288439pfe.183.1517049170341; Sat, 27 Jan 2018 02:32:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517049170; cv=none; d=google.com; s=arc-20160816; b=HPEsiJPxS0Qkb2nAYWzU9WMiV2mV3gIf3YXPQ9uGBG8QUUgfSgvtK5iUB3Pw5YCC2h bYlRwwHMvoVIMxB/9/cr2PAowdIpELp9tFEakbUYv8I/K3XeU0juAcFu6+I2PAOSNQqf RNL4sdumRtOXUrbe16NzNsJeVvr+Nx5QMg3wyiQe3dAAROqMFcG2BZJCJyJxm6lf/N1u 2Ds+9jgefSLCseQ5PuK0eUQNmwjgxzWItLsBM172rPrPo6AnyORN+nq3DTVPrdtwsWZL Z8yzAU7B9fOQl+tId5EjE6lKwRGVv3hGfktDvvfJ9BN7f3IK8EnBUgFGxDMXHnJescJO cnFA== 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=qiazlm6wzP5v7Lp7Bku/89tDoXWciMxRO6T5W7PWOJQ=; b=YtLyg8FL7/gCNgyvaegQYHKN39mNjDekWmX+wISaKqDJumT1BsphrBCjUz/Fjb/Wq0 bTnLMeLFhcyFsLak7i/x8U/51+Dj2z8EnWSi+a7p166elvxxZkj8B6PfMZx6DvSZg6wE f/52CRvBN6xib0ExN54K7b+kcYfr1JidAdMibXswEAwQwM/Aws93XfxrkG/6IqmadqmC D0lxpTdpUR/1XorxZouLB6QpQ7b5xZoswwxGV3yrjcTnxGDz8cw3YSEde3D3iCMCTJ8x VK8zWnhEit1pjdzs1FEKeaf+O9FfvPYL0t69bI7hZY/CaikaIausEOcH5CR7JsNJSWHX aUdA== 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 bh1-v6si753663plb.497.2018.01.27.02.32.35; Sat, 27 Jan 2018 02:32:50 -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 S1752565AbeA0KcL (ORCPT + 99 others); Sat, 27 Jan 2018 05:32:11 -0500 Received: from home.regit.org ([37.187.126.138]:40196 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751957AbeA0KcJ (ORCPT ); Sat, 27 Jan 2018 05:32:09 -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 1efNmJ-0004ww-3c; Sat, 27 Jan 2018 11:32:07 +0100 Message-ID: <1517049126.24241.19.camel@regit.org> Subject: Re: [PATCH bpf-next v7 3/5] libbpf: add error reporting in 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:32:06 +0100 In-Reply-To: <0291c0fe-d8c6-1072-3069-4b3000d290fe@iogearbox.net> References: <4dc597a1-5046-3805-eb81-03a23bf0acbb@iogearbox.net> <20180125000548.12320-1-eric@regit.org> <20180125000548.12320-4-eric@regit.org> <0291c0fe-d8c6-1072-3069-4b3000d290fe@iogearbox.net> 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:28 +0100, Daniel Borkmann wrote: > On 01/25/2018 01:05 AM, Eric Leblond wrote: > > Parse netlink ext attribute to get the error message returned by > > the card. Code is partially take from libnl. > > > > We add netlink.h to the uapi include of tools. And we need to > > avoid include of userspace netlink header to have a successful > > build of sample so nlattr.h has a define to avoid > > the inclusion. Using a direct define could have been an issue > > as NLMSGERR_ATTR_MAX can change in the future. > > > > We also define SOL_NETLINK if not defined to avoid to have to > > copy socket.h for a fixed value. > > > > Signed-off-by: Eric Leblond > > Acked-by: Alexei Starovoitov > > > > remote rtne > > > > Signed-off-by: Eric Leblond > > Some leftover artifact from squashing commits? Outch > > samples/bpf/Makefile | 2 +- > > tools/lib/bpf/Build | 2 +- > > tools/lib/bpf/bpf.c | 13 +++- > > tools/lib/bpf/nlattr.c | 187 > > +++++++++++++++++++++++++++++++++++++++++++++++++ > > tools/lib/bpf/nlattr.h | 72 +++++++++++++++++++ > > 5 files changed, 273 insertions(+), 3 deletions(-) > > create mode 100644 tools/lib/bpf/nlattr.c > > create mode 100644 tools/lib/bpf/nlattr.h > > > > diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile > > index 7f61a3d57fa7..5c4cd3745282 100644 > > --- a/samples/bpf/Makefile > > +++ b/samples/bpf/Makefile > > @@ -45,7 +45,7 @@ hostprogs-y += xdp_rxq_info > > hostprogs-y += syscall_tp > > > > # Libbpf dependencies > > -LIBBPF := ../../tools/lib/bpf/bpf.o > > +LIBBPF := ../../tools/lib/bpf/bpf.o ../../tools/lib/bpf/nlattr.o > > CGROUP_HELPERS := > > ../../tools/testing/selftests/bpf/cgroup_helpers.o > > > > test_lru_dist-objs := test_lru_dist.o $(LIBBPF) > > diff --git a/tools/lib/bpf/Build b/tools/lib/bpf/Build > > index d8749756352d..64c679d67109 100644 > > --- a/tools/lib/bpf/Build > > +++ b/tools/lib/bpf/Build > > @@ -1 +1 @@ > > -libbpf-y := libbpf.o bpf.o > > +libbpf-y := libbpf.o bpf.o nlattr.o > > diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c > > index 749a447ec9ed..765fd95b0657 100644 > > --- a/tools/lib/bpf/bpf.c > > +++ b/tools/lib/bpf/bpf.c > > @@ -27,7 +27,7 @@ > > #include "bpf.h" > > #include "libbpf.h" > > #include "nlattr.h" > > -#include > > +#include > > Okay, so here it's put back from prior added uapi/linux/rtnetlink.h > into linux/rtnetlink.h. Could you add this properly in the first > commit rather than relative adjustment/fix within the same set? Yes, sure. > > #include > > #include > > > > @@ -37,6 +37,10 @@ > > #define IFLA_XDP_FLAGS 3 > > #endif > > > > +#ifndef SOL_NETLINK > > +#define SOL_NETLINK 270 > > +#endif > > This would need include/linux/socket.h into tools/ include infra > as well, no? Yes, and I fear a lot of dependencies. ++ -- Eric Leblond Blog: https://home.regit.org/