Re: [PATCH bpf-next 07/10] selftests/bpf: migrate flow_dissector namespace exclusivity test

From: Stanislav Fomichev
Date: Wed Nov 13 2024 - 12:50:54 EST


On 11/13, Alexis Lothoré wrote:
> On 11/13/24 14:53, Alexis Lothoré (eBPF Foundation) wrote:
>
> [...]
>
> > + ns = open_netns(TEST_NS);
> > + bpf_prog_detach2(prog_fd, 0, BPF_FLOW_DISSECTOR);
> > + close_netns(ns);
>
> I would like to mention that I initially planned to directly delete the
> namespace to perform the test cleanup, assuming it would be enough to consider
> any non-root namespace flow_dissector to be removed. However I observed that it
> made other tests dealing with flow_dissector starting to fail with -EEXIST,
> despite all those tests being marked as "serial". I started examining this,
> suspecting a real issue (a race between namespace deletion and flow dissector
> attachment check, or a ns refcount issue) but before going further: is my
> assumption right ? Should a mere namespace deletion be indeed enough to remove
> the corresponding bpf flow dissector ? Or am I missing something ? If so I'll
> keep examining this.

Don't think that's expected. Removing a namespace with an attached
dissector program should (in theory) clearly detach it.