Re: [PATCH v2 bpf-next 3/4] libbpf: deprecate legacy BPF map definitions

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

 



On Thu, Jan 20, 2022 at 3:44 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote:
>
> Andrii Nakryiko <andrii@xxxxxxxxxx> writes:
>
> > Enact deprecation of legacy BPF map definition in SEC("maps") ([0]). For
> > the definitions themselves introduce LIBBPF_STRICT_MAP_DEFINITIONS flag
> > for libbpf strict mode. If it is set, error out on any struct
> > bpf_map_def-based map definition. If not set, libbpf will print out
> > a warning for each legacy BPF map to raise awareness that it goes
> > away.
>
> We've touched upon this subject before, but I (still) don't think it's a
> good idea to remove this support entirely: It makes it impossible to
> write a loader that can handle both new and old BPF objects.
>
> So discourage the use of the old map definitions, sure, but please don't
> make it completely impossible to load such objects.

BTF-defined maps have been around for quite a long time now and only
have benefits on top of the bpf_map_def way. The source code
translation is also very straightforward. If someone didn't get around
to update their BPF program in 2 years, I don't think we can do much
about that.

Maybe instead of trying to please everyone (especially those that
refuse to do anything to their BPF programs), let's work together to
nudge laggards to actually modernize their source code a little bit
and gain some benefits from that along the way? It's the same thinking
with stricter section names, and all the other backwards incompatible
changes that libbpf 1.0 will do.

If you absolutely cannot afford to drop support for all the
to-be-removed things from libbpf, you'll have to stick to 0.x libbpf
version. I assume (it will be up to disto maintainers, I suppose)
you'll have that option.


>
> -Toke
>




[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