All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread
@ 2018-06-14 16:04 Alexey Kodanev
  2018-06-14 16:04 ` [LTP] [PATCH 2/4] network/busy_poll: use SPDX-License-Identifier Alexey Kodanev
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Alexey Kodanev @ 2018-06-14 16:04 UTC (permalink / raw)
  To: ltp

This should make the results more stable for better performance
comparison with/without busy polling.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---

Tested on ixgbe NIC

 testcases/network/busy_poll/busy_poll01.sh   |    2 +-
 testcases/network/busy_poll/busy_poll02.sh   |    2 +-
 testcases/network/busy_poll/busy_poll03.sh   |    3 ++-
 testcases/network/busy_poll/busy_poll_lib.sh |    3 +++
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh
index 12d3cb5..a9c8cbd 100755
--- a/testcases/network/busy_poll/busy_poll01.sh
+++ b/testcases/network/busy_poll/busy_poll01.sh
@@ -58,7 +58,7 @@ trap "tst_brkm TBROK 'test interrupted'" INT
 for x in 50 0; do
 	tst_resm TINFO "set low latency busy poll to $x"
 	set_busy_poll $x
-	tst_netload -H $(tst_ipaddr rhost) -d res_$x
+	tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x
 done
 
 poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
diff --git a/testcases/network/busy_poll/busy_poll02.sh b/testcases/network/busy_poll/busy_poll02.sh
index 4873dc3..95eeee3 100755
--- a/testcases/network/busy_poll/busy_poll02.sh
+++ b/testcases/network/busy_poll/busy_poll02.sh
@@ -49,7 +49,7 @@ trap "tst_brkm TBROK 'test interrupted'" INT
 for x in 50 0; do
 	tst_resm TINFO "set low latency busy poll to $x per socket"
 	set_busy_poll $x
-	tst_netload -H $(tst_ipaddr rhost) -d res_$x -b $x
+	tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x -b $x
 done
 
 poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
diff --git a/testcases/network/busy_poll/busy_poll03.sh b/testcases/network/busy_poll/busy_poll03.sh
index 0144465..699bee2 100755
--- a/testcases/network/busy_poll/busy_poll03.sh
+++ b/testcases/network/busy_poll/busy_poll03.sh
@@ -51,7 +51,8 @@ do_test()
 	for x in 50 0; do
 		tst_resm TINFO "set low latency busy poll to $x per $1 socket"
 		set_busy_poll $x
-		tst_netload -H $(tst_ipaddr rhost) -d res_$x -b $x -T $1
+		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x \
+			    -b $x -T $1
 	done
 
 	poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
diff --git a/testcases/network/busy_poll/busy_poll_lib.sh b/testcases/network/busy_poll/busy_poll_lib.sh
index a00c74d..271c01b 100755
--- a/testcases/network/busy_poll/busy_poll_lib.sh
+++ b/testcases/network/busy_poll/busy_poll_lib.sh
@@ -14,6 +14,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
+# for more stable results set to a single thread
+TST_NETLOAD_CLN_NUMBER=1
+
 if tst_kvcmp -lt "3.11"; then
 	tst_brkm TCONF "test must be run with kernel 3.11 or newer"
 fi
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [LTP] [PATCH 2/4] network/busy_poll: use SPDX-License-Identifier
  2018-06-14 16:04 [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread Alexey Kodanev
@ 2018-06-14 16:04 ` Alexey Kodanev
  2018-06-15 15:08   ` Petr Vorel
  2018-06-14 16:04 ` [LTP] [PATCH 3/4] network/busy_poll: convert to new API Alexey Kodanev
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Alexey Kodanev @ 2018-06-14 16:04 UTC (permalink / raw)
  To: ltp

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/network/busy_poll/Makefile         |   16 ++--------------
 testcases/network/busy_poll/busy_poll01.sh   |   17 ++---------------
 testcases/network/busy_poll/busy_poll02.sh   |   17 ++---------------
 testcases/network/busy_poll/busy_poll03.sh   |   15 +--------------
 testcases/network/busy_poll/busy_poll_lib.sh |   16 ++--------------
 5 files changed, 9 insertions(+), 72 deletions(-)

diff --git a/testcases/network/busy_poll/Makefile b/testcases/network/busy_poll/Makefile
index 8feb006..3a85c7d 100644
--- a/testcases/network/busy_poll/Makefile
+++ b/testcases/network/busy_poll/Makefile
@@ -1,17 +1,5 @@
-# Copyright (c) 2015-2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 
 top_srcdir		?= ../../..
 
diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh
index a9c8cbd..5c59643 100755
--- a/testcases/network/busy_poll/busy_poll01.sh
+++ b/testcases/network/busy_poll/busy_poll01.sh
@@ -1,21 +1,8 @@
 #!/bin/sh
-# Copyright (c) 2015-2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-#
 
 TST_TOTAL=1
 TCID="busy_poll01"
diff --git a/testcases/network/busy_poll/busy_poll02.sh b/testcases/network/busy_poll/busy_poll02.sh
index 95eeee3..f0e4a0e 100755
--- a/testcases/network/busy_poll/busy_poll02.sh
+++ b/testcases/network/busy_poll/busy_poll02.sh
@@ -1,21 +1,8 @@
 #!/bin/sh
-# Copyright (c) 2015-2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-#
 
 TST_TOTAL=1
 TCID="busy_poll02"
diff --git a/testcases/network/busy_poll/busy_poll03.sh b/testcases/network/busy_poll/busy_poll03.sh
index 699bee2..b5fb28e 100755
--- a/testcases/network/busy_poll/busy_poll03.sh
+++ b/testcases/network/busy_poll/busy_poll03.sh
@@ -1,21 +1,8 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
 # Copyright (c) 2016-2018 Oracle and/or its affiliates.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-#
 
 TST_TOTAL=2
 TCID="busy_poll03"
diff --git a/testcases/network/busy_poll/busy_poll_lib.sh b/testcases/network/busy_poll/busy_poll_lib.sh
index 271c01b..6b2de07 100755
--- a/testcases/network/busy_poll/busy_poll_lib.sh
+++ b/testcases/network/busy_poll/busy_poll_lib.sh
@@ -1,18 +1,6 @@
 #!/bin/sh
-# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved.
 
 # for more stable results set to a single thread
 TST_NETLOAD_CLN_NUMBER=1
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [LTP] [PATCH 3/4] network/busy_poll: convert to new API
  2018-06-14 16:04 [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread Alexey Kodanev
  2018-06-14 16:04 ` [LTP] [PATCH 2/4] network/busy_poll: use SPDX-License-Identifier Alexey Kodanev
@ 2018-06-14 16:04 ` Alexey Kodanev
  2018-06-15 15:09   ` Petr Vorel
  2018-06-14 16:04 ` [LTP] [PATCH 4/4] network/busy_poll: check that we changed sysctl knobs in cleanup Alexey Kodanev
  2018-06-15 15:07 ` [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread Petr Vorel
  3 siblings, 1 reply; 9+ messages in thread
From: Alexey Kodanev @ 2018-06-14 16:04 UTC (permalink / raw)
  To: ltp

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/network/busy_poll/busy_poll01.sh   |   53 ++++++++++++-------------
 testcases/network/busy_poll/busy_poll02.sh   |   49 +++++++++++-------------
 testcases/network/busy_poll/busy_poll03.sh   |   35 +++++++----------
 testcases/network/busy_poll/busy_poll_lib.sh |   44 ++++++++++++----------
 4 files changed, 86 insertions(+), 95 deletions(-)

diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh
index 5c59643..1749e52 100755
--- a/testcases/network/busy_poll/busy_poll01.sh
+++ b/testcases/network/busy_poll/busy_poll01.sh
@@ -4,18 +4,10 @@
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TST_TOTAL=1
-TCID="busy_poll01"
-TST_NEEDS_TMPDIR=1
-
-TST_USE_LEGACY_API=1
-. tst_net.sh
 . busy_poll_lib.sh
 
 cleanup()
 {
-	tst_rmdir
-
 	sysctl -q -w net.core.busy_read=$busy_read_old
 	sysctl -q -w net.core.busy_poll=$busy_poll_old
 
@@ -33,27 +25,32 @@ set_busy_poll()
 	tst_rhost_run -s -c "sysctl -q -w net.core.busy_poll=$value"
 }
 
-busy_read_old="$(cat /proc/sys/net/core/busy_read)"
-busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
-
-rbusy_read_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_read')
-rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
-
-TST_CLEANUP="cleanup"
-trap "tst_brkm TBROK 'test interrupted'" INT
+setup()
+{
+	busy_poll_check_config
 
-for x in 50 0; do
-	tst_resm TINFO "set low latency busy poll to $x"
-	set_busy_poll $x
-	tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x
-done
+	busy_read_old="$(cat /proc/sys/net/core/busy_read)"
+	busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
 
-poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
+	rbusy_read_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_read')
+	rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+}
 
-if [ "$poll_cmp" -lt 1 ]; then
-	tst_resm TFAIL "busy poll result is '$poll_cmp' %"
-else
-	tst_resm TPASS "busy poll increased performance by '$poll_cmp' %"
-fi
+test()
+{
+	for x in 50 0; do
+		tst_res TINFO "set low latency busy poll to $x"
+		set_busy_poll $x
+		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x
+	done
+
+	local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
+
+	if [ "$poll_cmp" -lt 1 ]; then
+		tst_res TFAIL "busy poll result is '$poll_cmp' %"
+	else
+		tst_res TPASS "busy poll increased performance by '$poll_cmp' %"
+	fi
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/busy_poll/busy_poll02.sh b/testcases/network/busy_poll/busy_poll02.sh
index f0e4a0e..d0083c2 100755
--- a/testcases/network/busy_poll/busy_poll02.sh
+++ b/testcases/network/busy_poll/busy_poll02.sh
@@ -4,18 +4,10 @@
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TST_TOTAL=1
-TCID="busy_poll02"
-TST_NEEDS_TMPDIR=1
-
-TST_USE_LEGACY_API=1
-. tst_net.sh
 . busy_poll_lib.sh
 
 cleanup()
 {
-	tst_rmdir
-
 	sysctl -q -w net.core.busy_poll=$busy_poll_old
 	tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
 }
@@ -27,24 +19,29 @@ set_busy_poll()
 	tst_rhost_run -s -c "sysctl -q -w net.core.busy_poll=$value"
 }
 
-busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
-rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
-
-TST_CLEANUP="cleanup"
-trap "tst_brkm TBROK 'test interrupted'" INT
-
-for x in 50 0; do
-	tst_resm TINFO "set low latency busy poll to $x per socket"
-	set_busy_poll $x
-	tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x -b $x
-done
+setup()
+{
+	busy_poll_check_config
 
-poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
+	busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
+	rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+}
 
-if [ "$poll_cmp" -lt 1 ]; then
-	tst_resm TFAIL "busy poll result is '$poll_cmp' %"
-else
-	tst_resm TPASS "busy poll increased performance by '$poll_cmp' %"
-fi
+test()
+{
+	for x in 50 0; do
+		tst_res TINFO "set low latency busy poll to $x per socket"
+		set_busy_poll $x
+		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x -b $x
+	done
+
+	local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
+
+	if [ "$poll_cmp" -lt 1 ]; then
+		tst_res TFAIL "busy poll result is '$poll_cmp' %"
+	else
+		tst_res TPASS "busy poll increased performance by '$poll_cmp' %"
+	fi
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/busy_poll/busy_poll03.sh b/testcases/network/busy_poll/busy_poll03.sh
index b5fb28e..b55e220 100755
--- a/testcases/network/busy_poll/busy_poll03.sh
+++ b/testcases/network/busy_poll/busy_poll03.sh
@@ -4,18 +4,12 @@
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TST_TOTAL=2
-TCID="busy_poll03"
-TST_NEEDS_TMPDIR=1
+TST_TEST_DATA="udp udp_lite"
 
-TST_USE_LEGACY_API=1
-. tst_net.sh
 . busy_poll_lib.sh
 
 cleanup()
 {
-	tst_rmdir
-
 	sysctl -q -w net.core.busy_poll=$busy_poll_old
 	tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
 }
@@ -27,31 +21,30 @@ set_busy_poll()
 	tst_rhost_run -s -c "sysctl -q -w net.core.busy_poll=$value"
 }
 
-busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
-rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+setup()
+{
+	busy_poll_check_config
 
-TST_CLEANUP="cleanup"
-trap "tst_brkm TBROK 'test interrupted'" INT
+	busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
+	rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+}
 
-do_test()
+test()
 {
 	for x in 50 0; do
-		tst_resm TINFO "set low latency busy poll to $x per $1 socket"
+		tst_res TINFO "set low latency busy poll to $x per $2 socket"
 		set_busy_poll $x
 		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x \
-			    -b $x -T $1
+			    -b $x -T $2
 	done
 
-	poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
+	local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
 
 	if [ "$poll_cmp" -lt 1 ]; then
-		tst_resm TFAIL "busy poll result is '$poll_cmp' %"
+		tst_res TFAIL "busy poll result is '$poll_cmp' %"
 	else
-		tst_resm TPASS "busy poll increased performance by '$poll_cmp' %"
+		tst_res TPASS "busy poll increased performance by '$poll_cmp' %"
 	fi
 }
 
-do_test udp
-do_test udp_lite
-
-tst_exit
+tst_run
diff --git a/testcases/network/busy_poll/busy_poll_lib.sh b/testcases/network/busy_poll/busy_poll_lib.sh
index 6b2de07..5270a1b 100755
--- a/testcases/network/busy_poll/busy_poll_lib.sh
+++ b/testcases/network/busy_poll/busy_poll_lib.sh
@@ -2,28 +2,32 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved.
 
+TST_SETUP="setup"
+TST_TESTFUNC="test"
+TST_CLEANUP="cleanup"
+TST_MIN_KVER="3.11"
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_NEEDS_CMDS="pkill sysctl ethtool"
 # for more stable results set to a single thread
 TST_NETLOAD_CLN_NUMBER=1
 
-if tst_kvcmp -lt "3.11"; then
-	tst_brkm TCONF "test must be run with kernel 3.11 or newer"
-fi
+. tst_net.sh
 
-if [ ! -f "/proc/sys/net/core/busy_read" -a \
-     ! -f "/proc/sys/net/core/busy_poll" ]; then
-	tst_brkm TCONF "busy poll not configured, CONFIG_NET_RX_BUSY_POLL"
-fi
+busy_poll_check_config()
+{
+	if [ ! -f "/proc/sys/net/core/busy_read" -a \
+	     ! -f "/proc/sys/net/core/busy_poll" ]; then
+		tst_brk TCONF "busy poll not configured, CONFIG_NET_RX_BUSY_POLL"
+	fi
 
-tst_check_cmds pkill sysctl ethtool
-
-if tst_kvcmp -lt "4.5"; then
-	ethtool --show-features $(tst_iface) | \
-		grep -q 'busy-poll.*on' || \
-		tst_brkm TCONF "busy poll not supported by driver"
-else
-	drvs="bnx2x|bnxt|cxgb4|enic|benet|ixgbe|ixgbevf|mlx4|mlx5|myri10ge|sfc|virtio"
-	ethtool -i $(tst_iface) | grep -qE "driver: ($drvs)" || \
-		tst_brkm TCONF "busy poll not supported"
-fi
-
-tst_require_root
+	if tst_kvcmp -lt "4.5"; then
+		ethtool --show-features $(tst_iface) | \
+			grep -q 'busy-poll.*on' || \
+			tst_brk TCONF "busy poll not supported by driver"
+	else
+		drvs="bnx2x|bnxt|cxgb4|enic|benet|ixgbe|ixgbevf|mlx4|mlx5|myri10ge|sfc|virtio"
+		ethtool -i $(tst_iface) | grep -qE "driver: ($drvs)" || \
+			tst_brk TCONF "busy poll not supported"
+	fi
+}
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [LTP] [PATCH 4/4] network/busy_poll: check that we changed sysctl knobs in cleanup
  2018-06-14 16:04 [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread Alexey Kodanev
  2018-06-14 16:04 ` [LTP] [PATCH 2/4] network/busy_poll: use SPDX-License-Identifier Alexey Kodanev
  2018-06-14 16:04 ` [LTP] [PATCH 3/4] network/busy_poll: convert to new API Alexey Kodanev
@ 2018-06-14 16:04 ` Alexey Kodanev
  2018-06-15 15:10   ` Petr Vorel
  2018-06-15 15:07 ` [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread Petr Vorel
  3 siblings, 1 reply; 9+ messages in thread
From: Alexey Kodanev @ 2018-06-14 16:04 UTC (permalink / raw)
  To: ltp

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(-)

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()
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread
  2018-06-14 16:04 [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread Alexey Kodanev
                   ` (2 preceding siblings ...)
  2018-06-14 16:04 ` [LTP] [PATCH 4/4] network/busy_poll: check that we changed sysctl knobs in cleanup Alexey Kodanev
@ 2018-06-15 15:07 ` Petr Vorel
  3 siblings, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2018-06-15 15:07 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> This should make the results more stable for better performance
> comparison with/without busy polling.

> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
> ---
Unfortunately I don't have any machine with busy polling,
but I suppose you know what you're doing.

> Tested on ixgbe NIC


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH 2/4] network/busy_poll: use SPDX-License-Identifier
  2018-06-14 16:04 ` [LTP] [PATCH 2/4] network/busy_poll: use SPDX-License-Identifier Alexey Kodanev
@ 2018-06-15 15:08   ` Petr Vorel
  0 siblings, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2018-06-15 15:08 UTC (permalink / raw)
  To: ltp

> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Petr Vorel <pvorel@suse.cz>


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH 3/4] network/busy_poll: convert to new API
  2018-06-14 16:04 ` [LTP] [PATCH 3/4] network/busy_poll: convert to new API Alexey Kodanev
@ 2018-06-15 15:09   ` Petr Vorel
  0 siblings, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2018-06-15 15:09 UTC (permalink / raw)
  To: ltp

> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Petr Vorel <pvorel@suse.cz>


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH 4/4] network/busy_poll: check that we changed sysctl knobs in cleanup
  2018-06-14 16:04 ` [LTP] [PATCH 4/4] network/busy_poll: check that we changed sysctl knobs in cleanup Alexey Kodanev
@ 2018-06-15 15:10   ` Petr Vorel
  2018-06-22 12:55     ` Alexey Kodanev
  0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2018-06-15 15:10 UTC (permalink / raw)
  To: ltp

> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Petr Vorel <pvorel@suse.cz>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [LTP] [PATCH 4/4] network/busy_poll: check that we changed sysctl knobs in cleanup
  2018-06-15 15:10   ` Petr Vorel
@ 2018-06-22 12:55     ` Alexey Kodanev
  0 siblings, 0 replies; 9+ messages in thread
From: Alexey Kodanev @ 2018-06-22 12:55 UTC (permalink / raw)
  To: ltp

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!

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-06-22 12:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14 16:04 [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread Alexey Kodanev
2018-06-14 16:04 ` [LTP] [PATCH 2/4] network/busy_poll: use SPDX-License-Identifier Alexey Kodanev
2018-06-15 15:08   ` Petr Vorel
2018-06-14 16:04 ` [LTP] [PATCH 3/4] network/busy_poll: convert to new API Alexey Kodanev
2018-06-15 15:09   ` Petr Vorel
2018-06-14 16:04 ` [LTP] [PATCH 4/4] network/busy_poll: check that we changed sysctl knobs in cleanup Alexey Kodanev
2018-06-15 15:10   ` Petr Vorel
2018-06-22 12:55     ` Alexey Kodanev
2018-06-15 15:07 ` [LTP] [PATCH 1/4] network/busy_poll: use smaller packets and a single thread Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.