Re: Selectively delay loading of eBPF program.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/03/2023 09:52, Dominic wrote:
> Hi, I have multiple eBPF programs compiled into a single skeleton file
> and I need a way to delay loading of one of the programs.
> 
> I am aware of `bpf_program__set_autoload()` API but once an object is
> loaded using `bpf_object__load()`, there are no APIs to selectively
> load a program (bpf_prog_load() has been deprecated). Calling
> bpf_object__load() again fails.
> 
> Wondering if there are any options to achieve the above mentioned behavior.
>

I ran into a similar problem recently; in my case, the problem
was that one of the functions that one of my BPF programs attached
to could be inlined on some kernel versions.  As a result the
whole skeleton would fail on auto-attach. If that is the
problem you are facing, you can try a full load/attach and
if that fails, start again - you'll need to destroy the
skeleton and go back to the open if I remember correctly -
and mark the problematic program using bpf_program__set_autoload()
to false the second time round.

Failing that, is separating into two skeletons and using
bpf_map__reuse_fd() to share fds across both skeletons 
feasible?

If not, can you provide more details on why the delayed load
is required - that might help us figure out a solution. One
thing to figure out - is it definitely delayed load you need,
or just delayed attach? Thanks!

Alan
 
> Thanks & Regards,
> Dominic



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux