DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test: rely on EAL detection for core list
@ 2021-10-18 17:01 David Marchand
  2021-10-18 17:53 ` Bruce Richardson
  2021-10-19 11:26 ` [dpdk-dev] [PATCH v2] " David Marchand
  0 siblings, 2 replies; 13+ messages in thread
From: David Marchand @ 2021-10-18 17:01 UTC (permalink / raw)
  To: dev; +Cc: aconole, blo

Cores count has a direct impact on the time needed to complete unit
tests.

Currently, the core list used for unit test is enforced to "all cores on
the system" with no way for (CI) users to adapt it.
On the other hand, EAL default behavior (when no -c/-l option gets passed)
is to start threads on as many cores available in the process cpu
affinity.

Remove logic from meson: users can then select where to run the tests by
either running meson with a custom cpu affinity (using taskset/cpuset
depending on OS) or by passing a --test-args option to meson.

Example:
$ sudo meson test -C build --suite fast-tests -t 3 --test-args "-l 0-3"

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
I wanted to post this as a RFC, but now, I wonder if all CI test RFC
patches, so sending as a normal patch.

---
 app/test/get-coremask.sh | 13 -------------
 app/test/meson.build     | 10 +---------
 2 files changed, 1 insertion(+), 22 deletions(-)
 delete mode 100755 app/test/get-coremask.sh

diff --git a/app/test/get-coremask.sh b/app/test/get-coremask.sh
deleted file mode 100755
index bb8cf404d2..0000000000
--- a/app/test/get-coremask.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#! /bin/sh -e
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2019 Intel Corporation
-
-if [ "$(uname)" = "Linux" ] ; then
-	cat /sys/devices/system/cpu/present
-elif [ "$(uname)" = "FreeBSD" ] ; then
-	ncpus=$(/sbin/sysctl -n hw.ncpu)
-	echo 0-$(expr $ncpus - 1)
-else
-# fallback
-	echo 0-3
-fi
diff --git a/app/test/meson.build b/app/test/meson.build
index a16374b7a1..c7b377d52d 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -463,13 +463,8 @@ message('hugepage availability: @0@'.format(has_hugepage))
 timeout_seconds = 600
 timeout_seconds_fast = 10
 
-get_coremask = find_program('get-coremask.sh')
-num_cores_arg = '-l ' + run_command(get_coremask).stdout().strip()
-
-default_test_args = [num_cores_arg]
-
 foreach arg : fast_tests
-    test_args = default_test_args
+    test_args = []
     run_test = true
     if not has_hugepage
         if arg[1]
@@ -502,7 +497,6 @@ endforeach
 foreach arg : perf_test_names
     test(arg, dpdk_test,
             env : ['DPDK_TEST=' + arg],
-            args : default_test_args,
             timeout : timeout_seconds,
             is_parallel : false,
             suite : 'perf-tests')
@@ -511,7 +505,6 @@ endforeach
 foreach arg : driver_test_names
     test(arg, dpdk_test,
             env : ['DPDK_TEST=' + arg],
-            args : default_test_args,
             timeout : timeout_seconds,
             is_parallel : false,
             suite : 'driver-tests')
@@ -520,7 +513,6 @@ endforeach
 foreach arg : dump_test_names
     test(arg, dpdk_test,
             env : ['DPDK_TEST=' + arg],
-            args : default_test_args,
             timeout : timeout_seconds,
             is_parallel : false,
             suite : 'debug-tests')
-- 
2.23.0


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

end of thread, other threads:[~2021-10-21 14:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 17:01 [dpdk-dev] [PATCH] test: rely on EAL detection for core list David Marchand
2021-10-18 17:53 ` Bruce Richardson
2021-10-19  9:52   ` David Marchand
2021-10-19 10:04     ` Bruce Richardson
2021-10-19 11:26 ` [dpdk-dev] [PATCH v2] " David Marchand
2021-10-19 12:43   ` Bruce Richardson
2021-10-19 14:46   ` Honnappa Nagarahalli
2021-10-19 15:04     ` David Marchand
2021-10-19 18:04       ` Honnappa Nagarahalli
2021-10-19 19:09   ` Aaron Conole
2021-10-19 19:28     ` David Marchand
2021-10-20 11:20       ` David Marchand
2021-10-21 14:50     ` David Marchand

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