]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitebc18d51361dab41b3532eaf5821c9a51544cf88
tree5a015aac6d29cfa0087cc00d53d07c41f6dce312
parentceb7fc0b6c28359538685e31d9c1f610647b5ce1
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