Re: [PATCH] bpf: fix reuse of DEVMAP

From: Eduard Zingerman
Date: Mon Aug 11 2025 - 13:29:55 EST


On Mon, 2025-08-11 at 11:39 +0200, Yureka Lilian wrote:
> Previously, re-using pinned DEVMAP maps would always fail, because
> get_map_info on a DEVMAP always returns flags with BPF_F_RDONLY_PROG set,
> it BPF_F_RDONLY_PROG being set on a map being created is invalid.
>
> Thus, match the BPF_F_RDONLY_PROG flag being set on the new map when
> checking for compatibility with an existing DEVMAP
>
> The same problem is handled in third-party ebpf library:
> - https://github.com/cilium/ebpf/issues/925
> - https://github.com/cilium/ebpf/pull/930
>
> Signed-off-by: Yureka Lilian <yuka@xxxxxxxx>
> ---

The change makes sense to me, could you please add a selftest?

[...]