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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1D54C433EF for ; Fri, 21 Jan 2022 20:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbiAUUrL (ORCPT ); Fri, 21 Jan 2022 15:47:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbiAUUrL (ORCPT ); Fri, 21 Jan 2022 15:47:11 -0500 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AC9DC06173B for ; Fri, 21 Jan 2022 12:46:29 -0800 (PST) Received: by mail-lj1-x22e.google.com with SMTP id x26so1882717ljd.4 for ; Fri, 21 Jan 2022 12:46:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kinvolk.io; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hqWL/nHYnUBO+Ln1N3+JmH4jOEi3UlJnxazuE/NF8h0=; b=VY7zjbOdtIGBRC8Jsf7LYuzWSMI63i9iqt2wn2NVA1BS4pUdJja02DAgATa7EXKNVC 59bMzMflXqqF1sasaJninuhXRFznZfDm4bu8Y37ORwQ/lq9pumRqQDUhcuTufCZtTXKn dwZhMrTIyJvqfwdOjl2px+JzJmQ+KQThwRsbs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hqWL/nHYnUBO+Ln1N3+JmH4jOEi3UlJnxazuE/NF8h0=; b=20QBhQcO53DD6fTxCKAdgfBYdGSOs5/6OgbfCUjgwurSUjrAXrP+m7nO5mD8omrIsa rm5zHkXdWNHV9wbb4SeBo1yuuwow9dWXtCauSCJHv6vD3quCBW92nTt/vsoPe6UqsogG itdstnBvwx+6L5XNW/nwZ0xqYzmYefJcjSGpsp2oJeGBPrBJxK8sAhx4Fov5iSbrEUY7 QazQtyQR3eNS2RGBzL1hcZiPWSP2bhOh7QGHFwUpQPk1KUPpCU3RxxSfB0klfI42W4Lo BckNoEFRmfiYlvT5R7Ohcob6rCMaDxejtbqqvvS/JNt2ubmBGjVl1rVaj68U9CozJH1y 2NWw== X-Gm-Message-State: AOAM533jQzAtmzQ45TsWoi2A0cmpA8QOwNOVrKTj48FfU/mZWuyPOYNa YxcIEpiq3Wnl+HR3c7+geHGs8dzRpFJ9cPPXHsT4nw== X-Google-Smtp-Source: ABdhPJwOmghXusPS8BhldNXanor5xsas/PN+2MQZSq3Zr9ecOZwNDUhzQLHG09Xt1FLhQMwoZnJqyyLwGeQxktkybpM= X-Received: by 2002:a2e:9bce:: with SMTP id w14mr4385061ljj.110.1642797905119; Fri, 21 Jan 2022 12:45:05 -0800 (PST) MIME-Version: 1.0 References: <20220112142709.102423-1-mauricio@kinvolk.io> <20220112142709.102423-3-mauricio@kinvolk.io> In-Reply-To: From: =?UTF-8?Q?Mauricio_V=C3=A1squez_Bernal?= Date: Fri, 21 Jan 2022 15:44:54 -0500 Message-ID: Subject: Re: [PATCH bpf-next v4 2/8] libbpf: Implement changes needed for BTFGen in bpftool To: Quentin Monnet Cc: Networking , bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Rafael David Tinoco , Lorenzo Fontana , Leonardo Di Donato Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Jan 12, 2022 at 1:08 PM Quentin Monnet wrot= e: > > 2022-01-12 09:27 UTC-0500 ~ Mauricio V=C3=A1squez > > This commit extends libbpf with the features that are needed to > > implement BTFGen: > > > > - Implement bpf_core_create_cand_cache() and bpf_core_free_cand_cache() > > to handle candidates cache. > > - Expose bpf_core_add_cands() and bpf_core_free_cands to handle > > candidates list. > > - Expose bpf_core_calc_relo_insn() to bpftool. > > > > Signed-off-by: Mauricio V=C3=A1squez > > Signed-off-by: Rafael David Tinoco > > Signed-off-by: Lorenzo Fontana > > Signed-off-by: Leonardo Di Donato > > --- > > tools/lib/bpf/Makefile | 2 +- > > tools/lib/bpf/libbpf.c | 43 +++++++++++++++++++++------------ > > tools/lib/bpf/libbpf_internal.h | 12 +++++++++ > > 3 files changed, 41 insertions(+), 16 deletions(-) > > > > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile > > index f947b61b2107..dba019ee2832 100644 > > --- a/tools/lib/bpf/Makefile > > +++ b/tools/lib/bpf/Makefile > > @@ -239,7 +239,7 @@ install_lib: all_cmd > > > > SRC_HDRS :=3D bpf.h libbpf.h btf.h libbpf_common.h libbpf_legacy.h xsk= .h \ > > bpf_helpers.h bpf_tracing.h bpf_endian.h bpf_core_read.h = \ > > - skel_internal.h libbpf_version.h > > + skel_internal.h libbpf_version.h relo_core.h libbpf_internal.= h > > GEN_HDRS :=3D $(BPF_GENERATED) > > I don't think these headers should be added to libbpf's SRC_HDRS. If we > must make them available to bpftool, we probably want to copy them > explicitly through LIBBPF_INTERNAL_HDRS in bpftool's Makefile. I got confused, thanks for catching this up!