From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C9F7843DF2; Thu, 4 Apr 2024 02:50:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5969E402D1; Thu, 4 Apr 2024 02:50:11 +0200 (CEST) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by mails.dpdk.org (Postfix) with ESMTP id 3EB594029B for ; Thu, 4 Apr 2024 02:50:09 +0200 (CEST) Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-dc6d8bd612dso516872276.1 for ; Wed, 03 Apr 2024 17:50:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712191808; x=1712796608; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9r6LMfv1ESQAzXzvLmUVEGMtaj3jEdoOuIJWaKgqZYk=; b=QbgOs/4pnbCgzgls46geuUM5OWfPPFddbpbUBhn28xBWHWkj4HWu0Ql62jDDRuYlQY U3uVFPmCH1Um/OHxHYxOKfSbExG5/kvbSvhL6iZw8BhIdNadqjr/TOL5oMvhayHy3FPW ipMATpMPlVKmrsYGlE5aKQmjOhZkd9LJPhSSaN/EEen5U4yzLo83nWMqvZK2ouxbwEm/ 7fA58yI29yFphPK3pVDCUTdOgOhh9M+F2OQwSfPqSJQK8C+GF7CW702uno72ihsHJhop rxEb7XuMlRRt8N+WH70g10wOkTidiw8yVv/YIlLBIaq7I0CuMASZoDG/f5qJVhr09suA zy2g== X-Gm-Message-State: AOJu0YyOAi5otk5C2EDqRL22RcwfbsXBxMRbrpXElrpqpXsAml9hqVpz GTw1TDUg3kfdrhAhnFmiouFTI74vflaz00EQxBxiIEqwsGOoC+R7qC9qzAJAZiA= X-Google-Smtp-Source: AGHT+IF79uKYgdzzBpBhhL6jzFxcTQVoZbXTCQq3l8UpaYXGbV8d2ksdBsj2Edrz4bOAQ6RXcMWr2g== X-Received: by 2002:a25:c444:0:b0:dd1:2f58:6a2e with SMTP id u65-20020a25c444000000b00dd12f586a2emr1172962ybf.9.1712191808306; Wed, 03 Apr 2024 17:50:08 -0700 (PDT) Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com. [209.85.128.172]) by smtp.gmail.com with ESMTPSA id u1-20020a258f81000000b00dcd307dc310sm3189464ybl.56.2024.04.03.17.50.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Apr 2024 17:50:08 -0700 (PDT) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-61495e769bdso5032487b3.0 for ; Wed, 03 Apr 2024 17:50:08 -0700 (PDT) X-Received: by 2002:a81:9c4f:0:b0:615:1294:d6b9 with SMTP id n15-20020a819c4f000000b006151294d6b9mr1110018ywa.27.1712191807756; Wed, 03 Apr 2024 17:50:07 -0700 (PDT) MIME-Version: 1.0 References: <20240130034925.44869-1-stephen@networkplumber.org> <20240402171751.138324-1-stephen@networkplumber.org> <20240402171751.138324-8-stephen@networkplumber.org> <8794e9c209bc8b3888ef19452b1cfd3d3c48b9b3.camel@debian.org> <20240403085523.706151b6@hermes.local> <20240403164143.0ddabc53@hermes.local> In-Reply-To: <20240403164143.0ddabc53@hermes.local> From: Luca Boccassi Date: Thu, 4 Apr 2024 01:49:56 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 7/8] net/tap: use libbpf to load new BPF program To: Stephen Hemminger Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 4 Apr 2024 at 00:41, Stephen Hemminger wrote: > > On Wed, 3 Apr 2024 22:19:20 +0100 > Luca Boccassi wrote: > > > On Wed, 3 Apr 2024 at 16:55, Stephen Hemminger > > wrote: > > > > > > On Wed, 03 Apr 2024 12:50:35 +0100 > > > Luca Boccassi wrote: > > > > > > > Using bpftool to generate the header at build time is a bit icky, > > > > because it will look at sysfs on the build system, which is from the > > > > running kernel. But a build system's kernel might be some ancient LTS, > > > > and even be a completely different kconfig/build/distro from the actual > > > > runtime one. > > > > > > One other option would be to ship a pre-built skeleton file. > > > Which is what the method the old code did. > > > But that creates an implied dependency on the developers machine build environment. > > > > That's what the distro-provided vmlinux.h should help with - by > > #include'ing that, it should be possible to build a co-re bpf program, > > no other artifacts needed. You can try it out locally by generating it > > from the local running kernel on your dev machine: > > > > bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h > > Not all distros are providing vmlinux.h. > And some like Ubuntu haven't figured out how to package bpftool and libbpf correctly. Yes and for those the usual pattern is a fallback to generate at build time, if no pre-prepared vmlinux.h is configured