BPF elf examples
Stephen Hemminger
stephen at networkplumber.org
Tue Oct 21 15:38:30 CEST 2025
On Tue, 21 Oct 2025 11:42:25 +0000
Marat Khalili <marat.khalili at huawei.com> wrote:
> > -----Original Message-----
> > Tried using AI to generate tests, and as usual it sort of worked but the
> > example code generated won't load or work. Is there anywhere to find working
> > DPDK examples of using BPF load?
>
> Hello! I'm sitting on some patches adding a framework for generating BPF ELF
> files using libelf and some basic unit tests based on it. Hopefully I'll be
> able to upstream it within the next couple of months.
>
> Generating ELF files is probably beyond the reach of current AI, but once the
> framework is there perhaps it could be used to add test cases, would be
> interesting to try...
I have sample programs now (thanks AI). But building them in meson is messy.
And integrating standalone files in UT is brittle.
Perhaps using bpftool like tap driver does to generate a header file (.h) and
then have UT write a /tmp file to load.
More information about the dev
mailing list