Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8840845ybl; Fri, 17 Jan 2020 02:00:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxdFuzrGalGJnMCwXvC3nR1ZljAhbBROgHOUEgCHm8H8GdBebwPRg4YpMaApiG67A+BUrs8 X-Received: by 2002:aca:b984:: with SMTP id j126mr2869215oif.174.1579255239341; Fri, 17 Jan 2020 02:00:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579255239; cv=none; d=google.com; s=arc-20160816; b=IZswCVWlleizyiWzKY2u4NMOyeqoj5ZlKVsYcLYnhY210Gj9CqFikOKj7QwzEy1oz2 BCjFqWewomA8SIbXAG8R0xj1QwHBBzEnNAA+v7AE7HUGDlFcp/gCvS/GHUF/0LCQjuWV sSiTnv6SyC8J+ufY2R5maS965g1pDVyd/VbVo73eipbDRnGuGp6ZtEvw9GzpqBakLKCB IHOAVciEyPnGKlhRWtX1aDpTYJkuD8mo1f5CzsgxxRp+Xce1UeH7mFAUAk73Y7tEYvUM sLge9KqzCCkD6HEpxluFpsJ15Nvauv/zOJ37WeyTGK3kN5NZhas59oLbOsp6oUQm1hrB 5s/Q== 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 :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=Uf1keSD3DOZ8jh4mCSz+0fhQb4Z+vPKdygjWjY+hlbM=; b=r3g3XpEM2H6KuW2lJnrmZFRyOinaf3SKusCkqz4rdIAYaNaTENPJCmD29W12i6r13C BQkosef5sK560N1T3SPBXKj2VxPyZzrABOmAu56tNyNbVHGA7xkriHN0LXIOp8i9ap43 fCpdutm67WWFW9xxGraz9QzGoY21EvTCtsI3nnwUBxvRfWrc9wm4CSQhvJd/pgQ2LftT 6cyZxraa23Bobe5qxVajQ3rsF0RtIqqop+JOoOKfQjxSE7R+qMHJcqnolgzuJCgMWG+S kzJqNDHK8OoIkkDM6q0BtzpYXPAYByZ7E3U+EBUMqOC2w4sFduAef4hdctXL5Na8Kie1 9XRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NZuqAMQH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si12046554oic.12.2020.01.17.02.00.27; Fri, 17 Jan 2020 02:00:39 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NZuqAMQH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729163AbgAQJ6t (ORCPT + 99 others); Fri, 17 Jan 2020 04:58:49 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:53788 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726688AbgAQJ6r (ORCPT ); Fri, 17 Jan 2020 04:58:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579255125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uf1keSD3DOZ8jh4mCSz+0fhQb4Z+vPKdygjWjY+hlbM=; b=NZuqAMQHdmeU601OrxePBrd966BxNqTEgfw5R1mDKKlzoMCLtfBAMfdQJQcMkHc6ssNurk XAJCledikqC8sM82Bx1gZE+3zf4TRc2v4ZDsm464PMe4QEMK6Jyqh+45fE4RNTpiLpNyZq yxTOyKuAoXXYsyF5qUexLdNL+f1K0fM= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-127-hLzf4peXPYKM3erIJvsGnA-1; Fri, 17 Jan 2020 04:58:44 -0500 X-MC-Unique: hLzf4peXPYKM3erIJvsGnA-1 Received: by mail-lj1-f199.google.com with SMTP id d14so6029943ljg.17 for ; Fri, 17 Jan 2020 01:58:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=Uf1keSD3DOZ8jh4mCSz+0fhQb4Z+vPKdygjWjY+hlbM=; b=DLNmldEN9VsGCLbWcu4yjuM0I4GaSPuP8/fn/is+XISNqd+rEYQJhgAQwpzyE+4wHN kuwqZ9TSSSEGz+usQDKJUrWYEd3XIfU+rF9bU/yfRA54F5TKoNerTRAtclAqM9Q7C8oN A7mzJtYtoMSAmXBBROr6OxnUs7qIZb158h1sS0w7L8SIJ3pEUfmrfOqLC5wkizES3yp2 U/odV3ZSbABiLQh+8T1m0/ECUe+7aFgC8zSkF4kCa0BtHoUE/UmUvB8PYCZDSM1Y1NAJ Sv6qhllvzazG69HKPV+4rlY1yYVUIV/ybsME8BB/cIwNAfjE+uP6UuvCE49XO7I97eC9 /5hg== X-Gm-Message-State: APjAAAX7312UB80mFLjNd2KF3whlZaNBjynZtgEsqPctKUgl9k18TJog gm9ILs+lS0yzCiEcDjpI3LBWikKGuQd5kWO58adpKfX5+59v/6y0zPNFfjPLD7d6OqATaiEkCwH A8LclvIXz/YjNtDCD9r0AIHDG X-Received: by 2002:ac2:4849:: with SMTP id 9mr4975735lfy.11.1579255123124; Fri, 17 Jan 2020 01:58:43 -0800 (PST) X-Received: by 2002:ac2:4849:: with SMTP id 9mr4975702lfy.11.1579255122857; Fri, 17 Jan 2020 01:58:42 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id r21sm12164399ljn.64.2020.01.17.01.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 01:58:42 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 341A91804D6; Fri, 17 Jan 2020 10:58:41 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Jesper Dangaard Brouer , Alexei Starovoitov Cc: Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Doug Ledford , Jason Gunthorpe , "David S. Miller" , Jakub Kicinski , John Fastabend , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Shuah Khan , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kselftest@vger.kernel.org, clang-built-linux@googlegroups.com, brouer@redhat.com Subject: Re: [PATCH bpf-next v3 00/11] tools: Use consistent libbpf include paths everywhere In-Reply-To: <20200117095721.0030f414@carbon> References: <157918093154.1357254.7616059374996162336.stgit@toke.dk> <20200117041431.h7vvc32fungenyhg@ast-mbp.dhcp.thefacebook.com> <20200117095721.0030f414@carbon> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 17 Jan 2020 10:58:41 +0100 Message-ID: <87lfq6qu9a.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jesper Dangaard Brouer writes: > On Thu, 16 Jan 2020 20:14:32 -0800 > Alexei Starovoitov wrote: > >> On Thu, Jan 16, 2020 at 02:22:11PM +0100, Toke H=C3=B8iland-J=C3=B8rgens= en wrote: >> > The recent commit 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs= .h are >> > taken from selftests dir") broke compilation against libbpf if it is i= nstalled >> > on the system, and $INCLUDEDIR/bpf is not in the include path. >> >=20 >> > Since having the bpf/ subdir of $INCLUDEDIR in the include path has ne= ver been a >> > requirement for building against libbpf before, this needs to be fixed= . One >> > option is to just revert the offending commit and figure out a differe= nt way to >> > achieve what it aims for.=20=20=20 >>=20 >> The offending commit has been in the tree for a week. So I applied Andri= i's >> revert of that change. It reintroduced the build dependency issue, but w= e lived >> with it for long time, so we can take time to fix it cleanly. >> I suggest to focus on that build dependency first. >>=20 >> > However, this series takes a different approach: >> > Changing all in-tree users of libbpf to consistently use a bpf/ prefix= in >> > #include directives for header files from libbpf.=20=20 >>=20 >> I'm not sure it's a good idea. It feels nice, but think of a message we'= re >> sending to everyone. We will get spamed with question: does bpf community >> require all libbpf users to use bpf/ prefix ? What should be our answer? > > The answer should be: Yes. When libbpf install the header files the are > installed under bpf/ prefix. It is very confusing that samples and > selftests can include libbpf.h without this prefix. Even worse > including "bpf.h" pickup the libbpf version bpf/bpf.h, which have > caused confusion. The only reason for the direct "libbpf.h" include is > historical, as there used-to-be a local file for that. Agreed. Also, we are already telling people what the right include path is in at least two ways - and currently they are incompatible: - The pkg-config file included with libbpf has a notion of include path; which does *not* include the bpf/ subdirectory. - The skeleton generator puts an '#include ' line into the generated files. With this series we'll at least be consistent. >> Require or recommend? If require.. what for? It works as-is. If recommen= d then >> why suddenly we're changing all files in selftests and samples? >> There is no good answer here. I think we should leave the things as-is. > > I strongly believe we should correct this. It doesn't make sense that > someone copying out a sample or selftests, into a git-submodule libbpf > (or distro installed libbpf-devel) have to understand that they have to > update the include path for all the libbpf header files. Yeah, I think being clear and explicit about what is the recommended way to include libbpf is strictly an improvement. And making it possible to move example programs seamlessly in and out of the kernel tree will only make things easier for people. I'll rebase and respin this series on top of the revert (and fix Andrii's comments). -Toke