network/busy_poll: Fix tests in namespaced env
PATCH 1/2 network/busy_poll: Fix tests in namespaced env
--- testcases/network/busy_poll/busy_poll01.sh | 15 ++++++--------- testcases/network/busy_poll/busy_poll02.sh | 7 +++---- testcases/network/busy_poll/busy_poll03.sh | 7 +++---- 3 files changed, 12 insertions(+), 17 deletions(-)
testcases/network/busy_poll/busy_poll01.sh +6 -9
@@ -21,22 +21,19 @@ cleanup() set_busy_poll() { local value=${1:-"0"} - ROD_SILENT sysctl -q -w net.core.busy_read=$value - ROD_SILENT sysctl -q -w net.core.busy_poll=$value - - tst_rhost_run -s -c "sysctl -q -w net.core.busy_read=$value" - tst_rhost_run -s -c "sysctl -q -w net.core.busy_poll=$value" + tst_set_sysctl net.core.busy_read $value safe + tst_set_sysctl net.core.busy_poll $value safe } setup() { busy_poll_check_config - busy_read_old="$(cat /proc/sys/net/core/busy_read)" - busy_poll_old="$(cat /proc/sys/net/core/busy_poll)" + busy_read_old="$(sysctl -n net.core.busy_read)" + busy_poll_old="$(sysctl -n 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') + rbusy_read_old=$(tst_rhost_run -c 'sysctl -ne net.core.busy_read') + rbusy_poll_old=$(tst_rhost_run -c 'sysctl -ne net.core.busy_poll') } test()
testcases/network/busy_poll/busy_poll02.sh +3 -4
@@ -17,16 +17,15 @@ cleanup() set_busy_poll() { local value=${1:-"0"} - ROD_SILENT sysctl -q -w net.core.busy_poll=$value - tst_rhost_run -s -c "sysctl -q -w net.core.busy_poll=$value" + tst_set_sysctl net.core.busy_poll $value safe } setup() { busy_poll_check_config - busy_poll_old="$(cat /proc/sys/net/core/busy_poll)" - rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll') + busy_poll_old="$(sysctl -n net.core.busy_poll)" + rbusy_poll_old=$(tst_rhost_run -c 'sysctl -ne net.core.busy_poll') } test()
testcases/network/busy_poll/busy_poll03.sh +3 -4
@@ -19,16 +19,15 @@ cleanup() set_busy_poll() { local value=${1:-"0"} - ROD_SILENT sysctl -q -w net.core.busy_poll=$value - tst_rhost_run -s -c "sysctl -q -w net.core.busy_poll=$value" + tst_set_sysctl net.core.busy_poll $value safe } setup() { busy_poll_check_config - busy_poll_old="$(cat /proc/sys/net/core/busy_poll)" - rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll') + busy_poll_old="$(sysctl -n /proc/sys/net/core/busy_poll)" + rbusy_poll_old=$(tst_rhost_run -c 'sysctl -ne /proc/sys/net/core/busy_poll') } test()
Signature · 1 line
2.31.1
PATCH 2/2 network/busy_poll: Remove unnecessary driver check
Kernel v4.5 extended the busy_poll functionality to all network drivers. Limiting the test only to drivers which implemented busy_poll as internal feature on older kernels does not make sense.
--- testcases/network/busy_poll/busy_poll_lib.sh | 4 ---- 1 file changed, 4 deletions(-)
testcases/network/busy_poll/busy_poll_lib.sh +0 -4
@@ -25,9 +25,5 @@ busy_poll_check_config() 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 }
Signature · 1 line
2.31.1
PATCH 2/2 network/busy_poll: Remove unnecessary driver check
Hi Martin,
Quoted 3 lines
Kernel v4.5 extended the
busy_pollfunctionality to all network drivers. Limiting the test only to drivers which implementedbusy_pollas internal feature on older kernels does not make sense.
Ah, you mean 85c72ba1ed0c ("Merge branch 'net-generic-busy-polling'") Good catch, thx!!
Kind regards,
Petr
Quoted 19 lines
Signed-off-by Martin Doucha <[email protected]>--- testcases/network/busy_poll/busy_poll_lib.sh | 4 ---- 1 file changed, 4 deletions(-)testcases/network/busy_poll/busy_poll_lib.sh +0
-4@@ -25,9 +25,5 @@ busy_poll_check_config() 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 }
PATCH 1/2 network/busy_poll: Fix tests in namespaced env
In reply to Martin Douchatestcases/network/busy_poll/busy_poll01.sh
Quoted 9 lines · Martin Doucha
Signed-off-by Martin Doucha <[email protected]>--- testcases/network/busy_poll/busy_poll01.sh | 15 ++++++--------- testcases/network/busy_poll/busy_poll02.sh | 7 +++---- testcases/network/busy_poll/busy_poll03.sh | 7 +++---- 3 files changed, 12 insertions(+), 17 deletions(-)testcases/network/busy_poll/busy_poll01.sh +0
-0
Hi Martin,
...
testcases/network/busy_poll/busy_poll01.sh
Quoted 9 lines
setup()
{testcases/network/busy_poll/busy_poll01.sh +2
-2busy_poll_check_config - busy_poll_old="$(cat /proc/sys/net/core/busy_poll)" - rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll') + busy_poll_old="$(sysctl -n /proc/sys/net/core/busy_poll)" + rbusy_poll_old=$(tst_rhost_run -c 'sysctl -ne /proc/sys/net/core/busy_poll') }
Here should be net.core.busy_poll, not the path.
Otherwise looks good.
PATCH 1/2 network/busy_poll: Fix tests in namespaced env
Quoted 18 lines · Martin Doucha
testcases/network/busy_poll/busy_poll01.sh
Quoted 8 lines
Signed-off-by Martin Doucha <[email protected]>--- testcases/network/busy_poll/busy_poll01.sh | 15 ++++++--------- testcases/network/busy_poll/busy_poll02.sh | 7 +++---- testcases/network/busy_poll/busy_poll03.sh | 7 +++---- 3 files changed, 12 insertions(+), 17 deletions(-)testcases/network/busy_poll/busy_poll01.sh +0
-0Hi Martin,
...
Quoted 3 lines
setup()
{
busy_poll_check_config
Quoted 7 lines
testcases/network/busy_poll/busy_poll01.sh
Quoted 5 lines
testcases/network/busy_poll/busy_poll01.sh +2
-2- busy_poll_old="$(cat /proc/sys/net/core/busy_poll)" - rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll') + busy_poll_old="$(sysctl -n /proc/sys/net/core/busy_poll)" + rbusy_poll_old=$(tst_rhost_run -c 'sysctl -ne /proc/sys/net/core/busy_poll') }Here should be net.core.busy_poll, not the path.
Hi Alexey, Martin,
Yep, I was just going to report it as well.
Merging both patches with this fix, thanks both for your time!
Kind regards,
Petr
Quoted 1 line
Otherwise looks good.
PATCH 1/2 network/busy_poll: Fix tests in namespaced env
Quoted 6 lines · Petr Vorel
Quoted 1 line
Here should be net.core.busy_poll, not the path.
Hi Alexey, Martin,
Yep, I was just going to report it as well.
Merging both patches with this fix, thanks both for your time!
Sorry about that and thanks for the fix.
Signature · 7 lines
Martin Doucha [email protected] QA Engineer for Software Maintenance SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic