diff mbox series

[4/4] network/busy_poll: check that we changed sysctl knobs in cleanup

Message ID 1528992297-23920-4-git-send-email-alexey.kodanev@oracle.com
State Accepted
Delegated to: Petr Vorel
Headers show
Series [1/4] network/busy_poll: use smaller packets and a single thread | expand

Commit Message

Alexey Kodanev June 14, 2018, 4:04 p.m. UTC
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/network/busy_poll/busy_poll01.sh |   13 ++++++++-----
 testcases/network/busy_poll/busy_poll02.sh |    6 ++++--
 testcases/network/busy_poll/busy_poll03.sh |    6 ++++--
 3 files changed, 16 insertions(+), 9 deletions(-)

Comments

Petr Vorel June 15, 2018, 3:10 p.m. UTC | #1
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
Alexey Kodanev June 22, 2018, 12:55 p.m. UTC | #2
On 06/15/2018 06:10 PM, Petr Vorel wrote:
>> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> Acked-by: Petr Vorel <pvorel@suse.cz>

Applied, thanks!
diff mbox series

Patch

diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh
index 1749e52..0023f6c 100755
--- a/testcases/network/busy_poll/busy_poll01.sh
+++ b/testcases/network/busy_poll/busy_poll01.sh
@@ -8,11 +8,14 @@ 
 
 cleanup()
 {
-	sysctl -q -w net.core.busy_read=$busy_read_old
-	sysctl -q -w net.core.busy_poll=$busy_poll_old
-
-	tst_rhost_run -c "sysctl -q -w net.core.busy_read=$rbusy_read_old"
-	tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
+	[ -n "$busy_read_old" ] && \
+		sysctl -q -w net.core.busy_read=$busy_read_old
+	[ -n "$busy_poll_old" ] && \
+		sysctl -q -w net.core.busy_poll=$busy_poll_old
+	[ -n "$rbusy_read_old" ] && \
+		tst_rhost_run -c "sysctl -q -w net.core.busy_read=$rbusy_read_old"
+	[ -n "$rbusy_poll_old" ] && \
+		tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
 }
 
 set_busy_poll()
diff --git a/testcases/network/busy_poll/busy_poll02.sh b/testcases/network/busy_poll/busy_poll02.sh
index d0083c2..1f25b73 100755
--- a/testcases/network/busy_poll/busy_poll02.sh
+++ b/testcases/network/busy_poll/busy_poll02.sh
@@ -8,8 +8,10 @@ 
 
 cleanup()
 {
-	sysctl -q -w net.core.busy_poll=$busy_poll_old
-	tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
+	[ -n "$busy_poll_old" ] && \
+		sysctl -q -w net.core.busy_poll=$busy_poll_old
+	[ -n "$rbusy_poll_old" ] && \
+		tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
 }
 
 set_busy_poll()
diff --git a/testcases/network/busy_poll/busy_poll03.sh b/testcases/network/busy_poll/busy_poll03.sh
index b55e220..3c70299 100755
--- a/testcases/network/busy_poll/busy_poll03.sh
+++ b/testcases/network/busy_poll/busy_poll03.sh
@@ -10,8 +10,10 @@  TST_TEST_DATA="udp udp_lite"
 
 cleanup()
 {
-	sysctl -q -w net.core.busy_poll=$busy_poll_old
-	tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
+	[ -n "$busy_poll_old" ] && \
+		sysctl -q -w net.core.busy_poll=$busy_poll_old
+	[ -n "$rbusy_poll_old" ] && \
+		tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
 }
 
 set_busy_poll()