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 A43F043DFB; Thu, 4 Apr 2024 18:12:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9339F40685; Thu, 4 Apr 2024 18:12:21 +0200 (CEST) Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) by mails.dpdk.org (Postfix) with ESMTP id D96954064A for ; Thu, 4 Apr 2024 18:12:20 +0200 (CEST) Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-6154a3df493so17784287b3.1 for ; Thu, 04 Apr 2024 09:12:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712247140; x=1712851940; 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=d0HGPIGcsEz2bN2XwofoG6m/HYoSFHJWL80nzuefDdI=; b=BqBhZuG85r6hBRM5PmlvXHpSadtDTqkTX5BnEaTyuAAiI/Z9JxiXzDLMlIjR2e0zWR bCkZTZlreWU1MqFS4rdCA9DAKE1Rty4hTHzf6pnOm2ZXFSNvC5rXfkjjYHBW3LznnezJ K9wFA7J3CgRXhCR4Gdu11vqtrTXgMCJKhAAklRuOK3E4Fu+0qnaHas8vPraHRjhmnbYA 3HhBlmUj2dwqykmBneTsSyzUi+TXvm0HQWYLLD+zyVAqpQCV0uyfm3CfmV429KlmTOrz PwJMq2yTqlIs+aWAyFAed7oox0+5H4zr7YlqzJW8zj1/54qzcNd5S/V9NrWdqmm2ak0d qYBQ== X-Gm-Message-State: AOJu0YxBsnB9p0KB5Dg8vYSQvvPU0GUng9Xq7W6t9LT3FFwm96UxdBQJ wgQdTv43WrLeBwQQtIjXRMPmZwppQxP5ZWP6E9dSbgBiITsqYeRtb7ntTeL5g00= X-Google-Smtp-Source: AGHT+IEZUuBs7rqk0O+kUmU/+3KZtrsashrZWmHekESCJc+Z4tAfcS1480oZf/HCypwMgbeHaTy/Mg== X-Received: by 2002:a25:b187:0:b0:dc6:d258:c694 with SMTP id h7-20020a25b187000000b00dc6d258c694mr4570540ybj.19.1712247139691; Thu, 04 Apr 2024 09:12:19 -0700 (PDT) Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com. [209.85.128.171]) by smtp.gmail.com with ESMTPSA id y3-20020a056902052300b00dcf35be9f51sm3489342ybs.24.2024.04.04.09.12.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Apr 2024 09:12:19 -0700 (PDT) Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-615053a5252so10435797b3.1 for ; Thu, 04 Apr 2024 09:12:19 -0700 (PDT) X-Received: by 2002:a25:d353:0:b0:dcd:9a9b:8d7e with SMTP id e80-20020a25d353000000b00dcd9a9b8d7emr7191ybf.9.1712247139315; Thu, 04 Apr 2024 09:12:19 -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> <20240404085150.20563f01@hermes.local> In-Reply-To: <20240404085150.20563f01@hermes.local> From: Luca Boccassi Date: Thu, 4 Apr 2024 17:12:08 +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 16:51, Stephen Hemminger wrote: > > On Thu, 4 Apr 2024 01:49:56 +0100 > Luca Boccassi wrote: > > > 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 > > Looks like vmlinux.h is not setup to handle tc programs. > > If vmlinux.h is included, it supersedes other kernel headers (ok). > But is missing some other things like IPv6 options, ether types, and > TC actions. To use it requires copy pasting from other headers > to fill in the missing pieces. Thats a mess. > > This little program only refers to skb and the fields that are problematic > are protocol, mark, and queue_mapping. That's not good, could you please report that to the BPF folks? Pretty sure it should get fixed in bpftool?