Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/net: optmem_max became per netns

/proc/sys/net/core/optmem_max is now per netns, change two tests
that were saving/changing/restoring its value on the parent netns.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
18872ba8 f5769fae

+8 -10
+4 -5
tools/testing/selftests/net/io_uring_zerocopy_tx.sh
··· 76 76 esac 77 77 78 78 # Start of state changes: install cleanup handler 79 - save_sysctl_mem="$(sysctl -n ${path_sysctl_mem})" 80 79 81 80 cleanup() { 82 81 ip netns del "${NS2}" 83 82 ip netns del "${NS1}" 84 - sysctl -w -q "${path_sysctl_mem}=${save_sysctl_mem}" 85 83 } 86 84 87 85 trap cleanup EXIT 88 86 89 - # Configure system settings 90 - sysctl -w -q "${path_sysctl_mem}=1000000" 91 - 92 87 # Create virtual ethernet pair between network namespaces 93 88 ip netns add "${NS1}" 94 89 ip netns add "${NS2}" 90 + 91 + # Configure system settings 92 + ip netns exec "${NS1}" sysctl -w -q "${path_sysctl_mem}=1000000" 93 + ip netns exec "${NS2}" sysctl -w -q "${path_sysctl_mem}=1000000" 95 94 96 95 ip link add "${DEV}" mtu "${DEV_MTU}" netns "${NS1}" type veth \ 97 96 peer name "${DEV}" mtu "${DEV_MTU}" netns "${NS2}"
+4 -5
tools/testing/selftests/net/msg_zerocopy.sh
··· 70 70 esac 71 71 72 72 # Start of state changes: install cleanup handler 73 - save_sysctl_mem="$(sysctl -n ${path_sysctl_mem})" 74 73 75 74 cleanup() { 76 75 ip netns del "${NS2}" 77 76 ip netns del "${NS1}" 78 - sysctl -w -q "${path_sysctl_mem}=${save_sysctl_mem}" 79 77 } 80 78 81 79 trap cleanup EXIT 82 80 83 - # Configure system settings 84 - sysctl -w -q "${path_sysctl_mem}=1000000" 85 - 86 81 # Create virtual ethernet pair between network namespaces 87 82 ip netns add "${NS1}" 88 83 ip netns add "${NS2}" 84 + 85 + # Configure system settings 86 + ip netns exec "${NS1}" sysctl -w -q "${path_sysctl_mem}=1000000" 87 + ip netns exec "${NS2}" sysctl -w -q "${path_sysctl_mem}=1000000" 89 88 90 89 ip link add "${DEV}" mtu "${DEV_MTU}" netns "${NS1}" type veth \ 91 90 peer name "${DEV}" mtu "${DEV_MTU}" netns "${NS2}"