Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3256412pxf; Sun, 28 Mar 2021 18:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEXsLAzkKP6Q3p0wnMGDLjypI+MFR7zcbbZK+U31Q6J6rfYMDAiOP7BDPo2Hj4YZ2yc9Y3 X-Received: by 2002:a05:6402:512:: with SMTP id m18mr26096001edv.372.1616982145871; Sun, 28 Mar 2021 18:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616982145; cv=none; d=google.com; s=arc-20160816; b=oVydIyJD71J2I2KXRebdWRtNj0qLnZozVw5fgE9s5+3vHgD+Eox171uXyKouUjbwWC 6uvXmb8yJIBIUtsJsSrWyb1ppu6BgyIimSSZfvrkL3dzmPCacp3LcId8AaFuOpfLY7+/ xAnDNX54ZyqJAe2y8UZyxnRgNcZTXD3zRXEWUJdjIv2twiPMuvtCqHwTvretWpTe3gEt 0E55KTZ10HYyr/bbN7D7mNxBT//gf0tBPyZPXVJnL3GznU/G5tYDh68RdaDm2ZnSR0Gc vKQ9Cn0IYicpFodixAj05me2uQTtk7XLgVvDaopRov+lPX45mzoOyR6vvlfUb4cQXvPL 1Xvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=A31fTE6FaV7bDCF8xSgupyEIITubhNi2zHJbCkiQMck=; b=FWTaCdsHJWZ6eGi+CN0RTAppZlHeClrOFvH5Mx1IyOu8MasQQo4Z+VoYTP9ph0M5Ug 3LRwaMt1L+3zP1o7uEdlshEJAgDOHi5gtWITby+bQc27XD6JHpK/LtRODvCyddvIFaKN G53yeFpQo4K6CQC1aUnXmBJxRDa2TfAtN+kPlIm83/Tlmlhyxg9P9LFvR3RE+kQF7rRT TjcdhWfLt0P7bK0S3MNtOENydLuzc7nwHu9lupceB9h9ePzB0lYJuvNNQ1A7NuIT5VtF Lkdv5lJGSn1/UTJDOfh9nAYoKEGRjCOYJ4QPr4LVXPAZZmG8PwmSMMi2MdW4wVd5bIvc DGLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gMXBRLbx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si11567392eds.169.2021.03.28.18.42.04; Sun, 28 Mar 2021 18:42:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gMXBRLbx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbhC2BlK (ORCPT + 99 others); Sun, 28 Mar 2021 21:41:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbhC2Bkt (ORCPT ); Sun, 28 Mar 2021 21:40:49 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 868FEC061574; Sun, 28 Mar 2021 18:40:48 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id l76so8417047pga.6; Sun, 28 Mar 2021 18:40:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=A31fTE6FaV7bDCF8xSgupyEIITubhNi2zHJbCkiQMck=; b=gMXBRLbxgDGSiivJHaNkwk8IFZyp88K0+CIt3cIBrSI7i5ZjnQJevS+V8/Oep2we9U zcmkDgxEh12E6z/cbWHSo4Ip3wF2O0wm8DuPxW0ScAsNrJdKTvki4CQJosuQrmA2nJBc KlgwrOWTRpiNG0trd2FFKVvU5ad1ss1SC6QDoTSygpF0jfCw3Fb2eQXopFN3Budm54Bh lp98nDGzHH7mBrDHFXIZimkHG0+JDowEi6k7rDh8PNAh3KRh/Miee1IwEMGz2tSGxOUt 7YD91vhKhlbHq/qaVO+f1ghDGryB8ddQazWGDx5W4Rx7cFFpUtVjpafxvymE4Bri7UTk 0G3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A31fTE6FaV7bDCF8xSgupyEIITubhNi2zHJbCkiQMck=; b=sU2HcL+d+pUr2L0if3liV6FskpyXmQ/KOC+Y+MBBwf49WXNtlC25Md9mlcB4vAWUaP YG7sI3aT01w323QaZfpBAD2joYbCXuFXYjLbfhjZW0nd9ucgel/6Lq+dwBA/jtdtba0e lzvtWOyVrdkUY6lErnTYpZPY/Dh4rhvcnui0oMPLzhxwdguSscITdOW/kKrgZHRCpkHm xPn2R/djENOBi0kx9zHR4txM6/BelBsxe1rf2UrokGap0uYzFIKP5/6OyJj77eAV0JQs /zXg/Sf3N/XPAfeSAOOLJZh/jsdRzum+jsG0NMpRNv6Wmgxror2U7oS/2Bs9nrL/2Qaw Kq0w== X-Gm-Message-State: AOAM532xmRBBoM2frxHd7+G/iMc2yBQ5YSmyoOfBnlIv/IFDjWN6vyN0 2EFJnhRH9H6jcHC1d70ii7M= X-Received: by 2002:a05:6a00:b86:b029:207:8ac9:85de with SMTP id g6-20020a056a000b86b02902078ac985demr22525728pfj.66.1616982048021; Sun, 28 Mar 2021 18:40:48 -0700 (PDT) Received: from ast-mbp ([2620:10d:c090:400::5:1b8f]) by smtp.gmail.com with ESMTPSA id k21sm15960927pfi.28.2021.03.28.18.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 18:40:47 -0700 (PDT) Date: Sun, 28 Mar 2021 18:40:44 -0700 From: Alexei Starovoitov To: Andrii Nakryiko Cc: Kumar Kartikeya Dwivedi , bpf , Jesper Dangaard Brouer , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , Peter Zijlstra , open list , Networking , "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH bpf-next 5/5] libbpf: add selftests for TC-BPF API Message-ID: <20210329014044.fkmusoeaqs2hjiek@ast-mbp> References: <20210325120020.236504-1-memxor@gmail.com> <20210325120020.236504-6-memxor@gmail.com> <20210327021534.pjfjctcdczj7facs@ast-mbp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 27, 2021 at 09:32:58PM -0700, Andrii Nakryiko wrote: > > I think it's better to start with new library for tc/xdp and have > > libbpf as a dependency on that new lib. > > For example we can add it as subdir in tools/lib/bpf/. > > > > Similarly I think integerating static linking into libbpf was a mistake. > > It should be a sub library as well. > > > > If we end up with core libbpf and ten sublibs for tc, xdp, af_xdp, linking, > > whatever else the users would appreciate that we don't shove single libbpf > > to them with a ton of features that they might never use. > > What's the concern exactly? The size of the library? Having 10 > micro-libraries has its own set of downsides, specifically? > I'm not convinced that's > a better situation for end users. And would certainly cause more > hassle for libbpf developers and packagers. For developers and packagers.. yes. For users.. quite the opposite. The skel gen and static linking must be split out before the next libbpf release. Not a single application linked with libbpf is going to use those pieces. bpftool is one and only that needs them. Hence forcing libbpf users to increase their .text with a dead code is a selfish call of libbpf developers and packagers. The user's priorities must come first. > And what did you include in "core libbpf"? I would take this opportunity to split libbpf into maintainable pieces: - libsysbpf - sys_bpf wrappers (pretty much tools/lib/bpf/bpf.c) - libbpfutil - hash, strset - libbtf - BTF read/write - libbpfelf - ELF parsing, CORE, ksym, kconfig - libbpfskel - skeleton gen used by bpftool only - libbpflink - linker used by bpftool only - libbpfnet - networking attachment via netlink including TC and XDP - libbpftrace - perfbuf, ringbuf - libxdp - Toke's xdp chaining - libxsk - af_xdp logic In the future the stack trace symbolization code can come into libbpftrace or be a part of its own lib. My upcoming loader program and signed prog generation logic can be part of libbpfskel.