Commit 18872ba8 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f5769fae
...@@ -76,23 +76,22 @@ case "${TXMODE}" in ...@@ -76,23 +76,22 @@ case "${TXMODE}" in
esac esac
# Start of state changes: install cleanup handler # Start of state changes: install cleanup handler
save_sysctl_mem="$(sysctl -n ${path_sysctl_mem})"
cleanup() { cleanup() {
ip netns del "${NS2}" ip netns del "${NS2}"
ip netns del "${NS1}" ip netns del "${NS1}"
sysctl -w -q "${path_sysctl_mem}=${save_sysctl_mem}"
} }
trap cleanup EXIT trap cleanup EXIT
# Configure system settings
sysctl -w -q "${path_sysctl_mem}=1000000"
# Create virtual ethernet pair between network namespaces # Create virtual ethernet pair between network namespaces
ip netns add "${NS1}" ip netns add "${NS1}"
ip netns add "${NS2}" ip netns add "${NS2}"
# Configure system settings
ip netns exec "${NS1}" sysctl -w -q "${path_sysctl_mem}=1000000"
ip netns exec "${NS2}" sysctl -w -q "${path_sysctl_mem}=1000000"
ip link add "${DEV}" mtu "${DEV_MTU}" netns "${NS1}" type veth \ ip link add "${DEV}" mtu "${DEV_MTU}" netns "${NS1}" type veth \
peer name "${DEV}" mtu "${DEV_MTU}" netns "${NS2}" peer name "${DEV}" mtu "${DEV_MTU}" netns "${NS2}"
......
...@@ -70,23 +70,22 @@ case "${TXMODE}" in ...@@ -70,23 +70,22 @@ case "${TXMODE}" in
esac esac
# Start of state changes: install cleanup handler # Start of state changes: install cleanup handler
save_sysctl_mem="$(sysctl -n ${path_sysctl_mem})"
cleanup() { cleanup() {
ip netns del "${NS2}" ip netns del "${NS2}"
ip netns del "${NS1}" ip netns del "${NS1}"
sysctl -w -q "${path_sysctl_mem}=${save_sysctl_mem}"
} }
trap cleanup EXIT trap cleanup EXIT
# Configure system settings
sysctl -w -q "${path_sysctl_mem}=1000000"
# Create virtual ethernet pair between network namespaces # Create virtual ethernet pair between network namespaces
ip netns add "${NS1}" ip netns add "${NS1}"
ip netns add "${NS2}" ip netns add "${NS2}"
# Configure system settings
ip netns exec "${NS1}" sysctl -w -q "${path_sysctl_mem}=1000000"
ip netns exec "${NS2}" sysctl -w -q "${path_sysctl_mem}=1000000"
ip link add "${DEV}" mtu "${DEV_MTU}" netns "${NS1}" type veth \ ip link add "${DEV}" mtu "${DEV_MTU}" netns "${NS1}" type veth \
peer name "${DEV}" mtu "${DEV_MTU}" netns "${NS2}" peer name "${DEV}" mtu "${DEV_MTU}" netns "${NS2}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment