Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2682577pxf; Sat, 27 Mar 2021 21:43:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/KPB7EGOuBg9TSrHSF4SPvyPVp4kNBi1jWBkz4gsM0D37Xxi4rliMV2J0wYrJ/+fWdjnf X-Received: by 2002:a17:906:6882:: with SMTP id n2mr22577642ejr.50.1616906609929; Sat, 27 Mar 2021 21:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616906609; cv=none; d=google.com; s=arc-20160816; b=0A7eom4tsZy+Sx2alfzmmQwja+mPWmWfeNC1aUjlaPAfPnvaLh7BUZAWRDo0WKpj6U SwZ+/mvrnA3sKzMpVOekgqfp00KOSOh3DcbTQhoKp3OTJ3keBgYknSZPj6JrRL1ttU05 DsqHluwhUR4psrPtfD7wlEGg/Z5oluurCagDZVnXUiUepcOIJlSrOhDtp1zixMTjJ4tZ SPidi1iGgB2sMo7ec/zV+xjYOWBTATAGdcW4ZN4L+PL+yO2bF8WAAuLAeLzhjP4wIEpC mISTlvX39tUTH8A+ySERR3jMBm4fCC81yJCeUD8lhCAMzzyiZTiV26hjSFSNZdP9JTzf e5Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CJibKbE2pHTeyp3O5gbay5BrG2Hry6PfPEoIAMQ+LSk=; b=Q4XXnYIDIJuO16AtFwnBS5QlYHaMoriPjB1cEGo51h4i5h90eXlY6kOiIzYOJgAjNS Gfcf5MpAeeNcPYHy8o4XqJuebXJYauDhDvusxx+eAssFGNPdaOJ5Z4LWHMUGBx1WEfDZ rXjELY9KDp5Sozt8zwS7L+RTPS/7a6SUx2ahdIxNOAXfcAOiioaR8K4r/1n9g3ZfkZz3 Q2y3sowNDN10jXvbMDd46ze2OUcQYT96mhZtPA5dXFbyrqNwTjcWvVQHhuzJ2EfJbkky znxisEM7eSvChX3VOrunxIUTi8QHZK1I4dtwVVJXqO0hFPN9J3+DYxHFelMg/LvWxokM BmMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ilPqnOEh; 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 f16si10486813edj.210.2021.03.27.21.43.07; Sat, 27 Mar 2021 21:43:29 -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=ilPqnOEh; 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 S230184AbhC1EdX (ORCPT + 99 others); Sun, 28 Mar 2021 00:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbhC1EdK (ORCPT ); Sun, 28 Mar 2021 00:33:10 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30656C061762; Sat, 27 Mar 2021 21:33:10 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id l15so10257324ybm.0; Sat, 27 Mar 2021 21:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CJibKbE2pHTeyp3O5gbay5BrG2Hry6PfPEoIAMQ+LSk=; b=ilPqnOEh9fQBeGtp0rwT2gyJ4dNWjAulC8oZ0D/S5B2eWMUYSJDsyGYZqlVHSnSCiS 1NNlIlTIt4yX7TOVrih/LdAnlhAzW14CMvh1Gux1Ar0diImXDqRYinu2QqDlyeU6cRlR Ze7W/H0V8FrM5T96ZIFQrLIxzgn3n9ePfN+iDi3/AyqmFTW1uZR/vtFr7vFAGNPVa6sF KONaM+2RO5WNqUNBlYgdQEzb3vSZkVSrtoQyFtF1vBL9k+9JGGR4Y+Bubf4doPK9VSOR 430uP9lXv7LiQR20e1pSsjGB+HQ/XrpmjehJLOn1PQ1Bn0LKZt0ITxBVYpM+9G2QEmn3 2nwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CJibKbE2pHTeyp3O5gbay5BrG2Hry6PfPEoIAMQ+LSk=; b=TmtRj3RYgC9hJLk4cI6ARb/bOQKRt6PFbtTGGoZ9w5LUJH8jnmZ14cGF7RNhwjFaBg CQs6wIHFMNBimuYpbT014DvYRjPsQeOF6eWC7JopXEe94OaPOwsN+mAR/zQPAA4p6/NW giAB4MVNx07dT/rGzBR/ql4DH2qE+j/jhmd0156/fNtMRhvYFwIwg0FLDWsXK1YuaLyF lKPB3QTqxZPRxOpN3hpJcWSDU12KkYkghxJVpbGb52WJCiwYxMDcME3CxlYEdmaY0N5E dqjdCGRHq3ghkn/9QOPV9cVCirKD8eaTkQabZ0urrcliyYOn5E/RsIkcie5gb5jJN98w Uinw== X-Gm-Message-State: AOAM531Rfyg8n5WzK8lHhgFSWdJLq2sl3RVyqjBlcZR5EHP6ZBG+tNPy QOaQp5qoNjqG3WUUW7AgxacZjWgM7WtWs6EIGso= X-Received: by 2002:a25:7d07:: with SMTP id y7mr29811546ybc.425.1616905989011; Sat, 27 Mar 2021 21:33:09 -0700 (PDT) MIME-Version: 1.0 References: <20210325120020.236504-1-memxor@gmail.com> <20210325120020.236504-6-memxor@gmail.com> <20210327021534.pjfjctcdczj7facs@ast-mbp> In-Reply-To: <20210327021534.pjfjctcdczj7facs@ast-mbp> From: Andrii Nakryiko Date: Sat, 27 Mar 2021 21:32:58 -0700 Message-ID: Subject: Re: [PATCH bpf-next 5/5] libbpf: add selftests for TC-BPF API To: Alexei Starovoitov Cc: Kumar Kartikeya Dwivedi , bpf , Jesper Dangaard Brouer , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , 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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 26, 2021 at 7:15 PM Alexei Starovoitov wrote: > > On Thu, Mar 25, 2021 at 05:30:03PM +0530, Kumar Kartikeya Dwivedi wrote: > > This adds some basic tests for the low level bpf_tc_* API and its > > bpf_program__attach_tc_* wrapper on top. > > *_block() apis from patch 3 and 4 are not covered by this selftest. > Why were they added ? And how were they tested? > > Pls trim your cc. bpf@vger and netdev@vger would have been enough. > > My main concern with this set is that it adds netlink apis to libbpf while > we already agreed to split xdp manipulation pieces out of libbpf. > It would be odd to add tc apis now only to split them later. We weren't going to split out basic attach APIs at all. So bpf_set_link_xdp_fd() and bpf_program__attach_xdp() would stay in libbpf. libxdp/libxsk would contain higher-level APIs which establish additional conventions, beyond the basic operation of attaching BPF program to XDP hook. E.g, all the chaining and how individual XDP "sub-programs" are ordered, processed, updated/replaced, etc. That's all based on one particular convention that libxdp would establish, so that part shouldn't live in libbpf. So in that sense, having TC attach APIs makes sense to complete libbpf's APIs. I think it's totally in libbpf's domain to provide APIs of the form "attach BPF program to BPF hook". > 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, I'm not convinced that's a better situation for end users. And would certainly cause more hassle for libbpf developers and packagers. And what did you include in "core libbpf"?