selftests/bpf: Remove the "/sys" mount and umount dance in {open,close}_netns
authorMartin KaFai Lau <martin.lau@kernel.org>
Tue, 29 Nov 2022 07:08:58 +0000 (23:08 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 30 Nov 2022 21:47:43 +0000 (22:47 +0100)
commit3084097c369c57c9bbd81e5bf47b36b6b27390fc
tree9bffb360c71cb8f3c146ddeceef6ee0a43d9ca6c
parent5dc42a7fc2866a56bc5616babace0a252458fe01
selftests/bpf: Remove the "/sys" mount and umount dance in {open,close}_netns

The previous patches have removed the need to do the mount and umount
dance when switching netns. In particular:
* Avoid remounting /sys/fs/bpf to have a clean start
* Avoid remounting /sys to get a ifindex of a particular netns

This patch can finally remove the mount and umount dance in
{open,close}_netns which is unnecessarily complicated and
error-prone.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/bpf/20221129070900.3142427-6-martin.lau@linux.dev
tools/testing/selftests/bpf/network_helpers.c