From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1E24C3A59D for ; Thu, 22 Aug 2019 08:58:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5A262173E for ; Thu, 22 Aug 2019 08:58:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731958AbfHVI6h (ORCPT ); Thu, 22 Aug 2019 04:58:37 -0400 Received: from www62.your-server.de ([213.133.104.62]:48740 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731589AbfHVI6h (ORCPT ); Thu, 22 Aug 2019 04:58:37 -0400 Received: from sslproxy05.your-server.de ([78.46.172.2]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1i0ivI-0000Ci-4d; Thu, 22 Aug 2019 10:58:24 +0200 Received: from [178.197.249.40] (helo=pc-63.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1i0ivH-000AIc-Ig; Thu, 22 Aug 2019 10:58:23 +0200 Subject: Re: [RFC bpf-next 4/5] iproute2: Allow compiling against libbpf To: =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= , Stephen Hemminger , Alexei Starovoitov Cc: Martin KaFai Lau , Song Liu , Yonghong Song , David Miller , Jesper Dangaard Brouer , netdev@vger.kernel.org, bpf@vger.kernel.org, andrii.nakryiko@gmail.com References: <20190820114706.18546-1-toke@redhat.com> <20190820114706.18546-5-toke@redhat.com> From: Daniel Borkmann Message-ID: <9de36bbf-b70d-9320-c686-3033d0408276@iogearbox.net> Date: Thu, 22 Aug 2019 10:58:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190820114706.18546-5-toke@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.3/25548/Wed Aug 21 10:27:18 2019) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 8/20/19 1:47 PM, Toke Høiland-Jørgensen wrote: > This adds a configure check for libbpf and renames functions to allow > lib/bpf.c to be compiled with it present. This makes it possible to > port functionality piecemeal to use libbpf. > > Signed-off-by: Toke Høiland-Jørgensen > --- > configure | 16 ++++++++++++++++ > include/bpf_util.h | 6 +++--- > ip/ipvrf.c | 4 ++-- > lib/bpf.c | 33 +++++++++++++++++++-------------- > 4 files changed, 40 insertions(+), 19 deletions(-) > > diff --git a/configure b/configure > index 45fcffb6..5a89ee9f 100755 > --- a/configure > +++ b/configure > @@ -238,6 +238,19 @@ check_elf() > fi > } > > +check_libbpf() > +{ > + if ${PKG_CONFIG} libbpf --exists; then > + echo "HAVE_LIBBPF:=y" >>$CONFIG > + echo "yes" > + > + echo 'CFLAGS += -DHAVE_LIBBPF' `${PKG_CONFIG} libbpf --cflags` >> $CONFIG > + echo 'LDLIBS += ' `${PKG_CONFIG} libbpf --libs` >>$CONFIG > + else > + echo "no" > + fi > +} > + > check_selinux() More of an implementation detail at this point in time, but want to make sure this doesn't get missed along the way: as discussed at bpfconf [0] best for iproute2 to handle libbpf support would be the same way of integration as pahole does, that is, to integrate it via submodule [1] to allow kernel and libbpf features to be in sync with iproute2 releases and therefore easily consume extensions we're adding to libbpf to aide iproute2 integration. Thanks, Daniel [0] http://vger.kernel.org/bpfconf2019.html#session-4 [1] https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=21507cd3e97bc5692d97201ee68df044c6767e9a