linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/net: skip msg_zerocopy test if we have less than 4 CPUs
@ 2020-08-04 12:30 Colin King
  2020-08-04 23:06 ` David Miller
  2020-08-05  0:54 ` Eric Dumazet
  0 siblings, 2 replies; 7+ messages in thread
From: Colin King @ 2020-08-04 12:30 UTC (permalink / raw)
  To: David S . Miller, Shuah Khan, netdev, linux-kselftest
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The current test will exit with a failure if it cannot set affinity on
specific CPUs which is problematic when running this on single CPU
systems. Add a check for the number of CPUs and skip the test if
the CPU requirement is not met.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 tools/testing/selftests/net/msg_zerocopy.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/selftests/net/msg_zerocopy.sh b/tools/testing/selftests/net/msg_zerocopy.sh
index 825ffec85cea..97bc527e1297 100755
--- a/tools/testing/selftests/net/msg_zerocopy.sh
+++ b/tools/testing/selftests/net/msg_zerocopy.sh
@@ -21,6 +21,11 @@ readonly DADDR6='fd::2'
 
 readonly path_sysctl_mem="net.core.optmem_max"
 
+if [[ $(nproc) -lt 4 ]]; then
+	echo "SKIP: test requires at least 4 CPUs"
+	exit 4
+fi
+
 # No arguments: automated test
 if [[ "$#" -eq "0" ]]; then
 	$0 4 tcp -t 1
-- 
2.27.0


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

end of thread, other threads:[~2020-08-05  8:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04 12:30 [PATCH] selftests/net: skip msg_zerocopy test if we have less than 4 CPUs Colin King
2020-08-04 23:06 ` David Miller
2020-08-05  0:54 ` Eric Dumazet
2020-08-05  8:06   ` Willem de Bruijn
2020-08-05  8:22     ` Colin Ian King
2020-08-05  8:44       ` Willem de Bruijn
2020-08-05  8:48         ` Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).