OSDN Git Service

selftests: xsk: Remove thread for netns switch
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Mon, 29 Mar 2021 22:43:07 +0000 (00:43 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 30 Mar 2021 16:24:39 +0000 (09:24 -0700)
commitef9280789773c974b45f809d58b47b481f2cf9f5
tree5a015aac6d29cfa0087cc00d53d07c41f6dce312
parentc9d27c9e8dc7ccced65007a4d5d3640cad42adfc
selftests: xsk: Remove thread for netns switch

Currently, there is a dedicated thread for following remote ns operations:
- grabbing the ifindex of the interface moved to remote netns
- removing xdp prog from that interface

With bpf_link usage in place, this can be simply omitted, so remove
mentioned thread, as BPF resources will be managed by bpf_link itself,
so there's no further need for creating the thread that will switch to
remote netns and do the cleanup.

Keep most of the logic for switching the ns, though, but make
switch_namespace() return the fd so that it will be possible to close it
at the process termination time. Get rid of logic around making sure
that it's possible to switch ns in validate_interfaces().

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210329224316.17793-9-maciej.fijalkowski@intel.com
tools/testing/selftests/bpf/xdpxceiver.c
tools/testing/selftests/bpf/xdpxceiver.h