Skip to content

Commit 18872ba

Browse files
edumazetdavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f5769fa commit 18872ba

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

tools/testing/selftests/net/io_uring_zerocopy_tx.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,22 @@ case "${TXMODE}" in
7676
esac
7777

7878
# Start of state changes: install cleanup handler
79-
save_sysctl_mem="$(sysctl -n ${path_sysctl_mem})"
8079

8180
cleanup() {
8281
ip netns del "${NS2}"
8382
ip netns del "${NS1}"
84-
sysctl -w -q "${path_sysctl_mem}=${save_sysctl_mem}"
8583
}
8684

8785
trap cleanup EXIT
8886

89-
# Configure system settings
90-
sysctl -w -q "${path_sysctl_mem}=1000000"
91-
9287
# Create virtual ethernet pair between network namespaces
9388
ip netns add "${NS1}"
9489
ip netns add "${NS2}"
9590

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"
94+
9695
ip link add "${DEV}" mtu "${DEV_MTU}" netns "${NS1}" type veth \
9796
peer name "${DEV}" mtu "${DEV_MTU}" netns "${NS2}"
9897

tools/testing/selftests/net/msg_zerocopy.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,22 @@ case "${TXMODE}" in
7070
esac
7171

7272
# Start of state changes: install cleanup handler
73-
save_sysctl_mem="$(sysctl -n ${path_sysctl_mem})"
7473

7574
cleanup() {
7675
ip netns del "${NS2}"
7776
ip netns del "${NS1}"
78-
sysctl -w -q "${path_sysctl_mem}=${save_sysctl_mem}"
7977
}
8078

8179
trap cleanup EXIT
8280

83-
# Configure system settings
84-
sysctl -w -q "${path_sysctl_mem}=1000000"
85-
8681
# Create virtual ethernet pair between network namespaces
8782
ip netns add "${NS1}"
8883
ip netns add "${NS2}"
8984

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"
88+
9089
ip link add "${DEV}" mtu "${DEV_MTU}" netns "${NS1}" type veth \
9190
peer name "${DEV}" mtu "${DEV_MTU}" netns "${NS2}"
9291

0 commit comments

Comments
 (0)