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 B21BB43DFA; Thu, 4 Apr 2024 17:51:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A42B402E8; Thu, 4 Apr 2024 17:51:54 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id A7FBD402BC for ; Thu, 4 Apr 2024 17:51:52 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1e0edd0340fso10189475ad.2 for ; Thu, 04 Apr 2024 08:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712245912; x=1712850712; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ENFJIm1NDLWwTysiy8duAD7h48RDq2Di+czkrogbOG0=; b=K7wFhmSDvjXlP5AQWkEcD6T7BHu+Y5NeO9LANY+ed5PzI9XxYBpagP0Kt4GhvLnz11 GqaaniWbIyKcLibjJ4sgWpoATZZ2ppsnrjSZVfeMjKyWoi5zLA3NtEgXTluuejcEl4+2 BqqpMWiEM2wow40vkP0Ejz3funvP2TMZtK5cpLOJGGz//dHSLX+IwnLGm7dAIIkaQVBn SsRzsTPBkz1YL6mNmjgEfvSaRb50X5o3v4MFdF6do2tZDv1X50QEh/Fez4mkrVBxlPPp 1quxoImLbE9iWqMwza0alOX0JIW2AYiO4FH1ZmzJDGWSH7YgAeWnyujIN3hpLmK4NI9W i4Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712245912; x=1712850712; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ENFJIm1NDLWwTysiy8duAD7h48RDq2Di+czkrogbOG0=; b=wIP4TCXRoNsFtVgvUllf/DaEkrwSxMHNlMYwAeXXIW5UdLuNN+BXKPpIIIwm42+B6t 5/i9Uux4KWs6Lbz4aBboJQdyXyBaUx+ejvkbSgYccLNEY8Kptxjvm2UZZsDPTFRqoR88 2Qa2/jivB82HmQSqx6C3SB+jt/yNr+McHcrCYlD5wNa96YPjts1HM+XjCpWXHx1Gerum sTxjq7iFlDD2vFICZyN4T/fUkBBGBYOINFDUR107bhJ/ZFr0EH4uf0a4elUMlvYsyGnF /t/zG8KFW/dLS3APFAzPzuxcmX/HbuQxsoPgyFP+dpRnASFS7m2Cnvl6cQv1HQEGrAhF FUzg== X-Gm-Message-State: AOJu0YxPdZUYSn/npUWqo9ZSmFiS6/LB8lkuZqiC3JOSd8psoFH8UaSq 5a9IIDMF6BwJy9YiFYfa/q2e+GJr+r6zp4WS/at/afmMnBuvh387vwrIrZWS52s= X-Google-Smtp-Source: AGHT+IGSqP2N0d/Nv4flFp9CzrBC/cfEx7ZIl6wmls2Xmkyrf2F0woObvdVfG9GeJaYE2llszQtwQA== X-Received: by 2002:a17:902:aa98:b0:1e2:90c6:839a with SMTP id d24-20020a170902aa9800b001e290c6839amr2763503plr.31.1712245911750; Thu, 04 Apr 2024 08:51:51 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id f6-20020a170902860600b001defa2d8e22sm15545378plo.233.2024.04.04.08.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 08:51:51 -0700 (PDT) Date: Thu, 4 Apr 2024 08:51:50 -0700 From: Stephen Hemminger To: Luca Boccassi Cc: dev@dpdk.org Subject: Re: [PATCH v5 7/8] net/tap: use libbpf to load new BPF program Message-ID: <20240404085150.20563f01@hermes.local> In-Reply-To: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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.