All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env
@ 2021-05-31 13:53 Martin Doucha
  2021-05-31 13:53 ` [LTP] [PATCH 2/2] network/busy_poll: Remove unnecessary driver check Martin Doucha
  2021-06-01  8:48 ` [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env Alexey Kodanev
  0 siblings, 2 replies; 6+ messages in thread
From: Martin Doucha @ 2021-05-31 13:53 UTC (permalink / raw)
  To: ltp

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 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(-)

diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh
index d306d1be8..0be4c5f96 100755
--- a/testcases/network/busy_poll/busy_poll01.sh
+++ b/testcases/network/busy_poll/busy_poll01.sh
@@ -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()
diff --git a/testcases/network/busy_poll/busy_poll02.sh b/testcases/network/busy_poll/busy_poll02.sh
index d02aa7342..ec275bec9 100755
--- a/testcases/network/busy_poll/busy_poll02.sh
+++ b/testcases/network/busy_poll/busy_poll02.sh
@@ -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()
diff --git a/testcases/network/busy_poll/busy_poll03.sh b/testcases/network/busy_poll/busy_poll03.sh
index f6f1ac134..ccdb8308a 100755
--- a/testcases/network/busy_poll/busy_poll03.sh
+++ b/testcases/network/busy_poll/busy_poll03.sh
@@ -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()
-- 
2.31.1


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

* [LTP] [PATCH 2/2] network/busy_poll: Remove unnecessary driver check
  2021-05-31 13:53 [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env Martin Doucha
@ 2021-05-31 13:53 ` Martin Doucha
  2021-06-01  8:22   ` Petr Vorel
  2021-06-01  8:48 ` [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env Alexey Kodanev
  1 sibling, 1 reply; 6+ messages in thread
From: Martin Doucha @ 2021-05-31 13:53 UTC (permalink / raw)
  To: ltp

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.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/network/busy_poll/busy_poll_lib.sh | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/testcases/network/busy_poll/busy_poll_lib.sh b/testcases/network/busy_poll/busy_poll_lib.sh
index 5270a1bbd..d17504466 100755
--- a/testcases/network/busy_poll/busy_poll_lib.sh
+++ b/testcases/network/busy_poll/busy_poll_lib.sh
@@ -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
 }
-- 
2.31.1


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

* [LTP] [PATCH 2/2] network/busy_poll: Remove unnecessary driver check
  2021-05-31 13:53 ` [LTP] [PATCH 2/2] network/busy_poll: Remove unnecessary driver check Martin Doucha
@ 2021-06-01  8:22   ` Petr Vorel
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2021-06-01  8:22 UTC (permalink / raw)
  To: ltp

Hi Martin,

> 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.

Ah, you mean 85c72ba1ed0c ("Merge branch 'net-generic-busy-polling'")
Good catch, thx!!

Fixes: ead28f929 ("busy_poll: skip busy_poll flag test on kernels 4.5+")

Kind regards,
Petr

> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  testcases/network/busy_poll/busy_poll_lib.sh | 4 ----
>  1 file changed, 4 deletions(-)

> diff --git a/testcases/network/busy_poll/busy_poll_lib.sh b/testcases/network/busy_poll/busy_poll_lib.sh
> index 5270a1bbd..d17504466 100755
> --- a/testcases/network/busy_poll/busy_poll_lib.sh
> +++ b/testcases/network/busy_poll/busy_poll_lib.sh
> @@ -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
>  }

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

* [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env
  2021-05-31 13:53 [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env Martin Doucha
  2021-05-31 13:53 ` [LTP] [PATCH 2/2] network/busy_poll: Remove unnecessary driver check Martin Doucha
@ 2021-06-01  8:48 ` Alexey Kodanev
  2021-06-01  9:00   ` Petr Vorel
  1 sibling, 1 reply; 6+ messages in thread
From: Alexey Kodanev @ 2021-06-01  8:48 UTC (permalink / raw)
  To: ltp

On 31.05.2021 16:53, Martin Doucha wrote:
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  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(-)
> 
> diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh
> 

Hi Martin,

...
>  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')
>  }

Here should be net.core.busy_poll, not the path.
Otherwise looks good.

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

* [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env
  2021-06-01  8:48 ` [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env Alexey Kodanev
@ 2021-06-01  9:00   ` Petr Vorel
  2021-06-01  9:03     ` Martin Doucha
  0 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2021-06-01  9:00 UTC (permalink / raw)
  To: ltp

> On 31.05.2021 16:53, Martin Doucha wrote:
> > Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> > ---
> >  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(-)

> > diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh


> Hi Martin,

> ...
> >  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')
> >  }

> 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

> Otherwise looks good.

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

* [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env
  2021-06-01  9:00   ` Petr Vorel
@ 2021-06-01  9:03     ` Martin Doucha
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Doucha @ 2021-06-01  9:03 UTC (permalink / raw)
  To: ltp

On 01. 06. 21 11:00, Petr Vorel wrote:
>> 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.

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

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

end of thread, other threads:[~2021-06-01  9:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31 13:53 [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env Martin Doucha
2021-05-31 13:53 ` [LTP] [PATCH 2/2] network/busy_poll: Remove unnecessary driver check Martin Doucha
2021-06-01  8:22   ` Petr Vorel
2021-06-01  8:48 ` [LTP] [PATCH 1/2] network/busy_poll: Fix tests in namespaced env Alexey Kodanev
2021-06-01  9:00   ` Petr Vorel
2021-06-01  9:03     ` Martin Doucha

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.